LuigiLui commited on
Commit
04a1a68
·
verified ·
1 Parent(s): 25ee7c1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -17
app.py CHANGED
@@ -15,17 +15,22 @@ examples = [
15
  ["Fantasy dragon", None]
16
  ]
17
 
18
- # Custom CSS for minimalist style, horizontal example layout, and styled prompt box
19
  custom_css = """
 
 
 
 
 
20
 
21
  /* Prompt textbox styling */
22
  input[type="text"] {
23
- border: 2px solid #ddd; /* Default border */
24
  border-radius: 8px;
25
  padding: 12px;
26
  font-size: 16px;
27
  width: 100%;
28
- background-color: #f94925; /* Light gray background */
29
  }
30
 
31
  /* Examples arranged in a single line, without buttons */
@@ -42,34 +47,34 @@ input[type="text"] {
42
  color: #333;
43
  cursor: pointer;
44
  padding: 5px;
45
- background-color: white; /* Simple white background */
46
- border: 1px solid #ddd; /* Light gray border */
47
- border-radius: 5px; /* Rounded corners */
48
  transition: all 0.2s ease;
49
  }
50
 
51
  /* Hover effect on examples */
52
  .gr-examples span:hover {
53
- background-color: #000000; /* Light gray on hover */
54
- color: #007bff; /* Change text color on hover */
55
- text-decoration: underline; /* Underline text on hover */
56
  }
57
 
58
- /* Styling for the generate button */
59
  button {
60
- border-radius: 50px;
61
- background: linear-gradient(90deg, #ff8a00, #e52e71);
62
- color: white;
63
  font-weight: bold;
64
  padding: 10px 20px;
65
- border: none;
66
  cursor: pointer;
67
  font-size: 16px;
68
  margin-top: 10px;
69
  }
70
 
71
  button:hover {
72
- background: #fafafa;
 
73
  }
74
  """
75
 
@@ -77,13 +82,13 @@ button:hover {
77
  interface = gr.Interface(
78
  fn=generate_image,
79
  inputs=[
80
- gr.Textbox(label="Imagine Your Dream:", placeholder="Describe the scene...", interactive=True),
81
  gr.Slider(minimum=0, maximum=10000, step=1, label="Seed (optional)")
82
  ],
83
  outputs=gr.Image(label="Generated Image", type="pil"),
84
  examples=examples,
85
  css=custom_css, # Apply custom CSS
86
- description="Enter a creative prompt or choose an example to generate your AI-powered image.",
87
  )
88
 
89
  interface.launch()
 
15
  ["Fantasy dragon", None]
16
  ]
17
 
18
+ # Custom CSS for minimalist style, horizontal example layout, and simple buttons
19
  custom_css = """
20
+ /* Remove border and background color for the output image preview */
21
+ .output-image {
22
+ border: none !important;
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 */
 
47
  color: #333;
48
  cursor: pointer;
49
  padding: 5px;
50
+ background-color: white;
51
+ border: 1px solid #ddd;
52
+ border-radius: 5px;
53
  transition: all 0.2s ease;
54
  }
55
 
56
  /* Hover effect on examples */
57
  .gr-examples span:hover {
58
+ background-color: #e7e7e7;
59
+ color: #333;
 
60
  }
61
 
62
+ /* Styling for all buttons with simple design */
63
  button {
64
+ border-radius: 8px;
65
+ background-color: #f0f0f0; /* Simple gray background */
66
+ color: #333;
67
  font-weight: bold;
68
  padding: 10px 20px;
69
+ border: 1px solid #ccc;
70
  cursor: pointer;
71
  font-size: 16px;
72
  margin-top: 10px;
73
  }
74
 
75
  button:hover {
76
+ background-color: #e0e0e0; /* Slightly darker on hover */
77
+ color: #333;
78
  }
79
  """
80
 
 
82
  interface = gr.Interface(
83
  fn=generate_image,
84
  inputs=[
85
+ gr.Textbox(label="Imagine anything:", placeholder="Describe the scene...", interactive=True),
86
  gr.Slider(minimum=0, maximum=10000, step=1, label="Seed (optional)")
87
  ],
88
  outputs=gr.Image(label="Generated Image", type="pil"),
89
  examples=examples,
90
  css=custom_css, # Apply custom CSS
91
+ description="Enter a creative prompt or choose an example to generate your AI-powered image. Model performance may vary due to CPU usage.",
92
  )
93
 
94
  interface.launch()