Update README.md
Browse files
README.md
CHANGED
@@ -38,4 +38,42 @@ image = pipeline(prompt=prompt, negative_prompt=negative_prompt,
|
|
38 |
image
|
39 |
```
|
40 |
|
41 |
-
Feel free to edit the image's configuration with your desire.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
image
|
39 |
```
|
40 |
|
41 |
+
Feel free to edit the image's configuration with your desire.
|
42 |
+
|
43 |
+
### Scheduler's Customization ⚙️
|
44 |
+
#### (for Diffusers)
|
45 |
+
You can see all available schedulers [here](https://huggingface.co/docs/diffusers/v0.11.0/en/api/schedulers/overview).
|
46 |
+
|
47 |
+
To use scheduler other than DPM++ 2M Karras for this repo, make sure to import the
|
48 |
+
corresponding pipeline for the scheduler you want to use. For example, we want to use Euler. First, import [EulerDiscreteScheduler](https://huggingface.co/docs/diffusers/v0.29.2/en/api/schedulers/euler#diffusers.EulerDiscreteScheduler) from Diffusers by adding this line of code.
|
49 |
+
```py
|
50 |
+
from diffusers import StableDiffusionXLPipeline, EulerDiscreteScheduler
|
51 |
+
```
|
52 |
+
|
53 |
+
Next step is to load the scheduler.
|
54 |
+
```py
|
55 |
+
model = "IDK-ab0ut/Yiffymix_v51"
|
56 |
+
euler = EulerDiscreteScheduler.from_pretrained(
|
57 |
+
model, subfolder="scheduler")
|
58 |
+
pipeline = StableDiffusionXLPipeline.from_pretrained(
|
59 |
+
model, scheduler=euler, torch.dtype=torch.float16
|
60 |
+
).to("cuda")
|
61 |
+
```
|
62 |
+
Now you can generate any images using the scheduler you want.
|
63 |
+
|
64 |
+
Another example is using DPM++ 2M SDE Karras. We want to import [DPMSolverMultistepScheduler](https://huggingface.co/docs/diffusers/v0.29.2/api/schedulers/multistep_dpm_solver) from Diffusers first.
|
65 |
+
```py
|
66 |
+
from diffusers import StableDiffusionXLPipeline, DPMSolverMultistepScheduler
|
67 |
+
```
|
68 |
+
Next, load the scheduler into the model.
|
69 |
+
```py
|
70 |
+
model = "IDK-ab0ut/Yiffymix_v51"
|
71 |
+
dpmsolver = DPMSolverMultistepScheduler.from_pretrained(
|
72 |
+
model, subfolder="scheduler", use_karras_sigmas=True,
|
73 |
+
algorithm_type="sde-dpmsolver++").to("cuda")
|
74 |
+
# 'use_karras_sigmas' is called to make the scheduler
|
75 |
+
# use Karras sigmas during sampling.
|
76 |
+
pipeline = StableDiffusionXLPipeline.from_pretrained(
|
77 |
+
model, scheduler=dpmsolver, torch.dtype=torch.float16,
|
78 |
+
).to("cuda")
|
79 |
+
```
|