File size: 363 Bytes
d1efb81
 
5998e21
d1efb81
 
 
 
5998e21
 
 
 
 
 
 
 
b00cf75
5998e21
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from diffusers import StableDiffusionPipeline
import torch
import gradio as gr

model_id = "runwayml/stable-diffusion-v1-5"
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)

def Gen(text):
  image = pipe(prompt).images[0] 
  return image


 

demo = gr.Interface(
  fn=Gen, 
  inputs='text',
  outputs='image',
)

demo.launch()