prithivMLmods commited on
Commit
2da71d2
·
verified ·
1 Parent(s): 830e066

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +40 -15
app.py CHANGED
@@ -239,35 +239,60 @@ def update_history(new_image, history):
239
  css = """
240
  h1 {
241
  text-align: center;
242
- display: block;
 
 
 
 
 
 
243
  }
244
 
245
- /* --- Centering the main UI --- */
246
  .gradio-container {
247
- max-width: 1280px; /* Adjust this value for desired max width */
248
- margin-left: auto !important; /* Add !important to override defaults if needed */
249
  margin-right: auto !important;
250
- padding-left: 20px; /* Add some padding so content isn't flush against edge */
251
- padding-right: 20px;
 
252
  }
253
- /* --- End Centering --- */
254
-
255
 
256
- /* Make gallery items smaller */
257
  .gradio-container .gallery {
258
- grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)) !important; /* Adjust 120px as needed */
259
- gap: 10px !important;
260
  }
261
  .gradio-container .gallery > .gallery-item {
262
- height: auto !important; /* Allow height to adjust based on content */
263
- max-height: 150px; /* Set a max height if needed */
264
- overflow: hidden; /* Hide overflow */
 
 
265
  }
266
  .gradio-container .gallery > .gallery-item img {
267
- object-fit: contain !important; /* Fit image within bounds */
268
  height: 100% !important;
269
  width: 100% !important;
270
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
271
  """
272
 
273
  title = """<h1 align="center">Diffusers Image Outpaint Lightning</h1>
 
239
  css = """
240
  h1 {
241
  text-align: center;
242
+ display: block; /* Ensure it takes full width for centering */
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
 
298
  title = """<h1 align="center">Diffusers Image Outpaint Lightning</h1>