mxpln commited on
Commit
8130b7f
Β·
1 Parent(s): 7f24c09
Files changed (2) hide show
  1. .gitignore +1 -0
  2. app.py +26 -3
.gitignore ADDED
@@ -0,0 +1 @@
 
 
1
+ .cursor
app.py CHANGED
@@ -268,6 +268,22 @@ def infer(
268
  css = """
269
  #col-container { margin: 0 auto; max-width: 960px; }
270
  #main-title h1 { font-size: 2.1em !important; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
271
  """
272
 
273
  LORA_NAMES = ["None"] + sorted(LORA_CONFIGS.keys())
@@ -280,9 +296,13 @@ with gr.Blocks(css=css, theme=steel_blue_theme) as demo:
280
  "Add optional extra LoRAs below β€” selecting one auto-fills its trigger words."
281
  )
282
 
283
- with gr.Row(equal_height=True):
284
  with gr.Column():
285
- input_image = gr.Image(label="Input Image", type="pil", height=300)
 
 
 
 
286
  prompt = gr.Textbox(
287
  label="Edit Prompt",
288
  placeholder="e.g. nude woman, remove clothing, detailed skin texture...",
@@ -292,7 +312,10 @@ with gr.Blocks(css=css, theme=steel_blue_theme) as demo:
292
 
293
  with gr.Column():
294
  output_image = gr.Image(
295
- label="Output", interactive=False, format="png", height=300
 
 
 
296
  )
297
 
298
  with gr.Accordion("βž• Extra LoRAs (optional)", open=False):
 
268
  css = """
269
  #col-container { margin: 0 auto; max-width: 960px; }
270
  #main-title h1 { font-size: 2.1em !important; }
271
+ /* Preview defaults to cropping (cover-like); contain keeps the full image in frame */
272
+ #col-container .image-frame,
273
+ #col-container .image-frame > div,
274
+ .contain-preview .image-frame,
275
+ .contain-preview .image-frame > div {
276
+ overflow: visible !important;
277
+ }
278
+ #col-container .image-frame img,
279
+ .contain-preview .image-frame img {
280
+ object-fit: contain !important;
281
+ height: auto !important;
282
+ max-height: min(75vh, 900px) !important;
283
+ width: auto !important;
284
+ max-width: 100% !important;
285
+ margin-inline: auto;
286
+ }
287
  """
288
 
289
  LORA_NAMES = ["None"] + sorted(LORA_CONFIGS.keys())
 
296
  "Add optional extra LoRAs below β€” selecting one auto-fills its trigger words."
297
  )
298
 
299
+ with gr.Row(equal_height=False):
300
  with gr.Column():
301
+ input_image = gr.Image(
302
+ label="Input Image",
303
+ type="pil",
304
+ elem_classes=["contain-preview"],
305
+ )
306
  prompt = gr.Textbox(
307
  label="Edit Prompt",
308
  placeholder="e.g. nude woman, remove clothing, detailed skin texture...",
 
312
 
313
  with gr.Column():
314
  output_image = gr.Image(
315
+ label="Output",
316
+ interactive=False,
317
+ format="png",
318
+ elem_classes=["contain-preview"],
319
  )
320
 
321
  with gr.Accordion("βž• Extra LoRAs (optional)", open=False):