Spaces:
Runtime error
Runtime error
jutaporn37678
commited on
Commit
•
fbd6154
1
Parent(s):
9fcbf71
app.py
Browse files
app.py
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#@title ##Run for generating images.
|
2 |
+
|
3 |
+
prompt = "A very good dog by [yourname]" #@param {type:"string"}
|
4 |
+
negative_prompt = "" #@param {type:"string"}
|
5 |
+
num_samples = 4 #@param {type:"number"}
|
6 |
+
guidance_scale = 7.5 #@param {type:"number"}
|
7 |
+
num_inference_steps = 50 #@param {type:"number"}
|
8 |
+
height = 512 #@param {type:"number"}
|
9 |
+
width = 512 #@param {type:"number"}
|
10 |
+
|
11 |
+
with autocast("cuda"), torch.inference_mode():
|
12 |
+
images = pipe(
|
13 |
+
prompt,
|
14 |
+
height=height,
|
15 |
+
width=width,
|
16 |
+
negative_prompt=negative_prompt,
|
17 |
+
num_images_per_prompt=num_samples,
|
18 |
+
num_inference_steps=num_inference_steps,
|
19 |
+
guidance_scale=guidance_scale,
|
20 |
+
generator=g_cuda
|
21 |
+
).images
|
22 |
+
|
23 |
+
for img in images:
|
24 |
+
display(img)
|