fixing if else
This commit is contained in:
parent
608202b259
commit
43be905d5b
@ -116,30 +116,30 @@ class ActualUtils(commands.Cog):
|
|||||||
s.connect((ip, int(port)))
|
s.connect((ip, int(port)))
|
||||||
except:
|
except:
|
||||||
ip = "192.168.1.80"
|
ip = "192.168.1.80"
|
||||||
try:
|
try:
|
||||||
await ctx.defer()
|
await ctx.defer()
|
||||||
original_message = await ctx.followup.send(
|
original_message = await ctx.followup.send(
|
||||||
"Please be patient, I'm generating your image"
|
"Please be patient, I'm generating your image"
|
||||||
)
|
)
|
||||||
file_path = await stable_diffusion.generate_image(
|
file_path = await stable_diffusion.generate_image(
|
||||||
ip=ip,
|
ip=ip,
|
||||||
port=port,
|
port=port,
|
||||||
positives=positive_prompt,
|
positives=positive_prompt,
|
||||||
negatives=negative_prompt or None,
|
negatives=negative_prompt or None,
|
||||||
steps=steps,
|
steps=steps,
|
||||||
)
|
)
|
||||||
await original_message.edit(
|
await original_message.edit(
|
||||||
content="",
|
content="",
|
||||||
file=discord.File(
|
file=discord.File(
|
||||||
file_path,
|
file_path,
|
||||||
filename="unknown.png",
|
filename="unknown.png",
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
os.remove(file_path)
|
os.remove(file_path)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
await ctx.reply(
|
await ctx.reply(
|
||||||
"Stable diffusion isnt running right now, sorry.\n%s" % e,
|
"Stable diffusion isnt running right now, sorry.\n%s" % e,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
await ctx.respond("You can only do that in the stable-diffusion channel")
|
await ctx.respond("You can only do that in the stable-diffusion channel")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user