Update README.md
Browse files
README.md
CHANGED
@@ -116,8 +116,41 @@ Follow the setup instructions in the [WebUI repository](https://github.com/AUTOM
|
|
116 |
git pull
|
117 |
```
|
118 |
🔄 **Restart WebUI after updating to apply changes.**"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
|
120 |
-
|
121 |
|
122 |
## Acknowledgments
|
123 |
|
|
|
116 |
git pull
|
117 |
```
|
118 |
🔄 **Restart WebUI after updating to apply changes.**"
|
119 |
+
|
120 |
+
### Method IV: Diffusers
|
121 |
+
```bash
|
122 |
+
import torch
|
123 |
+
from diffusers import StableDiffusionXLPipeline
|
124 |
+
from diffusers import EulerDiscreteScheduler
|
125 |
+
|
126 |
+
ckpt_path = "/path/to/model.safetensors"
|
127 |
+
pipe = StableDiffusionXLPipeline.from_single_file(
|
128 |
+
ckpt_path,
|
129 |
+
use_safetensors=True,
|
130 |
+
torch_dtype=torch.float16,
|
131 |
+
)
|
132 |
+
scheduler_args = {"prediction_type": "v_prediction", "rescale_betas_zero_snr": True}
|
133 |
+
pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config, **scheduler_args)
|
134 |
+
pipe.enable_xformers_memory_efficient_attention()
|
135 |
+
pipe = pipe.to("cuda")
|
136 |
+
|
137 |
+
prompt = """masterpiece, best quality,artist:john_kafka,artist:nixeu,artist:quasarcake, chromatic aberration, film grain, horror \(theme\), limited palette, x-shaped pupils, high contrast, color contrast, cold colors, arlecchino \(genshin impact\), black theme, gritty, graphite \(medium\)"""
|
138 |
+
negative_prompt = "nsfw, worst quality, old, early, low quality, lowres, signature, username, logo, bad hands, mutated hands, mammal, anthro, furry, ambiguous form, feral, semi-anthro"
|
139 |
+
|
140 |
+
image = pipe(
|
141 |
+
prompt=prompt,
|
142 |
+
negative_prompt=negative_prompt,
|
143 |
+
width=832,
|
144 |
+
height=1216,
|
145 |
+
num_inference_steps=28,
|
146 |
+
guidance_scale=5,
|
147 |
+
generator=torch.Generator().manual_seed(42),
|
148 |
+
).images[0]
|
149 |
+
|
150 |
+
image.save("output.png")
|
151 |
+
```
|
152 |
|
153 |
+
6. **Configuration:** Ensure you're using a stable branch, as the dev branch may contain bugs.
|
154 |
|
155 |
## Acknowledgments
|
156 |
|