Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,17 +15,22 @@ examples = [
|
|
| 15 |
["Fantasy dragon", None]
|
| 16 |
]
|
| 17 |
|
| 18 |
-
# Custom CSS for minimalist style, horizontal example layout, and
|
| 19 |
custom_css = """
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
/* Prompt textbox styling */
|
| 22 |
input[type="text"] {
|
| 23 |
-
border: 2px solid #ddd;
|
| 24 |
border-radius: 8px;
|
| 25 |
padding: 12px;
|
| 26 |
font-size: 16px;
|
| 27 |
width: 100%;
|
| 28 |
-
background-color: #
|
| 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;
|
| 46 |
-
border: 1px solid #ddd;
|
| 47 |
-
border-radius: 5px;
|
| 48 |
transition: all 0.2s ease;
|
| 49 |
}
|
| 50 |
|
| 51 |
/* Hover effect on examples */
|
| 52 |
.gr-examples span:hover {
|
| 53 |
-
background-color: #
|
| 54 |
-
color: #
|
| 55 |
-
text-decoration: underline; /* Underline text on hover */
|
| 56 |
}
|
| 57 |
|
| 58 |
-
/* Styling for
|
| 59 |
button {
|
| 60 |
-
border-radius:
|
| 61 |
-
background:
|
| 62 |
-
color:
|
| 63 |
font-weight: bold;
|
| 64 |
padding: 10px 20px;
|
| 65 |
-
border:
|
| 66 |
cursor: pointer;
|
| 67 |
font-size: 16px;
|
| 68 |
margin-top: 10px;
|
| 69 |
}
|
| 70 |
|
| 71 |
button:hover {
|
| 72 |
-
background: #
|
|
|
|
| 73 |
}
|
| 74 |
"""
|
| 75 |
|
|
@@ -77,13 +82,13 @@ button:hover {
|
|
| 77 |
interface = gr.Interface(
|
| 78 |
fn=generate_image,
|
| 79 |
inputs=[
|
| 80 |
-
gr.Textbox(label="Imagine
|
| 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()
|