You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-16
Original file line number
Diff line number
Diff line change
@@ -210,14 +210,16 @@ You can also run this example on colab [, read the license carefully and tick the checkbox if you agree. Note that this is an additional license, you need to accept it even if you accepted the text-to-image Stable Diffusion license in the past. You have to be a registered user in 🤗 Hugging Face Hub, and you'll also need to use an access token for the code to work. For more information on access tokens, please refer to [this section](https://huggingface.co/docs/hub/security-tokens) of the documentation.
217
216
218
-
import torch
219
-
import requests
217
+
218
+
```python
220
219
importPIL
220
+
import requests
221
+
import torch
222
+
from io import BytesIO
221
223
222
224
from diffusers import StableDiffusionInpaintPipeline
You can also run this example on colab [](https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/in_painting_with_stable_diffusion_using_diffusers.ipynb)
Note that this model is distributed separately from the regular Stable Diffusion model, so you have to accept its license even if you accepted the Stable Diffusion one in the past.
19
19
20
-
importrequests
20
+
Please, visit the [model card](https://huggingface.co/runwayml/stable-diffusion-inpainting), read the license carefully and tick the checkbox if you agree. You have to be a registered user in 🤗 Hugging Face Hub, and you'll also need to use an access token for the code to work. For more information on access tokens, please refer to [this section](https://huggingface.co/docs/hub/security-tokens) of the documentation.
21
+
</Tip>
22
+
23
+
```python
21
24
importPIL
25
+
import requests
26
+
import torch
27
+
from io import BytesIO
22
28
23
29
from diffusers import StableDiffusionInpaintPipeline
<imgsrc="https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png"alt="drawing"width="250"/> | <imgsrc="https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png"alt="drawing"width="250"/> | ***Face of a yellow cat, high resolution, sitting on a park bench*** | <imgsrc="https://huggingface.co/datasets/patrickvonplaten/images/resolve/main/test.png"alt="drawing"width="250"/> |
44
57
45
-
images[0].save("cat_on_bench.png")
46
-
```
47
58
48
59
You can also run this example on colab [](https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/in_painting_with_stable_diffusion_using_diffusers.ipynb)
60
+
61
+
<Tipwarning={true}>
62
+
A previous experimental implementation of in-painting 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 in-painting method.
You can also run this example on colab [](https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/in_painting_with_stable_diffusion_using_diffusers.ipynb)
0 commit comments