Kia09 commited on
Commit
87e9593
·
verified ·
1 Parent(s): 8d4a6a8

Upload 2 files

Browse files
Files changed (2) hide show
  1. app.py +13 -0
  2. requirements.txt +4 -0
app.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from diffusers import StableDiffusionPipeline
3
+
4
+ # Load your model (make sure it's downloaded from Hugging Face)
5
+ pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v-1-4-original")
6
+
7
+ # Define the function to generate the image
8
+ def generate_image(prompt):
9
+ image = pipe(prompt).images[0]
10
+ return image
11
+
12
+ # Set up Gradio interface
13
+ gr.Interface(fn=generate_image, inputs="text", outputs="image").launch()
requirements.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ gradio
2
+ diffusers
3
+ torch
4
+ transformers