lunarflu HF Staff commited on
Commit
b939335
Β·
1 Parent(s): 88edf1a

v0.6 deepfloydif test

Browse files
Files changed (1) hide show
  1. app.py +19 -0
app.py CHANGED
@@ -4,9 +4,15 @@ import gradio as gr
4
  import os
5
  import threading
6
 
 
 
 
7
  # Get Gradio client
8
  jojogan = gradio_client.Client("akhaliq/JoJoGAN")
9
 
 
 
 
10
  # Set up discord bot
11
  class MyClient(discord.Client):
12
  async def on_ready(self):
@@ -55,6 +61,19 @@ class MyClient(discord.Client):
55
  await message.reply(f'Here is the {style} version of it', file=discord.File(im))
56
  else:
57
  await message.channel.send("No attachments to be found...Can't animify dat! Try sending me an image πŸ˜‰")
 
 
 
 
 
 
 
 
 
 
 
 
 
58
 
59
 
60
 
 
4
  import os
5
  import threading
6
 
7
+ #todos
8
+ #alert
9
+
10
  # Get Gradio client
11
  jojogan = gradio_client.Client("akhaliq/JoJoGAN")
12
 
13
+ #new
14
+ deepfloydif = gradio_client.Client("DeepFloyd/IF")
15
+
16
  # Set up discord bot
17
  class MyClient(discord.Client):
18
  async def on_ready(self):
 
61
  await message.reply(f'Here is the {style} version of it', file=discord.File(im))
62
  else:
63
  await message.channel.send("No attachments to be found...Can't animify dat! Try sending me an image πŸ˜‰")
64
+
65
+ #new
66
+ #deepfloydif
67
+ if message.content.startswith('!deepfloydif'):
68
+ text_input = message.content[12:].strip()
69
+ if text_input:
70
+ im = deepfloydif.predict(text_input)
71
+ im_bytes = BytesIO()
72
+ im.save(im_bytes, 'PNG')
73
+ im_bytes.seek(0)
74
+ await message.reply(f'Here is the image generated for the input "{text_input}"', file=discord.File(im_bytes, 'output.png'))
75
+ else:
76
+ await message.channel.send("No text input provided. Please provide some text after the !deepfloydif command.")
77
 
78
 
79