Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -76,27 +76,41 @@ footer {display: none !important}
|
|
| 76 |
#gallery {
|
| 77 |
width: 100% !important;
|
| 78 |
max-width: 100% !important;
|
| 79 |
-
overflow:
|
| 80 |
}
|
| 81 |
#gallery > div {
|
| 82 |
width: 100% !important;
|
| 83 |
max-width: none !important;
|
| 84 |
-
transform: scale(2) !important;
|
| 85 |
-
transform-origin: left top !important;
|
| 86 |
}
|
| 87 |
-
|
|
|
|
| 88 |
display: grid !important;
|
| 89 |
grid-template-columns: repeat(5, 1fr) !important;
|
| 90 |
gap: 16px !important;
|
| 91 |
padding: 16px !important;
|
|
|
|
|
|
|
| 92 |
background: rgba(255, 255, 255, 0.05);
|
| 93 |
border-radius: 8px;
|
| 94 |
margin-top: 10px;
|
| 95 |
width: 100% !important;
|
| 96 |
-
max-width: none !important;
|
| 97 |
box-sizing: border-box !important;
|
| 98 |
}
|
| 99 |
/* Force gallery items to maintain aspect ratio */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 100 |
.gallery-item {
|
| 101 |
width: 100% !important;
|
| 102 |
aspect-ratio: 1 !important;
|
|
@@ -145,7 +159,6 @@ footer {display: none !important}
|
|
| 145 |
}
|
| 146 |
"""
|
| 147 |
|
| 148 |
-
|
| 149 |
def save_image(image):
|
| 150 |
"""Save the generated image and return the path"""
|
| 151 |
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
|
@@ -262,7 +275,6 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css) as demo:
|
|
| 262 |
elem_id="output-image",
|
| 263 |
elem_classes=["output-image", "fixed-width"]
|
| 264 |
)
|
| 265 |
-
|
| 266 |
gallery = gr.Gallery(
|
| 267 |
label="Generated Images Gallery",
|
| 268 |
show_label=True,
|
|
@@ -272,7 +284,9 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css) as demo:
|
|
| 272 |
height="auto",
|
| 273 |
object_fit="cover",
|
| 274 |
elem_classes=["gallery-container", "fixed-width"]
|
| 275 |
-
)
|
|
|
|
|
|
|
| 276 |
|
| 277 |
|
| 278 |
# Load existing gallery images on startup
|
|
|
|
| 76 |
#gallery {
|
| 77 |
width: 100% !important;
|
| 78 |
max-width: 100% !important;
|
| 79 |
+
overflow: visible !important;
|
| 80 |
}
|
| 81 |
#gallery > div {
|
| 82 |
width: 100% !important;
|
| 83 |
max-width: none !important;
|
|
|
|
|
|
|
| 84 |
}
|
| 85 |
+
#gallery > div > div {
|
| 86 |
+
width: 100% !important;
|
| 87 |
display: grid !important;
|
| 88 |
grid-template-columns: repeat(5, 1fr) !important;
|
| 89 |
gap: 16px !important;
|
| 90 |
padding: 16px !important;
|
| 91 |
+
}
|
| 92 |
+
.gallery-container {
|
| 93 |
background: rgba(255, 255, 255, 0.05);
|
| 94 |
border-radius: 8px;
|
| 95 |
margin-top: 10px;
|
| 96 |
width: 100% !important;
|
|
|
|
| 97 |
box-sizing: border-box !important;
|
| 98 |
}
|
| 99 |
/* Force gallery items to maintain aspect ratio */
|
| 100 |
+
.gallery-item {
|
| 101 |
+
width: 100% !important;
|
| 102 |
+
aspect-ratio: 1 !important;
|
| 103 |
+
overflow: hidden !important;
|
| 104 |
+
border-radius: 4px !important;
|
| 105 |
+
}
|
| 106 |
+
.gallery-item img {
|
| 107 |
+
width: 100% !important;
|
| 108 |
+
height: 100% !important;
|
| 109 |
+
object-fit: cover !important;
|
| 110 |
+
border-radius: 4px !important;
|
| 111 |
+
transition: transform 0.2s;
|
| 112 |
+
}
|
| 113 |
+
/* Force gallery items to maintain aspect ratio */
|
| 114 |
.gallery-item {
|
| 115 |
width: 100% !important;
|
| 116 |
aspect-ratio: 1 !important;
|
|
|
|
| 159 |
}
|
| 160 |
"""
|
| 161 |
|
|
|
|
| 162 |
def save_image(image):
|
| 163 |
"""Save the generated image and return the path"""
|
| 164 |
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
|
|
|
| 275 |
elem_id="output-image",
|
| 276 |
elem_classes=["output-image", "fixed-width"]
|
| 277 |
)
|
|
|
|
| 278 |
gallery = gr.Gallery(
|
| 279 |
label="Generated Images Gallery",
|
| 280 |
show_label=True,
|
|
|
|
| 284 |
height="auto",
|
| 285 |
object_fit="cover",
|
| 286 |
elem_classes=["gallery-container", "fixed-width"]
|
| 287 |
+
)
|
| 288 |
+
|
| 289 |
+
|
| 290 |
|
| 291 |
|
| 292 |
# Load existing gallery images on startup
|