AI-TINY-IMAGE / app.py
Prak2005's picture
Update app.py
5831795 verified
raw
history blame contribute delete
422 Bytes
import gradio as gr
import torch
from diffusers import StableDiffusionPipeline
pipe = StableDiffusionPipeline.from_pretrained(
"stabilityai/stable-diffusion-2-1",
torch_dtype=torch.float32 # float16 not supported on CPU
).to("cpu")
def generate_comic(prompt):
image = pipe(prompt).images[0]
return image
gr.Interface(fn=generate_comic, inputs="text", outputs="image", title="Comic Generator").launch()