Spaces:
Paused
Paused
| from diffusers import StableDiffusionPipeline | |
| import torch | |
| model_id = "runwayml/stable-diffusion-v1-5" | |
| pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16, revision="fp16") | |
| #pipe = pipe.to("cuda") | |
| #prompt = "a photo of an astronaut riding a horse on mars" | |
| def gen(prompt): | |
| image = pipe(prompt).images[0] | |
| return image | |
| import gradio as gr | |
| d = gr.Interface(gen,inputs="text", outputs=['image', 'image']) | |
| d.launch(debug=True) |