Update README.md
Browse files
README.md
CHANGED
|
@@ -66,7 +66,7 @@ steps), SDXL (50 inference steps), SDXL Turbo (1 inference step) and Würstchen
|
|
| 66 |
|
| 67 |
## Code Example
|
| 68 |
|
| 69 |
-
For the code below to work, you have to install `diffusers` from this branch while the PR is WIP.
|
| 70 |
|
| 71 |
```shell
|
| 72 |
pip install git+https://github.com/kashif/diffusers.git@wuerstchen-v3
|
|
@@ -77,11 +77,10 @@ import torch
|
|
| 77 |
from diffusers import StableCascadeDecoderPipeline, StableCascadePriorPipeline
|
| 78 |
|
| 79 |
device = "cuda"
|
| 80 |
-
dtype = torch.bfloat16
|
| 81 |
num_images_per_prompt = 2
|
| 82 |
|
| 83 |
-
prior = StableCascadePriorPipeline.from_pretrained("stabilityai/stable-cascade-prior", torch_dtype=
|
| 84 |
-
decoder = StableCascadeDecoderPipeline.from_pretrained("stabilityai/stable-cascade", torch_dtype=
|
| 85 |
|
| 86 |
prompt = "Anthropomorphic cat dressed as a pilot"
|
| 87 |
negative_prompt = ""
|
|
@@ -93,16 +92,18 @@ prior_output = prior(
|
|
| 93 |
negative_prompt=negative_prompt,
|
| 94 |
guidance_scale=4.0,
|
| 95 |
num_images_per_prompt=num_images_per_prompt,
|
|
|
|
| 96 |
)
|
| 97 |
decoder_output = decoder(
|
| 98 |
-
image_embeddings=prior_output.image_embeddings,
|
| 99 |
prompt=prompt,
|
| 100 |
negative_prompt=negative_prompt,
|
| 101 |
guidance_scale=0.0,
|
| 102 |
output_type="pil",
|
|
|
|
| 103 |
).images
|
| 104 |
|
| 105 |
-
decoder_output
|
| 106 |
```
|
| 107 |
|
| 108 |
## Uses
|
|
|
|
| 66 |
|
| 67 |
## Code Example
|
| 68 |
|
| 69 |
+
**⚠️ Important**: For the code below to work, you have to install `diffusers` from this branch while the PR is WIP.
|
| 70 |
|
| 71 |
```shell
|
| 72 |
pip install git+https://github.com/kashif/diffusers.git@wuerstchen-v3
|
|
|
|
| 77 |
from diffusers import StableCascadeDecoderPipeline, StableCascadePriorPipeline
|
| 78 |
|
| 79 |
device = "cuda"
|
|
|
|
| 80 |
num_images_per_prompt = 2
|
| 81 |
|
| 82 |
+
prior = StableCascadePriorPipeline.from_pretrained("stabilityai/stable-cascade-prior", torch_dtype=torch.bfloat16).to(device)
|
| 83 |
+
decoder = StableCascadeDecoderPipeline.from_pretrained("stabilityai/stable-cascade", torch_dtype=torch.float16).to(device)
|
| 84 |
|
| 85 |
prompt = "Anthropomorphic cat dressed as a pilot"
|
| 86 |
negative_prompt = ""
|
|
|
|
| 92 |
negative_prompt=negative_prompt,
|
| 93 |
guidance_scale=4.0,
|
| 94 |
num_images_per_prompt=num_images_per_prompt,
|
| 95 |
+
num_inference_steps=20
|
| 96 |
)
|
| 97 |
decoder_output = decoder(
|
| 98 |
+
image_embeddings=prior_output.image_embeddings.half(),
|
| 99 |
prompt=prompt,
|
| 100 |
negative_prompt=negative_prompt,
|
| 101 |
guidance_scale=0.0,
|
| 102 |
output_type="pil",
|
| 103 |
+
num_inference_steps=10
|
| 104 |
).images
|
| 105 |
|
| 106 |
+
#Now decoder_output is a list with your PIL images
|
| 107 |
```
|
| 108 |
|
| 109 |
## Uses
|