Spaces:
Runtime error
Runtime error
use blocks api
Browse files
app.py
CHANGED
|
@@ -7,11 +7,11 @@ def generate_image_predictions(prompt):
|
|
| 7 |
return images
|
| 8 |
|
| 9 |
|
| 10 |
-
|
| 11 |
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
# ๐ Map Diffuser
|
| 16 |
|
| 17 |
๐ Generates images from a given text prompt. The prompts are in the format:
|
|
@@ -34,10 +34,15 @@ iface = gr.Interface(
|
|
| 34 |
| Watercolor style map of Amsterdam with residential area and highways | <img src="https://i.imgur.com/AQS34dk.png" width="300" /> |
|
| 35 |
| Toner style map of Amsterdam with residential area and highways | <img src="https://i.imgur.com/X8VcezT.png" width="300" /> |
|
| 36 |
| Satellite image with forests and residential, no water | <img src="https://i.imgur.com/MEccHdM.png" width="300" /> |
|
| 37 |
-
"""
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
-
|
|
|
|
| 7 |
return images
|
| 8 |
|
| 9 |
|
| 10 |
+
demo = gr.Blocks()
|
| 11 |
|
| 12 |
+
with demo:
|
| 13 |
+
gr.Markdown(
|
| 14 |
+
"""
|
| 15 |
# ๐ Map Diffuser
|
| 16 |
|
| 17 |
๐ Generates images from a given text prompt. The prompts are in the format:
|
|
|
|
| 34 |
| Watercolor style map of Amsterdam with residential area and highways | <img src="https://i.imgur.com/AQS34dk.png" width="300" /> |
|
| 35 |
| Toner style map of Amsterdam with residential area and highways | <img src="https://i.imgur.com/X8VcezT.png" width="300" /> |
|
| 36 |
| Satellite image with forests and residential, no water | <img src="https://i.imgur.com/MEccHdM.png" width="300" /> |
|
| 37 |
+
"""
|
| 38 |
+
)
|
| 39 |
+
input = gr.components.Textbox(label="Enter a text prompt here")
|
| 40 |
+
output = gr.components.Image(label="Output Image")
|
| 41 |
+
# button to submit the prompt
|
| 42 |
+
button = gr.components.Button(label="Generate")
|
| 43 |
+
# when the button is clicked, call the generate_image_predictions function
|
| 44 |
+
# and pass in the prompt as an argument
|
| 45 |
+
button.submit(generate_image_predictions, inputs=input, outputs=output)
|
| 46 |
+
|
| 47 |
|
| 48 |
+
demo.launch()
|