fix fp16 error
Browse files
README.md
CHANGED
@@ -91,9 +91,10 @@ image.save("小桥.png")
|
|
91 |
|
92 |
```py
|
93 |
# !pip install git+https://github.com/huggingface/accelerate
|
94 |
-
|
95 |
-
|
96 |
-
pipe = StableDiffusionPipeline.from_pretrained("IDEA-CCNL/Taiyi-Stable-Diffusion-1B-Chinese-EN-v0.1", torch_dtype=torch.float16
|
|
|
97 |
|
98 |
prompt = '小桥流水人家,Van Gogh style'
|
99 |
image = pipe(prompt, guidance_scale=10.0).images[0]
|
|
|
91 |
|
92 |
```py
|
93 |
# !pip install git+https://github.com/huggingface/accelerate
|
94 |
+
import torch
|
95 |
+
torch.backends.cudnn.benchmark = True
|
96 |
+
pipe = StableDiffusionPipeline.from_pretrained("IDEA-CCNL/Taiyi-Stable-Diffusion-1B-Chinese-EN-v0.1", torch_dtype=torch.float16)
|
97 |
+
pipe.to('cuda')
|
98 |
|
99 |
prompt = '小桥流水人家,Van Gogh style'
|
100 |
image = pipe(prompt, guidance_scale=10.0).images[0]
|