Skip to content

Commit 8608795

Browse files
authored
[docs] add euler scheduler in docs, how to use differnet schedulers (#1089)
* add euler scheduler in docs * add a section for how to use different scheds * address patrck's comments
1 parent 98c4213 commit 8608795

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

docs/source/api/pipelines/stable_diffusion.mdx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,21 @@ For more details about how Stable Diffusion works and how it differs from the ba
3131

3232
## Tips
3333

34+
### How to load and use different schedulers.
35+
36+
The stable diffusion pipeline uses [`PNDMScheduler`] scheduler by default. But `diffusers` provides many other schedulers that can be used with the stable diffusion pipeline such as [`DDIMScheduler`], [`LMSDiscreteScheduler`], [`EulerDiscreteScheduler`], [`EulerAncestralDiscreteScheduler`] etc.
37+
To use a different scheduler, you can pass the `scheduler` argument to `from_pretrained` method of the pipeline. For example, to use the [`EulerDiscreteScheduler`], you can do the following:
38+
39+
```python
40+
from diffusers import StableDiffusionPipeline, EulerDiscreteScheduler
41+
42+
euler_scheduler = EulerDiscreteScheduler.from_config("CompVis/stable-diffusion-v1-4", subfolder="scheduler")
43+
pipeline = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", scheduler=euler_scheduler)
44+
```
45+
46+
47+
### How to conver all use cases with multiple or single pipeline
48+
3449
If you want to use all possible use cases in a single `DiffusionPipeline` you can either:
3550
- Make use of the [Stable Diffusion Mega Pipeline](https://github.com/huggingface/diffusers/tree/main/examples/community#stable-diffusion-mega) or
3651
- Make use of the `components` functionality to instantiate all components in the most memory-efficient way:

docs/source/api/schedulers.mdx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,19 @@ Score SDE-VP is under construction.
112112
</Tip>
113113

114114
[[autodoc]] schedulers.scheduling_sde_vp.ScoreSdeVpScheduler
115+
116+
117+
#### Euler scheduler
118+
119+
Euler scheduler (Algorithm 2) from the paper [Elucidating the Design Space of Diffusion-Based Generative Models](https://arxiv.org/abs/2206.00364) by Karras et al. (2022). Based on the original [k-diffusion](https://github.com/crowsonkb/k-diffusion/blob/481677d114f6ea445aa009cf5bd7a9cdee909e47/k_diffusion/sampling.py#L51) implementation by Katherine Crowson.
120+
Fast scheduler which often times generates good outputs with 20-30 steps.
121+
122+
[[autodoc]] EulerDiscreteScheduler
123+
124+
125+
#### Euler Ancestral scheduler
126+
127+
Ancestral sampling with Euler method steps. Based on the original (k-diffusion)[https://github.com/crowsonkb/k-diffusion/blob/481677d114f6ea445aa009cf5bd7a9cdee909e47/k_diffusion/sampling.py#L72] implementation by Katherine Crowson.
128+
Fast scheduler which often times generates good outputs with 20-30 steps.
129+
130+
[[autodoc]] EulerAncestralDiscreteScheduler

0 commit comments

Comments
 (0)