Skip to content

Conversation

@noskill
Copy link
Contributor

@noskill noskill commented Aug 29, 2023

What does this PR do?

sketch inpaint from a1111 for non-inpaint models.

Pipleline takes an image and a mask as inputs. It does inpainting by doing this step on each iteration

latent = latent * mask + image_latent * (1 - mask)

that is we replace latent code for non-masked parts of images with latents from the encoding of the image

code in a1111 works with both: inpainting and non-inpainting models. The pipeline from this pr will work only with non-inpaint ones

@adhikjoshi
Copy link

There is lots of things from auto1111 if we can port. Like highres fix.

@patrickvonplaten
Copy link
Contributor

Cool!

@patrickvonplaten patrickvonplaten merged commit af3854d into huggingface:main Aug 30, 2023
@deepconv
Copy link

Without a specially trained inpainting model, does this trick really work? My experiment is that the inpainted area does not respect the context well.

@noskill
Copy link
Contributor Author

noskill commented Aug 31, 2023

@deepconv yes, it works:

result6

result4

result3

I used this model https://civitai.com/models/28059?modelVersionId=89464 for tests.

AmericanPresidentJimmyCarter pushed a commit to AmericanPresidentJimmyCarter/diffusers that referenced this pull request Apr 26, 2024
* Create masked_stable_diffusion_img2img.py

* add MaskedIm2ImPipeline to readme

* Update README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants