replicate / outpainter

A web GUI built with Nuxt.js for outpainting with Stable Diffusion using the Replicate API.
https://outpainter.app
MIT License
46 stars 8 forks source link

make the mask overlap into the image a little bit #3

Closed zeke closed 1 year ago

zeke commented 1 year ago

When playing around with outpainting manually, I noticed that I got better results if the mask overlapped the boundaries of the input image a bit, rather then being exactly on the edge. Without this, you sometimes end up with an outpainting that is very separate and incoherent like this one:

Screenshot 2023-06-13 at 1 10 30 PM

I realize this may not be totally clear. I can follow up with a graphic to illustrate the point.

Pwntus commented 1 year ago

Yes I understand and that makes sense. It's unclear though for me if the black mask square should be "larger" or "smaller" than the initial input image.

I tested it and so far it looks like the black mask square should be "smaller". The black in this context represents what should remain of the initial input image, so by making it "smaller" than the initial input image we're essentially giving up the edges to the Stable Diffusion process - which in turn may give a better "blend".

I "fixed" this here, where you can change it from adding or subtracting the mask overlap: https://github.com/replicate/outpainter/commit/9f873000526c62090e5600a18e2ed0f85caf43b5#diff-1bb47f64a60a39f2bf6f26cf6c92b694351a085663277a1be1262435ac0c6aa4R132

zeke commented 1 year ago

I tested it and so far it looks like the black mask square should be "smaller". The black in this context represents what should remain of the initial input image, so by making it "smaller" than the initial input image we're essentially giving up the edges to the Stable Diffusion process - which in turn may give a better "blend".

Exactly!