SNA-AI commited on
Commit
2068d48
Β·
verified Β·
1 Parent(s): 0000954

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +28 -11
app.py CHANGED
@@ -26,24 +26,41 @@ def generate_image(prompt, width, height):
26
  return None, f"❌ Error: {str(e)}"
27
 
28
 
29
- # 🎨 UI (LIGHT + MODERN)
30
  with gr.Blocks(
31
- theme=gr.themes.Soft(primary_hue="blue"),
32
- css="body {background-color:#f4f7ff !important;}"
 
 
 
33
  ) as app:
34
 
35
- gr.Markdown("# 🎨 AI Text β†’ Image Generator")
 
 
 
 
 
 
 
36
 
37
- prompt = gr.Textbox(label="Prompt")
 
 
 
 
 
38
 
39
- width = gr.Slider(256, 1024, value=768, step=64, label="Width")
40
- height = gr.Slider(256, 1024, value=768, step=64, label="Height")
 
41
 
42
- btn = gr.Button("Generate", variant="primary")
 
43
 
44
- img = gr.Image(type="pil")
45
- status = gr.Textbox()
46
 
47
- btn.click(generate_image, [prompt, width, height], [img, status])
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()