File size: 368 Bytes
0a2e391 69d10a0 0a2e391 69d10a0 0a2e391 69d10a0 0a2e391 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
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() |