Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/main/diffusers_doc/en/inpaint.ipynb
Views: 2542
Text-guided image-inpainting
The StableDiffusionInpaintPipeline allows you to edit specific parts of an image by providing a mask and a text prompt. It uses a version of Stable Diffusion, like runwayml/stable-diffusion-inpainting
specifically trained for inpainting tasks.
Get started by loading an instance of the StableDiffusionInpaintPipeline:
Download an image and a mask of a dog which you'll eventually replace:
Now you can create a prompt to replace the mask with something else:
image | mask_image | prompt | output |
---|---|---|---|
Face of a yellow cat, high resolution, sitting on a park bench |
A previous experimental implementation of inpainting used a different, lower-quality process. To ensure backwards compatibility, loading a pretrained pipeline that doesn't contain the new model will still apply the old inpainting method.
Check out the Spaces below to try out image inpainting yourself!