merve HF staff commited on
Commit
fbbe460
1 Parent(s): e9448cb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
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('.jpg'):
 
 
35
  sd_output.append(os.path.join(image_dir, filename))
36
- break
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