Update app.py
Browse files
app.py
CHANGED
@@ -163,6 +163,7 @@ async def jojo(ctx):
|
|
163 |
try:
|
164 |
if await safetychecks(ctx): #β
|
165 |
await ctx.message.add_reaction('π€')
|
|
|
166 |
thread = await ctx.message.create_thread(name=f'{ctx.author} Jojo Thread')
|
167 |
if ctx.message.attachments:
|
168 |
await thread.send(f'{ctx.author.mention}Generating images in thread, can take ~1 minute...yare yare, daze ...')
|
@@ -175,11 +176,13 @@ async def jojo(ctx):
|
|
175 |
await ctx.message.add_reaction('β
') # img + face
|
176 |
else: # no image
|
177 |
await thread.send(f"{ctx.author.mention}No attachments to be found...Can't animify dat! Try sending me an image π")
|
178 |
-
await ctx.message.add_reaction('β')
|
|
|
179 |
except Exception as e: # no generation / img + no face
|
180 |
print(f"Error: {e}")
|
181 |
await thread.send(f"{ctx.author.mention}Error: {e}")
|
182 |
-
await ctx.message.add_reaction('β')
|
|
|
183 |
|
184 |
#----------------------------------------------------------------------------------------------------------------------------------------------
|
185 |
# Disney β
|
@@ -187,7 +190,8 @@ async def jojo(ctx):
|
|
187 |
async def disney(ctx):
|
188 |
try:
|
189 |
if await safetychecks(ctx): #β
|
190 |
-
await ctx.message.add_reaction('π€')
|
|
|
191 |
thread = await ctx.message.create_thread(name=f'{ctx.author} disney Thread')
|
192 |
if ctx.message.attachments:
|
193 |
await thread.send(f'{ctx.author.mention}Generating images in thread, can take ~1 minute...')
|
@@ -198,11 +202,13 @@ async def disney(ctx):
|
|
198 |
await ctx.message.add_reaction('β
') # img + face
|
199 |
else: # no image
|
200 |
await thread.send(f"{ctx.author.mention}No attachments to be found...Can't animify dat! Try sending me an image π")
|
201 |
-
await ctx.message.add_reaction('β')
|
|
|
202 |
except Exception as e: # no generation / img + no face
|
203 |
print(f"Error: {e}")
|
204 |
await thread.send(f"{ctx.author.mention}Error: {e}")
|
205 |
await ctx.message.add_reaction('β')
|
|
|
206 |
|
207 |
#----------------------------------------------------------------------------------------------------------------------------------------------
|
208 |
# Spider-Verse β
|
@@ -211,6 +217,7 @@ async def spidey(ctx):
|
|
211 |
try:
|
212 |
if await safetychecks(ctx): #β
|
213 |
await ctx.message.add_reaction('π€')
|
|
|
214 |
thread = await ctx.message.create_thread(name=f'{ctx.author} spider-verse Thread')
|
215 |
if ctx.message.attachments:
|
216 |
await thread.send(f'{ctx.author.mention}Generating images in thread, can take ~1 minute...')
|
@@ -221,11 +228,13 @@ async def spidey(ctx):
|
|
221 |
await ctx.message.add_reaction('β
') # img + face
|
222 |
else: # no image
|
223 |
await thread.send(f"{ctx.author.mention}No attachments to be found...Can't animify dat! Try sending me an image π")
|
224 |
-
await ctx.message.add_reaction('β')
|
|
|
225 |
except Exception as e: # no generation / img + no face
|
226 |
print(f"Error: {e}")
|
227 |
await thread.send(f"{ctx.author.mention}Error: {e}")
|
228 |
await ctx.message.add_reaction('β')
|
|
|
229 |
|
230 |
#----------------------------------------------------------------------------------------------------------------------------------------------
|
231 |
# sketch β
|
@@ -234,6 +243,7 @@ async def sketch(ctx):
|
|
234 |
try:
|
235 |
if await safetychecks(ctx): #β
|
236 |
await ctx.message.add_reaction('π€')
|
|
|
237 |
thread = await ctx.message.create_thread(name=f'{ctx.author} sketch Thread')
|
238 |
if ctx.message.attachments:
|
239 |
await thread.send(f'{ctx.author.mention}Generating images in thread, can take ~1 minute...')
|
@@ -244,11 +254,13 @@ async def sketch(ctx):
|
|
244 |
await ctx.message.add_reaction('β
') # img + face
|
245 |
else: # no image
|
246 |
await thread.send(f"{ctx.author.mention}No attachments to be found...Can't animify dat! Try sending me an image π")
|
247 |
-
await ctx.message.add_reaction('β')
|
|
|
248 |
except Exception as e: # no generation / img + no face
|
249 |
print(f"Error: {e}")
|
250 |
await thread.send(f"{ctx.author.mention}Error: {e}")
|
251 |
await ctx.message.add_reaction('β')
|
|
|
252 |
#----------------------------------------------------------------------------------------------------------------------------------------------
|
253 |
# deepfloydif stage 1 generation β
|
254 |
def inference(prompt):
|
@@ -314,7 +326,7 @@ async def deepfloydif(ctx, *, prompt: str):
|
|
314 |
print(f"Error: {e}")
|
315 |
thread = await ctx.message.create_thread(name=f'DFIF1 Error')
|
316 |
await thread.send(f"{ctx.author.mention} Error during stage 1 pre-generation.")
|
317 |
-
await ctx.message.remove_reaction('β³')
|
318 |
await ctx.message.add_reaction(failure_emoji)
|
319 |
|
320 |
#generationβ
-------------------------------------------------------
|
@@ -336,7 +348,7 @@ async def deepfloydif(ctx, *, prompt: str):
|
|
336 |
print(f"Error: {e}")
|
337 |
thread = await ctx.message.create_thread(name=f'Generation Error')
|
338 |
await thread.send(f"{ctx.author.mention} Error during stage 1 generation.")
|
339 |
-
await ctx.message.remove_reaction('β³')
|
340 |
await ctx.message.add_reaction(failure_emoji)
|
341 |
#posting imagesβ
----------------------------------------------------------------
|
342 |
try:
|
@@ -394,7 +406,7 @@ async def deepfloydif(ctx, *, prompt: str):
|
|
394 |
print(f"Error: {e}")
|
395 |
thread = await ctx.message.create_thread(name=f'Posting Error')
|
396 |
await thread.send(f"{ctx.author.mention} Encountered error while posting combined image in thread.")
|
397 |
-
await ctx.message.remove_reaction('β³')
|
398 |
await ctx.message.add_reaction(failure_emoji)
|
399 |
|
400 |
#deepfloydif try/except
|
@@ -402,7 +414,7 @@ async def deepfloydif(ctx, *, prompt: str):
|
|
402 |
print(f"Error: {e}")
|
403 |
thread = await ctx.message.create_thread(name=f'deepfloydif Error')
|
404 |
await thread.send(f"{ctx.author.mention} Overall error with deepfloydif.")
|
405 |
-
await ctx.message.remove_reaction('β³')
|
406 |
await ctx.message.add_reaction(failure_emoji)
|
407 |
|
408 |
#----------------------------------------------------------------------------------------------------------------------------
|
@@ -427,7 +439,7 @@ async def dfif2(index: int, stage_1_result_path, thread, dfif_command_message_id
|
|
427 |
parent_channel = thread.parent
|
428 |
dfif_command_message = await parent_channel.fetch_message(dfif_command_message_id)
|
429 |
await dfif_command_message.add_reaction(success_emoji)
|
430 |
-
await dfif_command_message.remove_reaction('β³')
|
431 |
|
432 |
except Exception as e:
|
433 |
print(f"Error: {e}")
|
@@ -438,7 +450,7 @@ async def dfif2(index: int, stage_1_result_path, thread, dfif_command_message_id
|
|
438 |
parent_channel = thread.parent
|
439 |
dfif_command_message = await parent_channel.fetch_message(dfif_command_message_id)
|
440 |
await dfif_command_message.add_reaction(failure_emoji)
|
441 |
-
await dfif_command_message.remove_reaction('β³')
|
442 |
await thread.send(f"Error during stage 2 upscaling.")
|
443 |
#----------------------------------------------------------------------------------------------------------------------------
|
444 |
# react detector for stage 2 β
|
|
|
163 |
try:
|
164 |
if await safetychecks(ctx): #β
|
165 |
await ctx.message.add_reaction('π€')
|
166 |
+
await ctx.message.add_reaction('β³')
|
167 |
thread = await ctx.message.create_thread(name=f'{ctx.author} Jojo Thread')
|
168 |
if ctx.message.attachments:
|
169 |
await thread.send(f'{ctx.author.mention}Generating images in thread, can take ~1 minute...yare yare, daze ...')
|
|
|
176 |
await ctx.message.add_reaction('β
') # img + face
|
177 |
else: # no image
|
178 |
await thread.send(f"{ctx.author.mention}No attachments to be found...Can't animify dat! Try sending me an image π")
|
179 |
+
await ctx.message.add_reaction('β')
|
180 |
+
await ctx.message.remove_reaction('β³', bot.user)
|
181 |
except Exception as e: # no generation / img + no face
|
182 |
print(f"Error: {e}")
|
183 |
await thread.send(f"{ctx.author.mention}Error: {e}")
|
184 |
+
await ctx.message.add_reaction('β')
|
185 |
+
await ctx.message.remove_reaction('β³', bot.user)
|
186 |
|
187 |
#----------------------------------------------------------------------------------------------------------------------------------------------
|
188 |
# Disney β
|
|
|
190 |
async def disney(ctx):
|
191 |
try:
|
192 |
if await safetychecks(ctx): #β
|
193 |
+
await ctx.message.add_reaction('π€')
|
194 |
+
await ctx.message.add_reaction('β³')
|
195 |
thread = await ctx.message.create_thread(name=f'{ctx.author} disney Thread')
|
196 |
if ctx.message.attachments:
|
197 |
await thread.send(f'{ctx.author.mention}Generating images in thread, can take ~1 minute...')
|
|
|
202 |
await ctx.message.add_reaction('β
') # img + face
|
203 |
else: # no image
|
204 |
await thread.send(f"{ctx.author.mention}No attachments to be found...Can't animify dat! Try sending me an image π")
|
205 |
+
await ctx.message.add_reaction('β')
|
206 |
+
await ctx.message.remove_reaction('β³', bot.user)
|
207 |
except Exception as e: # no generation / img + no face
|
208 |
print(f"Error: {e}")
|
209 |
await thread.send(f"{ctx.author.mention}Error: {e}")
|
210 |
await ctx.message.add_reaction('β')
|
211 |
+
await ctx.message.remove_reaction('β³', bot.user)
|
212 |
|
213 |
#----------------------------------------------------------------------------------------------------------------------------------------------
|
214 |
# Spider-Verse β
|
|
|
217 |
try:
|
218 |
if await safetychecks(ctx): #β
|
219 |
await ctx.message.add_reaction('π€')
|
220 |
+
await ctx.message.add_reaction('β³')
|
221 |
thread = await ctx.message.create_thread(name=f'{ctx.author} spider-verse Thread')
|
222 |
if ctx.message.attachments:
|
223 |
await thread.send(f'{ctx.author.mention}Generating images in thread, can take ~1 minute...')
|
|
|
228 |
await ctx.message.add_reaction('β
') # img + face
|
229 |
else: # no image
|
230 |
await thread.send(f"{ctx.author.mention}No attachments to be found...Can't animify dat! Try sending me an image π")
|
231 |
+
await ctx.message.add_reaction('β')
|
232 |
+
await ctx.message.remove_reaction('β³', bot.user)
|
233 |
except Exception as e: # no generation / img + no face
|
234 |
print(f"Error: {e}")
|
235 |
await thread.send(f"{ctx.author.mention}Error: {e}")
|
236 |
await ctx.message.add_reaction('β')
|
237 |
+
await ctx.message.remove_reaction('β³', bot.user)
|
238 |
|
239 |
#----------------------------------------------------------------------------------------------------------------------------------------------
|
240 |
# sketch β
|
|
|
243 |
try:
|
244 |
if await safetychecks(ctx): #β
|
245 |
await ctx.message.add_reaction('π€')
|
246 |
+
await ctx.message.add_reaction('β³')
|
247 |
thread = await ctx.message.create_thread(name=f'{ctx.author} sketch Thread')
|
248 |
if ctx.message.attachments:
|
249 |
await thread.send(f'{ctx.author.mention}Generating images in thread, can take ~1 minute...')
|
|
|
254 |
await ctx.message.add_reaction('β
') # img + face
|
255 |
else: # no image
|
256 |
await thread.send(f"{ctx.author.mention}No attachments to be found...Can't animify dat! Try sending me an image π")
|
257 |
+
await ctx.message.add_reaction('β')
|
258 |
+
await ctx.message.remove_reaction('β³', bot.user)
|
259 |
except Exception as e: # no generation / img + no face
|
260 |
print(f"Error: {e}")
|
261 |
await thread.send(f"{ctx.author.mention}Error: {e}")
|
262 |
await ctx.message.add_reaction('β')
|
263 |
+
await ctx.message.remove_reaction('β³', bot.user)
|
264 |
#----------------------------------------------------------------------------------------------------------------------------------------------
|
265 |
# deepfloydif stage 1 generation β
|
266 |
def inference(prompt):
|
|
|
326 |
print(f"Error: {e}")
|
327 |
thread = await ctx.message.create_thread(name=f'DFIF1 Error')
|
328 |
await thread.send(f"{ctx.author.mention} Error during stage 1 pre-generation.")
|
329 |
+
await ctx.message.remove_reaction('β³', bot.user)
|
330 |
await ctx.message.add_reaction(failure_emoji)
|
331 |
|
332 |
#generationβ
-------------------------------------------------------
|
|
|
348 |
print(f"Error: {e}")
|
349 |
thread = await ctx.message.create_thread(name=f'Generation Error')
|
350 |
await thread.send(f"{ctx.author.mention} Error during stage 1 generation.")
|
351 |
+
await ctx.message.remove_reaction('β³', bot.user)
|
352 |
await ctx.message.add_reaction(failure_emoji)
|
353 |
#posting imagesβ
----------------------------------------------------------------
|
354 |
try:
|
|
|
406 |
print(f"Error: {e}")
|
407 |
thread = await ctx.message.create_thread(name=f'Posting Error')
|
408 |
await thread.send(f"{ctx.author.mention} Encountered error while posting combined image in thread.")
|
409 |
+
await ctx.message.remove_reaction('β³', bot.user)
|
410 |
await ctx.message.add_reaction(failure_emoji)
|
411 |
|
412 |
#deepfloydif try/except
|
|
|
414 |
print(f"Error: {e}")
|
415 |
thread = await ctx.message.create_thread(name=f'deepfloydif Error')
|
416 |
await thread.send(f"{ctx.author.mention} Overall error with deepfloydif.")
|
417 |
+
await ctx.message.remove_reaction('β³', bot.user)
|
418 |
await ctx.message.add_reaction(failure_emoji)
|
419 |
|
420 |
#----------------------------------------------------------------------------------------------------------------------------
|
|
|
439 |
parent_channel = thread.parent
|
440 |
dfif_command_message = await parent_channel.fetch_message(dfif_command_message_id)
|
441 |
await dfif_command_message.add_reaction(success_emoji)
|
442 |
+
await dfif_command_message.remove_reaction('β³', bot.user)
|
443 |
|
444 |
except Exception as e:
|
445 |
print(f"Error: {e}")
|
|
|
450 |
parent_channel = thread.parent
|
451 |
dfif_command_message = await parent_channel.fetch_message(dfif_command_message_id)
|
452 |
await dfif_command_message.add_reaction(failure_emoji)
|
453 |
+
await dfif_command_message.remove_reaction('β³', bot.user)
|
454 |
await thread.send(f"Error during stage 2 upscaling.")
|
455 |
#----------------------------------------------------------------------------------------------------------------------------
|
456 |
# react detector for stage 2 β
|