LuigiLui commited on
Commit
8ef39e7
·
verified ·
1 Parent(s): bf26324

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -12
app.py CHANGED
@@ -15,7 +15,7 @@ examples = [
15
  ["Fantasy dragon", None]
16
  ]
17
 
18
- # Custom CSS for buttons and prompt box styling
19
  custom_css = """
20
  /* Remove border and background color for the output image preview */
21
  .output-image {
@@ -23,14 +23,14 @@ custom_css = """
23
  background: none !important;
24
  }
25
 
26
- /* Prompt textbox styling with a professional look */
27
  input[type="text"] {
28
- border: 2px solid #007bff; /* Blue border */
29
  border-radius: 8px;
30
  padding: 12px;
31
  font-size: 16px;
32
  width: 100%;
33
- background-color: #f0f8ff; /* Light background for professionalism */
34
  }
35
 
36
  /* Examples arranged in a single line, without buttons */
@@ -56,10 +56,10 @@ input[type="text"] {
56
  text-decoration: underline;
57
  }
58
 
59
- /* Styling for the generate and clear buttons */
60
  button {
61
  border-radius: 50px;
62
- background: linear-gradient(90deg, #007bff, #00d4ff); /* Blue gradient mix */
63
  color: white;
64
  font-weight: bold;
65
  padding: 10px 20px;
@@ -70,7 +70,7 @@ button {
70
  }
71
 
72
  button:hover {
73
- background: linear-gradient(90deg, #00d4ff, #007bff);
74
  }
75
  """
76
 
@@ -78,7 +78,7 @@ button:hover {
78
  interface = gr.Interface(
79
  fn=generate_image,
80
  inputs=[
81
- gr.Textbox(label="Describe the scene:", placeholder="Type your imagination...", interactive=True),
82
  gr.Slider(minimum=0, maximum=10000, step=1, label="Seed (optional)")
83
  ],
84
  outputs=gr.Image(label="Generated Image", type="pil"),
@@ -87,8 +87,4 @@ interface = gr.Interface(
87
  description="Enter a creative prompt or choose an example to generate your AI-powered image. Model performance may vary due to CPU usage.",
88
  )
89
 
90
- # Add Generate and Clear buttons
91
- interface.add_button("Generate", variant="primary")
92
- interface.add_button("Clear", variant="secondary")
93
-
94
  interface.launch()
 
15
  ["Fantasy dragon", None]
16
  ]
17
 
18
+ # Custom CSS for minimalist style, horizontal example layout, and styled prompt box
19
  custom_css = """
20
  /* Remove border and background color for the output image preview */
21
  .output-image {
 
23
  background: none !important;
24
  }
25
 
26
+ /* Prompt textbox styling */
27
  input[type="text"] {
28
+ border: 2px solid #ddd;
29
  border-radius: 8px;
30
  padding: 12px;
31
  font-size: 16px;
32
  width: 100%;
33
+ background-color: #f9f9f9;
34
  }
35
 
36
  /* Examples arranged in a single line, without buttons */
 
56
  text-decoration: underline;
57
  }
58
 
59
+ /* Styling for the generate button */
60
  button {
61
  border-radius: 50px;
62
+ background: linear-gradient(90deg, #ff8a00, #e52e71);
63
  color: white;
64
  font-weight: bold;
65
  padding: 10px 20px;
 
70
  }
71
 
72
  button:hover {
73
+ background: linear-gradient(90deg, #e52e71, #ff8a00);
74
  }
75
  """
76
 
 
78
  interface = gr.Interface(
79
  fn=generate_image,
80
  inputs=[
81
+ gr.Textbox(label="Imagine anything:", placeholder="Describe the scene...", interactive=True),
82
  gr.Slider(minimum=0, maximum=10000, step=1, label="Seed (optional)")
83
  ],
84
  outputs=gr.Image(label="Generated Image", type="pil"),
 
87
  description="Enter a creative prompt or choose an example to generate your AI-powered image. Model performance may vary due to CPU usage.",
88
  )
89
 
 
 
 
 
90
  interface.launch()