lunarflu HF Staff commited on
Commit
75c4daa
·
1 Parent(s): 43a2c13

[dfif] combined images >>> individual images

Browse files
Files changed (1) hide show
  1. app.py +13 -5
app.py CHANGED
@@ -353,7 +353,7 @@ async def deepfloydif(ctx, *, prompt: str):
353
  dfif_command_message_id = ctx.message.id # we will use this in some magic later on
354
  thread = await ctx.message.create_thread(name=f'DeepfloydIF | {prompt}', auto_archive_duration=60) # could also just use prompt, no deepfloydif
355
  # create thread -> send new message inside thread + combined_image -> add reactions -> dfif2
356
-
357
  #current_time = int(time.time())
358
  #random.seed(current_time)
359
 
@@ -406,6 +406,8 @@ async def deepfloydif(ctx, *, prompt: str):
406
  await thread.send(f'✅combining images...')
407
  png_files = [f for f in os.listdir(stage_1_results) if f.endswith('.png')]
408
 
 
 
409
  if png_files:
410
  first_png = png_files[0]
411
  second_png = png_files[1]
@@ -438,9 +440,14 @@ async def deepfloydif(ctx, *, prompt: str):
438
 
439
  await thread.send(f'✅reacting with 1234...')
440
  emoji_list = ['↖️', '↗️', '↙️', '↘️']
441
- await react1234(emoji_list, combined_image_dfif)
 
 
442
 
443
  ''' individual images
 
 
 
444
  if png_files:
445
  for i, png_file in enumerate(png_files):
446
  png_file_path = os.path.join(stage_1_results, png_file)
@@ -449,9 +456,10 @@ async def deepfloydif(ctx, *, prompt: str):
449
  img.save(image_path)
450
  with open(image_path, 'rb') as f:
451
  await thread.send(f'{ctx.author.mention}Image {i+1}', file=discord.File(f, f'{i+1}{partialpath}.png'))
452
- await asyncio.sleep(1)
453
-
454
- '''
 
455
 
456
  except Exception as e:
457
  print(f"Error: {e}")
 
353
  dfif_command_message_id = ctx.message.id # we will use this in some magic later on
354
  thread = await ctx.message.create_thread(name=f'DeepfloydIF | {prompt}', auto_archive_duration=60) # could also just use prompt, no deepfloydif
355
  # create thread -> send new message inside thread + combined_image -> add reactions -> dfif2
356
+
357
  #current_time = int(time.time())
358
  #random.seed(current_time)
359
 
 
406
  await thread.send(f'✅combining images...')
407
  png_files = [f for f in os.listdir(stage_1_results) if f.endswith('.png')]
408
 
409
+
410
+ ''' combined images
411
  if png_files:
412
  first_png = png_files[0]
413
  second_png = png_files[1]
 
440
 
441
  await thread.send(f'✅reacting with 1234...')
442
  emoji_list = ['↖️', '↗️', '↙️', '↘️']
443
+ await react1234(emoji_list, combined_image_dfif)
444
+ '''
445
+
446
 
447
  ''' individual images
448
+
449
+
450
+ '''
451
  if png_files:
452
  for i, png_file in enumerate(png_files):
453
  png_file_path = os.path.join(stage_1_results, png_file)
 
456
  img.save(image_path)
457
  with open(image_path, 'rb') as f:
458
  await thread.send(f'{ctx.author.mention}Image {i+1}', file=discord.File(f, f'{i+1}{partialpath}.png'))
459
+ await asyncio.sleep(1)
460
+
461
+
462
+
463
 
464
  except Exception as e:
465
  print(f"Error: {e}")