Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -15,7 +15,7 @@ examples = [
|
|
15 |
["Fantasy dragon", None]
|
16 |
]
|
17 |
|
18 |
-
# Custom CSS for
|
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 */
|
27 |
input[type="text"] {
|
28 |
-
border: 2px solid #
|
29 |
border-radius: 8px;
|
30 |
padding: 12px;
|
31 |
font-size: 16px;
|
32 |
width: 100%;
|
33 |
-
background-color: #
|
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
|
60 |
button {
|
61 |
border-radius: 50px;
|
62 |
-
background:
|
63 |
color: white;
|
64 |
font-weight: bold;
|
65 |
padding: 10px 20px;
|
@@ -68,6 +68,9 @@ button {
|
|
68 |
font-size: 16px;
|
69 |
margin-top: 10px;
|
70 |
}
|
|
|
|
|
|
|
71 |
}
|
72 |
"""
|
73 |
|
@@ -75,7 +78,7 @@ button {
|
|
75 |
interface = gr.Interface(
|
76 |
fn=generate_image,
|
77 |
inputs=[
|
78 |
-
gr.Textbox(label="
|
79 |
gr.Slider(minimum=0, maximum=10000, step=1, label="Seed (optional)")
|
80 |
],
|
81 |
outputs=gr.Image(label="Generated Image", type="pil"),
|
@@ -84,4 +87,8 @@ interface = gr.Interface(
|
|
84 |
description="Enter a creative prompt or choose an example to generate your AI-powered image. Model performance may vary due to CPU usage.",
|
85 |
)
|
86 |
|
|
|
|
|
|
|
|
|
87 |
interface.launch()
|
|
|
15 |
["Fantasy dragon", None]
|
16 |
]
|
17 |
|
18 |
+
# Custom CSS for button styling and improved prompt box design
|
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 with professional look */
|
27 |
input[type="text"] {
|
28 |
+
border: 2px solid #007bff;
|
29 |
border-radius: 8px;
|
30 |
padding: 12px;
|
31 |
font-size: 16px;
|
32 |
width: 100%;
|
33 |
+
background-color: #f0f8ff; /* Light professional background */
|
34 |
}
|
35 |
|
36 |
/* Examples arranged in a single line, without buttons */
|
|
|
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 */
|
63 |
color: white;
|
64 |
font-weight: bold;
|
65 |
padding: 10px 20px;
|
|
|
68 |
font-size: 16px;
|
69 |
margin-top: 10px;
|
70 |
}
|
71 |
+
|
72 |
+
button:hover {
|
73 |
+
background: linear-gradient(90deg, #00d4ff, #007bff);
|
74 |
}
|
75 |
"""
|
76 |
|
|
|
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 |
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 buttons to the interface
|
91 |
+
interface.add_button("Generate", variant="primary")
|
92 |
+
interface.add_button("Clear", variant="secondary")
|
93 |
+
|
94 |
interface.launch()
|