Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -234,64 +234,11 @@ def update_history(new_image, history):
|
|
234 |
history.insert(0, new_image)
|
235 |
return history
|
236 |
|
237 |
-
|
238 |
-
# --- CSS and Gradio UI ---
|
239 |
css = """
|
240 |
h1 {
|
241 |
text-align: center;
|
242 |
-
display: block;
|
243 |
-
margin-block-start: 0.5em; /* Reduce top margin */
|
244 |
-
margin-block-end: 0.5em; /* Reduce bottom margin */
|
245 |
-
}
|
246 |
-
p.center-description {
|
247 |
-
text-align: center;
|
248 |
-
margin-bottom: 1em;
|
249 |
-
}
|
250 |
-
|
251 |
-
/* --- Centering the main UI Block --- */
|
252 |
-
.gradio-container {
|
253 |
-
max-width: 1200px; /* Adjust max-width as desired */
|
254 |
-
margin-left: auto !important;
|
255 |
-
margin-right: auto !important;
|
256 |
-
padding-left: 15px; /* Add some padding */
|
257 |
-
padding-right: 15px;
|
258 |
-
box-sizing: border-box; /* Include padding in width */
|
259 |
-
}
|
260 |
-
|
261 |
-
/* --- Gallery Styling --- */
|
262 |
-
.gradio-container .gallery {
|
263 |
-
grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important; /* Smaller min size */
|
264 |
-
gap: 8px !important; /* Smaller gap */
|
265 |
-
}
|
266 |
-
.gradio-container .gallery > .gallery-item {
|
267 |
-
height: auto !important;
|
268 |
-
aspect-ratio: 1 / 1; /* Make items square */
|
269 |
-
overflow: hidden;
|
270 |
-
border-radius: 4px; /* Slightly rounded corners */
|
271 |
-
box-shadow: 0 1px 3px rgba(0,0,0,0.1); /* Subtle shadow */
|
272 |
-
}
|
273 |
-
.gradio-container .gallery > .gallery-item img {
|
274 |
-
object-fit: cover !important; /* Changed to cover for better square filling */
|
275 |
-
height: 100% !important;
|
276 |
-
width: 100% !important;
|
277 |
-
}
|
278 |
-
|
279 |
-
/* Ensure buttons and inputs don't get too wide */
|
280 |
-
.gradio-container button, .gradio-container input[type=text], .gradio-container textarea {
|
281 |
-
max-width: 100%;
|
282 |
-
}
|
283 |
-
.gradio-container .gr-button {
|
284 |
-
min-width: min(100%, 100px) !important; /* Adjust min-width for buttons */
|
285 |
-
flex-grow: 1;
|
286 |
-
}
|
287 |
-
|
288 |
-
/* Adjust Accordion header padding */
|
289 |
-
.gradio-container .gr-accordion > .gr-block > div:first-child {
|
290 |
-
padding: 8px 12px !important;
|
291 |
-
}
|
292 |
-
/* Tweak slider spacing */
|
293 |
-
.gradio-container .gr-slider {
|
294 |
-
margin-bottom: 5px !important;
|
295 |
}
|
296 |
"""
|
297 |
|
@@ -313,7 +260,7 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css) as demo:
|
|
313 |
with gr.Column(scale=2):
|
314 |
prompt_input = gr.Textbox(label="Prompt (Optional)")
|
315 |
with gr.Column(scale=1):
|
316 |
-
run_button = gr.Button("Generate / Diffusers Outpaint Image")
|
317 |
|
318 |
with gr.Row():
|
319 |
model_selector = gr.Dropdown(
|
|
|
234 |
history.insert(0, new_image)
|
235 |
return history
|
236 |
|
237 |
+
# CSS and title (unchanged)
|
|
|
238 |
css = """
|
239 |
h1 {
|
240 |
text-align: center;
|
241 |
+
display: block;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
242 |
}
|
243 |
"""
|
244 |
|
|
|
260 |
with gr.Column(scale=2):
|
261 |
prompt_input = gr.Textbox(label="Prompt (Optional)")
|
262 |
with gr.Column(scale=1):
|
263 |
+
run_button = gr.Button("Generate Image / Diffusers Outpaint Image Lightning")
|
264 |
|
265 |
with gr.Row():
|
266 |
model_selector = gr.Dropdown(
|