From bc4224a4564555079817ffcc9a9bf4b32ab33550 Mon Sep 17 00:00:00 2001 From: mc_fdc Date: Mon, 24 Jul 2023 15:00:02 +0900 Subject: [PATCH] Create imagine.py --- cogs/entertainment/imagine.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 cogs/entertainment/imagine.py diff --git a/cogs/entertainment/imagine.py b/cogs/entertainment/imagine.py new file mode 100644 index 0000000..9bcec15 --- /dev/null +++ b/cogs/entertainment/imagine.py @@ -0,0 +1,12 @@ +import discord +from discord.ext import commands + +from diffusers import DiffusionPipeline +import torch + + +class Imagine(commands.Cog): + + def __init__(self, bot: commands.Bot): + self.pipe = DiffusionPipeline.from_pretrained("hakurei/waifu-diffusion", torch_dtype=torch.float16) + self.pipe.to("cuda")