Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,20 +1,2 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
# Initialize your model here
|
5 |
-
generator = pipeline("image-generation", model="CompVis/stable-diffusion-v1-4")
|
6 |
-
|
7 |
-
# Function to generate image from text prompt
|
8 |
-
def generate_image(prompt):
|
9 |
-
return generator(prompt)[0]["image"]
|
10 |
-
|
11 |
-
# Define Gradio Interface
|
12 |
-
interface = gr.Interface(
|
13 |
-
fn=generate_image,
|
14 |
-
inputs="text", # User will input text prompt
|
15 |
-
outputs="image", # The output will be an image
|
16 |
-
live=True
|
17 |
-
)
|
18 |
-
|
19 |
-
# Launch the interface
|
20 |
-
interface.launch()
|
|
|
1 |
+
!pip install transformers
|
2 |
+
transformers==4.x.x
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|