Avinash99 commited on
Commit
26cf950
·
1 Parent(s): d9c9ad1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -1
app.py CHANGED
@@ -1,3 +1,18 @@
1
  import gradio as gr
 
2
 
3
- gr.load("models/stabilityai/stable-diffusion-2-1").launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
+ from diffusers import DiffusionPipeline
3
 
4
+ pipeline = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-2-1")
5
+
6
+ def predict(input_img):
7
+ predictions = pipeline(input_img)
8
+ return predictions
9
+
10
+ gradio_app = gr.Interface(
11
+ predict,
12
+ inputs=gr.Text(label="Select hot dog candidate"),
13
+ outputs=[gr.Image(label="Processed Image"), gr.Label(label="Result", num_top_classes=2)],
14
+ title="Image Generator",
15
+ )
16
+
17
+ if __name__ == "__main__":
18
+ gradio_app.launch()