willcat
commited on
Commit
·
dbba600
1
Parent(s):
5c990a1
add requirements
Browse files- app.py +13 -5
- requirements.txt +2 -0
app.py
CHANGED
@@ -1,7 +1,15 @@
|
|
1 |
-
import
|
|
|
|
|
2 |
|
3 |
-
|
4 |
-
return "Hello " + name + "!!"
|
5 |
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import torch
|
2 |
+
from torch import autocast
|
3 |
+
from diffusers import DiffusionPipeline
|
4 |
|
5 |
+
pipe = DiffusionPipeline.from_pretrained("uf/braBeautifulRealistic_brav5",torch_dtype=torch.float16)
|
|
|
6 |
|
7 |
+
prompt = "an asian woman with long hair and a black top is posing for a picture with her hand on her chin, 1girl, solo, long_hair, looking_at_viewer, brown_hair, simple_background, black_hair, jewelry, earrings, necklace, lips, black_shirt, ring, realistic"
|
8 |
+
with autocast("cuda"):
|
9 |
+
image = pipe(prompt).images[0]
|
10 |
+
|
11 |
+
#图片保存
|
12 |
+
image.save(f"astronaut_rides_horse.png")
|
13 |
+
|
14 |
+
#或者你可以直接在这个notebook里显示查看.
|
15 |
+
image
|
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
diffusers
|
2 |
+
torch
|