Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -26,24 +26,41 @@ def generate_image(prompt, width, height):
|
|
| 26 |
return None, f"β Error: {str(e)}"
|
| 27 |
|
| 28 |
|
| 29 |
-
# π¨
|
| 30 |
with gr.Blocks(
|
| 31 |
-
theme=gr.themes.Soft(
|
| 32 |
-
|
|
|
|
|
|
|
|
|
|
| 33 |
) as app:
|
| 34 |
|
| 35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
-
|
| 40 |
-
|
|
|
|
| 41 |
|
| 42 |
-
|
|
|
|
| 43 |
|
| 44 |
-
|
| 45 |
-
status = gr.Textbox()
|
| 46 |
|
| 47 |
-
btn.click(generate_image, [prompt, width, height], [
|
| 48 |
|
| 49 |
app.launch()
|
|
|
|
| 26 |
return None, f"β Error: {str(e)}"
|
| 27 |
|
| 28 |
|
| 29 |
+
# π¨ CLEAN MODERN UI
|
| 30 |
with gr.Blocks(
|
| 31 |
+
theme=gr.themes.Soft(
|
| 32 |
+
primary_hue="blue",
|
| 33 |
+
secondary_hue="sky",
|
| 34 |
+
neutral_hue="gray"
|
| 35 |
+
)
|
| 36 |
) as app:
|
| 37 |
|
| 38 |
+
# β
MAIN TITLE (fixed visibility)
|
| 39 |
+
gr.Markdown(
|
| 40 |
+
"""
|
| 41 |
+
# π¨ AI Text β Image Generator
|
| 42 |
+
### β¨ Generate high-quality AI images using Stable Diffusion
|
| 43 |
+
""",
|
| 44 |
+
elem_id="title"
|
| 45 |
+
)
|
| 46 |
|
| 47 |
+
with gr.Row():
|
| 48 |
+
prompt = gr.Textbox(
|
| 49 |
+
label="βοΈ Enter Prompt",
|
| 50 |
+
placeholder="A futuristic city at night, cinematic lighting...",
|
| 51 |
+
lines=3
|
| 52 |
+
)
|
| 53 |
|
| 54 |
+
with gr.Row():
|
| 55 |
+
width = gr.Slider(256, 1024, value=768, step=64, label="π Width")
|
| 56 |
+
height = gr.Slider(256, 1024, value=768, step=64, label="π Height")
|
| 57 |
|
| 58 |
+
with gr.Row():
|
| 59 |
+
btn = gr.Button("π Generate Image", variant="primary")
|
| 60 |
|
| 61 |
+
output_img = gr.Image(label="πΌοΈ Result", type="pil")
|
| 62 |
+
status = gr.Textbox(label="π’ Status")
|
| 63 |
|
| 64 |
+
btn.click(generate_image, [prompt, width, height], [output_img, status])
|
| 65 |
|
| 66 |
app.launch()
|