Update README.md
Browse files
README.md
CHANGED
|
@@ -31,7 +31,20 @@ extra_gated_heading: Please read the LICENSE to access this model
|
|
| 31 |
library_name: diffusers
|
| 32 |
pipeline_tag: text-to-image
|
| 33 |
---
|
| 34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
F
|
| 36 |
复现文档:
|
| 37 |
|
|
|
|
| 31 |
library_name: diffusers
|
| 32 |
pipeline_tag: text-to-image
|
| 33 |
---
|
| 34 |
+
### Diffusers
|
| 35 |
+
```py
|
| 36 |
+
from diffusers import StableDiffusionPipeline
|
| 37 |
+
import torch
|
| 38 |
+
|
| 39 |
+
model_id = "acondess/lineart"
|
| 40 |
+
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
|
| 41 |
+
pipe = pipe.to("cuda")
|
| 42 |
+
|
| 43 |
+
prompt = "a photo of an astronaut riding a horse on mars"
|
| 44 |
+
image = pipe(prompt).images[0]
|
| 45 |
+
|
| 46 |
+
image.save("astronaut_rides_horse.png")
|
| 47 |
+
```
|
| 48 |
F
|
| 49 |
复现文档:
|
| 50 |
|