changed hard coded folder to a variable

This commit is contained in:
phixxy 2024-01-19 18:46:14 -08:00
parent 4f64e47057
commit eaf928ba8e

View file

@ -170,13 +170,12 @@ class StableDiffusion(commands.Cog):
else: else:
folder = self.working_dir + "sfw/" folder = self.working_dir + "sfw/"
except: except:
folder = "tmp/" folder = self.working_dir
my_filename = folder + str(time.time_ns()) + ".png" my_filename = folder + str(time.time_ns()) + ".png"
image.save(my_filename, pnginfo=pnginfo) image.save(my_filename, pnginfo=pnginfo)
with open(my_filename, "rb") as fh: with open(my_filename, "rb") as fh:
f = discord.File(fh, filename=my_filename) f = discord.File(fh, filename=my_filename)
await ctx.send(file=f) await ctx.send(prompt, file=f)
await ctx.send(prompt)
except Exception as error: except Exception as error:
await self.handle_error(error) await self.handle_error(error)
await ctx.send("My image generation service may not be running.") await ctx.send("My image generation service may not be running.")