lunarflu HF Staff commited on
Commit
423b78f
·
1 Parent(s): 0f21369

0.4 multiple images test

Browse files

second_png = png_files[1]
third_png = png_files[2]
fourth_png = png_files[3]

Files changed (1) hide show
  1. app.py +15 -4
app.py CHANGED
@@ -141,11 +141,22 @@ class MyClient(discord.Client):
141
  # Assuming png_files contains the list of all PNG files in the directory
142
  if png_files:
143
  first_png = png_files[0]
 
 
 
 
144
  first_png_path = os.path.join(stage_1_results, first_png)
145
-
146
- # Send the image file as a Discord attachment
147
- with open(first_png_path, 'rb') as f:
148
- await message.reply(f'Here is the first generated image', file=discord.File(f, 'first_png.png'))
 
 
 
 
 
 
 
149
 
150
 
151
 
 
141
  # Assuming png_files contains the list of all PNG files in the directory
142
  if png_files:
143
  first_png = png_files[0]
144
+ second_png = png_files[1]
145
+ third_png = png_files[2]
146
+ fourth_png = png_files[3]
147
+
148
  first_png_path = os.path.join(stage_1_results, first_png)
149
+ second_png_path = os.path.join(stage_1_results, second_png)
150
+ third_png_path = os.path.join(stage_1_results, third_png)
151
+ fourth_png_path = os.path.join(stage_1_results, fourth_png)
152
+
153
+ # Send the image files as Discord attachments
154
+ with open(first_png_path, 'rb') as f1, open(second_png_path, 'rb') as f2, open(third_png_path, 'rb') as f3, open(fourth_png_path, 'rb') as f4:
155
+ await message.reply('Here are the generated images',
156
+ files=[discord.File(f1, 'first_png.png'),
157
+ discord.File(f2, 'second_png.png'),
158
+ discord.File(f3, 'third_png.png'),
159
+ discord.File(f4, 'fourth_png.png')])
160
 
161
 
162