Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: mit
|
3 |
+
language:
|
4 |
+
- en
|
5 |
+
base_model:
|
6 |
+
- Laxhar/sdxl_noob
|
7 |
+
pipeline_tag: text-to-image
|
8 |
+
library_name: diffusers
|
9 |
+
---
|
10 |
+
|
11 |
+
# NoobAI XL (V预测分支)
|
12 |
+
|
13 |
+
该模型页面为 NoobAI XL 的 V 预测分支,无法在 AUTOMATIC1111 WebUI 中使用。
|
14 |
+
请通过 diffusers 或 [reForge](https://github.com/Panchovix/stable-diffusion-webui-reForge/) 使用。
|
15 |
+
|
16 |
+
## 用法:reForge
|
17 |
+
|
18 |
+
1. 安装并启动 reForge;
|
19 |
+
2. 在页面下方找到 “Advanced Model Sampling for Forge”;
|
20 |
+
3. 启用 “Enable Advanced Model Sampling”;
|
21 |
+
4. 在 “Discrete Sampling Type” 中选择 “v_prediction”。
|
22 |
+
|
23 |
+
## 用法:Diffusers
|
24 |
+
|
25 |
+
```python
|
26 |
+
import torch
|
27 |
+
from diffusers import StableDiffusionXLPipeline, EulerAncestralDiscreteScheduler
|
28 |
+
|
29 |
+
ckpt_path = "/path/to/model.safetensors"
|
30 |
+
pipe = StableDiffusionXLPipeline.from_single_file(
|
31 |
+
ckpt_path,
|
32 |
+
use_safetensors=True,
|
33 |
+
torch_dtype=torch.float16,
|
34 |
+
)
|
35 |
+
pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
|
36 |
+
pipe.scheduler.register_to_config(
|
37 |
+
prediction_type="v_prediction",
|
38 |
+
rescale_betas_zero_snr=True,
|
39 |
+
)
|
40 |
+
pipe.enable_xformers_memory_efficient_attention()
|
41 |
+
pipe = pipe.to("cuda")
|
42 |
+
|
43 |
+
prompt = "best quality, 1boy, solo"
|
44 |
+
negative_prompt = "bad hands, worst quality, low quality, bad quality, multiple views, 4koma, comic, jpeg artifacts, monochrome, sepia, greyscale, flat color, pale color, muted color, low contrast, bad anatomy, picture frame, english text, signature, watermark, logo, patreon username, web address, artist name"
|
45 |
+
|
46 |
+
image = pipe(
|
47 |
+
prompt=prompt,
|
48 |
+
negative_prompt=negative_prompt,
|
49 |
+
width=832,
|
50 |
+
height=1216,
|
51 |
+
num_inference_steps=28,
|
52 |
+
guidance_scale=7.0,
|
53 |
+
generator=torch.Generator().manual_seed(42),
|
54 |
+
).images[0]
|
55 |
+
|
56 |
+
image.save('image.png')
|
57 |
+
```
|