Skip to content

Commit 8c78e73

Browse files
Update README.md
1 parent c1b378d commit 8c78e73

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,35 @@ In order to get started, we recommend taking a look at two notebooks:
3434
- The [Training a diffusers model](https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/training_example.ipynb) notebook summarizes diffuser model training methods. This notebook takes a step-by-step approach to training your
3535
diffuser model on an image dataset, with explanatory graphics.
3636

37+
## **New** Stable Diffusion is now fully compatible with `diffusers`!
38+
39+
```py
40+
# make sure you're logged in with `huggingface-cli login`
41+
from torch import autocast
42+
from diffusers import StableDiffusionPipeline, LMSDiscreteScheduler
43+
44+
lms = LMSDiscreteScheduler(
45+
beta_start=0.00085,
46+
beta_end=0.012,
47+
beta_schedule="scaled_linear"
48+
)
49+
50+
pipe = StableDiffusionPipeline.from_pretrained(
51+
"CompVis/stable-diffusion-v1-3-diffusers",
52+
scheduler=lms,
53+
use_auth_token=True
54+
)
55+
56+
prompt = "a photo of an astronaut riding a horse on mars"
57+
with autocast("cuda"):
58+
image = pipe(prompt, width=768, guidance_scale=7)["sample"][0]
59+
60+
image.save("astronaut_rides_horse.png")
61+
```
62+
63+
For more details, check out [this notebook](https://github.com/huggingface/notebooks/blob/main/diffusers/stable_diffusion.ipynb)
64+
and have a look into the [release notes](https://github.com/huggingface/diffusers/releases/tag/v0.2.0).
65+
3766
## Examples
3867

3968
If you want to run the code yourself 💻, you can try out:

0 commit comments

Comments
 (0)