RosieDiffusion / app.py
Robo0890's picture
Update app.py
0a2e391
raw
history blame
368 Bytes
from diffusers import StableDiffusionPipeline as SD
import torch
import gradio as gr
model_id = "runwayml/stable-diffusion-v1-5"
gen = SD.from_pretrained(model_id)
gen.to("cuda")
def generate():
prompt = "A doggo"
image = gen(prompt).images[0]
image.save("result.png")
ui = gr.Interface(fn=generate, inputs="prompt_field", outputs="result")
ui.launch()