Commit
·
fe3676f
1
Parent(s):
280766f
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,15 @@
|
|
1 |
-
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from diffusers import DiffusionPipeline
|
2 |
|
3 |
+
model_id = "runwayml/stable-diffusion-v1-5"
|
4 |
+
pipeline = DiffusionPipeline.from_pretrained(model_id)
|
5 |
+
|
6 |
+
prompt = "portrait photo of a old warrior chief"
|
7 |
+
|
8 |
+
pipeline = pipeline.to("cuda")
|
9 |
+
|
10 |
+
import torch
|
11 |
+
|
12 |
+
generator = torch.Generator("cuda").manual_seed(0)
|
13 |
+
|
14 |
+
image = pipeline(prompt, generator=generator).images[0]
|
15 |
+
image
|