Update README.md
Browse files
README.md
CHANGED
@@ -42,20 +42,15 @@ pip install git+https://github.com/diffusers.git transformers accelerate scipy s
|
|
42 |
Running the pipeline (if you don't swap the scheduler it will run with the default DDIM, in this example we are swapping it to DPMSolverMultistepScheduler):
|
43 |
|
44 |
```python
|
45 |
-
import requests
|
46 |
-
import torch
|
47 |
-
from PIL import Image
|
48 |
-
from io import BytesIO
|
49 |
-
|
50 |
from diffusers import DiffusionPipeline
|
|
|
51 |
|
52 |
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-2-1-unclip-small", torch_dtype=torch.float16)
|
53 |
pipe.to("cuda")
|
54 |
|
55 |
# get image
|
56 |
url = "https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/stable_unclip/tarsila_do_amaral.png"
|
57 |
-
|
58 |
-
image = Image.open(BytesIO(response.content)).convert("RGB")
|
59 |
|
60 |
# run image variation
|
61 |
image = pipe(image).images[0]
|
|
|
42 |
Running the pipeline (if you don't swap the scheduler it will run with the default DDIM, in this example we are swapping it to DPMSolverMultistepScheduler):
|
43 |
|
44 |
```python
|
|
|
|
|
|
|
|
|
|
|
45 |
from diffusers import DiffusionPipeline
|
46 |
+
from diffusers.utils import load_image
|
47 |
|
48 |
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-2-1-unclip-small", torch_dtype=torch.float16)
|
49 |
pipe.to("cuda")
|
50 |
|
51 |
# get image
|
52 |
url = "https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/stable_unclip/tarsila_do_amaral.png"
|
53 |
+
image = load_image(url)
|
|
|
54 |
|
55 |
# run image variation
|
56 |
image = pipe(image).images[0]
|