Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -27,13 +27,16 @@ def get_images(username):
|
|
| 27 |
for prompt in prompt_list_prepend:
|
| 28 |
image_dirs.append(stable_diffusion(prompt, fn_index=2))
|
| 29 |
|
| 30 |
-
# do not take captions, and only take first output
|
| 31 |
sd_output = []
|
|
|
|
| 32 |
for image_dir in image_dirs:
|
|
|
|
| 33 |
for filename in os.listdir(image_dir):
|
| 34 |
-
if filename.endswith('.
|
|
|
|
|
|
|
| 35 |
sd_output.append(os.path.join(image_dir, filename))
|
| 36 |
-
|
| 37 |
|
| 38 |
return sd_output, prompt_string
|
| 39 |
|
|
|
|
| 27 |
for prompt in prompt_list_prepend:
|
| 28 |
image_dirs.append(stable_diffusion(prompt, fn_index=2))
|
| 29 |
|
|
|
|
| 30 |
sd_output = []
|
| 31 |
+
|
| 32 |
for image_dir in image_dirs:
|
| 33 |
+
found_first_image = False
|
| 34 |
for filename in os.listdir(image_dir):
|
| 35 |
+
if filename.endswith('.json'):
|
| 36 |
+
continue
|
| 37 |
+
elif not found_first_image:
|
| 38 |
sd_output.append(os.path.join(image_dir, filename))
|
| 39 |
+
found_first_image = True
|
| 40 |
|
| 41 |
return sd_output, prompt_string
|
| 42 |
|