Commit ·
1681ed0
1
Parent(s): 0096a99
Update README.md
Browse files
README.md
CHANGED
|
@@ -76,8 +76,10 @@ A **single step** is enough to generate high quality images.
|
|
| 76 |
```py
|
| 77 |
from diffusers import AutoPipelineForText2Image
|
| 78 |
import torch
|
|
|
|
| 79 |
pipe = AutoPipelineForText2Image.from_pretrained("stabilityai/sd-turbo", torch_dtype=torch.float16, variant="fp16")
|
| 80 |
pipe.to("cuda")
|
|
|
|
| 81 |
prompt = "A cinematic shot of a baby racoon wearing an intricate italian priest robe."
|
| 82 |
image = pipe(prompt=prompt, num_inference_steps=1, guidance_scale=0.0).images[0]
|
| 83 |
```
|
|
@@ -91,9 +93,14 @@ below.
|
|
| 91 |
```py
|
| 92 |
from diffusers import AutoPipelineForImage2Image
|
| 93 |
from diffusers.utils import load_image
|
|
|
|
|
|
|
| 94 |
pipe = AutoPipelineForImage2Image.from_pretrained("stabilityai/sd-turbo", torch_dtype=torch.float16, variant="fp16")
|
|
|
|
|
|
|
| 95 |
init_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png").resize((512, 512))
|
| 96 |
prompt = "cat wizard, gandalf, lord of the rings, detailed, fantasy, cute, adorable, Pixar, Disney, 8k"
|
|
|
|
| 97 |
image = pipe(prompt, image=init_image, num_inference_steps=2, strength=0.5, guidance_scale=0.0).images[0]
|
| 98 |
```
|
| 99 |
|
|
|
|
| 76 |
```py
|
| 77 |
from diffusers import AutoPipelineForText2Image
|
| 78 |
import torch
|
| 79 |
+
|
| 80 |
pipe = AutoPipelineForText2Image.from_pretrained("stabilityai/sd-turbo", torch_dtype=torch.float16, variant="fp16")
|
| 81 |
pipe.to("cuda")
|
| 82 |
+
|
| 83 |
prompt = "A cinematic shot of a baby racoon wearing an intricate italian priest robe."
|
| 84 |
image = pipe(prompt=prompt, num_inference_steps=1, guidance_scale=0.0).images[0]
|
| 85 |
```
|
|
|
|
| 93 |
```py
|
| 94 |
from diffusers import AutoPipelineForImage2Image
|
| 95 |
from diffusers.utils import load_image
|
| 96 |
+
import torch
|
| 97 |
+
|
| 98 |
pipe = AutoPipelineForImage2Image.from_pretrained("stabilityai/sd-turbo", torch_dtype=torch.float16, variant="fp16")
|
| 99 |
+
pipe.to("cuda")
|
| 100 |
+
|
| 101 |
init_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png").resize((512, 512))
|
| 102 |
prompt = "cat wizard, gandalf, lord of the rings, detailed, fantasy, cute, adorable, Pixar, Disney, 8k"
|
| 103 |
+
|
| 104 |
image = pipe(prompt, image=init_image, num_inference_steps=2, strength=0.5, guidance_scale=0.0).images[0]
|
| 105 |
```
|
| 106 |
|