akhaliq HF Staff commited on
Commit
dacebcc
·
verified ·
1 Parent(s): edd3265

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -32
app.py CHANGED
@@ -139,7 +139,7 @@ t2i_example_prompts = [
139
  ["A cute robot sitting at a desk, digital art style", 1024, 1024, 44],
140
  ]
141
 
142
- # --- Custom CSS (Modified to ensure Row behavior) ---
143
  custom_css = """
144
  @import url('https://fonts.googleapis.com/css2?family=SF+Pro+Display:wght@300;400;500;600;700&display=swap');
145
 
@@ -147,20 +147,13 @@ custom_css = """
147
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
148
  }
149
 
150
- /* Ensure padding on all screen sizes */
151
  .gradio-container {
152
- /* Retain max-width but remove side padding in Blocks for better full-width control */
153
- max-width: 1400px !important;
154
  margin: auto !important;
155
- padding: 0 16px;
156
  }
157
 
158
- /* CSS Fix: Ensure layout elements behave as flex containers */
159
- .gr-row {
160
- display: flex !important;
161
- }
162
-
163
- /* Background gradient for the overall app (like a subtle card) */
164
  #component-0 {
165
  background: linear-gradient(180deg, #f5f5f7 0%, #ffffff 100%) !important;
166
  }
@@ -225,23 +218,6 @@ textarea:focus, input[type="text"]:focus {
225
  box-shadow: 0 6px 16px rgba(0, 122, 255, 0.4) !important;
226
  }
227
 
228
- /* Slider and Label styling */
229
- .slider-container {
230
- margin: 16px 0 !important;
231
- }
232
-
233
- label {
234
- font-weight: 500 !important;
235
- color: #1d1d1f !important;
236
- margin-bottom: 8px !important;
237
- font-size: 14px !important;
238
- }
239
-
240
- .secondary-text {
241
- color: #86868b !important;
242
- font-size: 13px !important;
243
- }
244
-
245
  /* Card Style (targets gr-panel when variant="panel" is used) */
246
  .card {
247
  background: white !important;
@@ -250,7 +226,7 @@ label {
250
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04) !important;
251
  }
252
 
253
- /* Mobile adjustments */
254
  @media (max-width: 768px) {
255
  .gradio-container {
256
  padding: 0 8px !important;
@@ -262,7 +238,7 @@ label {
262
  """
263
 
264
  # Build Gradio interface
265
- # Added fill_width=True to Blocks to maximize space utilization
266
  with gr.Blocks(fill_width=True) as demo:
267
  gr.HTML("""
268
  <div style="text-align: center; padding: 40px 20px 30px 20px;">
@@ -280,8 +256,6 @@ with gr.Blocks(fill_width=True) as demo:
280
  with gr.TabItem("Edit Image", id=0):
281
  with gr.Row():
282
  # Left Column (Inputs)
283
- # Setting min_width=0 ensures the column will shrink freely on narrow viewports
284
- # until Gradio's responsive behavior naturally stacks them.
285
  with gr.Column(scale=1, min_width=0, variant="panel"):
286
  gr.Markdown("### 🖼️ Input Image & Controls")
287
  input_image = gr.Image(
 
139
  ["A cute robot sitting at a desk, digital art style", 1024, 1024, 44],
140
  ]
141
 
142
+ # --- Custom CSS (Cleaned up for maximum layout flexibility) ---
143
  custom_css = """
144
  @import url('https://fonts.googleapis.com/css2?family=SF+Pro+Display:wght@300;400;500;600;700&display=swap');
145
 
 
147
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
148
  }
149
 
150
+ /* Base styling relying on fill_width=True and Gradio's structure */
151
  .gradio-container {
152
+ max-width: 100% !important; /* Allow full width */
 
153
  margin: auto !important;
 
154
  }
155
 
156
+ /* Background gradient for the overall app */
 
 
 
 
 
157
  #component-0 {
158
  background: linear-gradient(180deg, #f5f5f7 0%, #ffffff 100%) !important;
159
  }
 
218
  box-shadow: 0 6px 16px rgba(0, 122, 255, 0.4) !important;
219
  }
220
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
221
  /* Card Style (targets gr-panel when variant="panel" is used) */
222
  .card {
223
  background: white !important;
 
226
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04) !important;
227
  }
228
 
229
+ /* Mobile adjustments (retains padding) */
230
  @media (max-width: 768px) {
231
  .gradio-container {
232
  padding: 0 8px !important;
 
238
  """
239
 
240
  # Build Gradio interface
241
+ # Using fill_width=True on Blocks to maximize available horizontal space
242
  with gr.Blocks(fill_width=True) as demo:
243
  gr.HTML("""
244
  <div style="text-align: center; padding: 40px 20px 30px 20px;">
 
256
  with gr.TabItem("Edit Image", id=0):
257
  with gr.Row():
258
  # Left Column (Inputs)
 
 
259
  with gr.Column(scale=1, min_width=0, variant="panel"):
260
  gr.Markdown("### 🖼️ Input Image & Controls")
261
  input_image = gr.Image(