Spaces:
Sleeping
Sleeping
rafaaa2105
commited on
Commit
•
1cdbaa3
1
Parent(s):
e66a721
Update app.py
Browse files
app.py
CHANGED
@@ -38,19 +38,30 @@ def generate_images(
|
|
38 |
# Set the track_tqdm parameter based on the number of images
|
39 |
if num_images == 1:
|
40 |
progress = gr.Progress(track_tqdm=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
else:
|
42 |
progress = gr.Progress(track_tqdm=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
|
44 |
-
|
45 |
-
output = pipe(
|
46 |
-
prompt,
|
47 |
-
negative_prompt=negative_prompt,
|
48 |
-
num_inference_steps=num_inference_steps,
|
49 |
-
guidance_scale=guidance_scale,
|
50 |
-
height=height,
|
51 |
-
width=width
|
52 |
-
)["images"][0]
|
53 |
-
outputs.append(output)
|
54 |
|
55 |
return outputs
|
56 |
else:
|
|
|
38 |
# Set the track_tqdm parameter based on the number of images
|
39 |
if num_images == 1:
|
40 |
progress = gr.Progress(track_tqdm=True)
|
41 |
+
for _ in range(num_images):
|
42 |
+
output = pipe(
|
43 |
+
prompt,
|
44 |
+
negative_prompt=negative_prompt,
|
45 |
+
num_inference_steps=num_inference_steps,
|
46 |
+
guidance_scale=guidance_scale,
|
47 |
+
height=height,
|
48 |
+
width=width
|
49 |
+
)["images"][0]
|
50 |
+
outputs.append(output)
|
51 |
else:
|
52 |
progress = gr.Progress(track_tqdm=False)
|
53 |
+
for _ in progress.tqdm(range(num_images), desc="Generating images"):
|
54 |
+
output = pipe(
|
55 |
+
prompt,
|
56 |
+
negative_prompt=negative_prompt,
|
57 |
+
num_inference_steps=num_inference_steps,
|
58 |
+
guidance_scale=guidance_scale,
|
59 |
+
height=height,
|
60 |
+
width=width
|
61 |
+
)["images"][0]
|
62 |
+
outputs.append(output)
|
63 |
|
64 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
|
66 |
return outputs
|
67 |
else:
|