multimodalart HF Staff commited on
Commit
9e4cd22
·
verified ·
1 Parent(s): dfa9384

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -222,6 +222,7 @@ def get_duration(
222
  pixel_offset: int = 8,
223
  num_steps: int = 28,
224
  guidance: float = 3.5,
 
225
  seed: int = 42,
226
  randomize_seed: bool = False,
227
  progress=gr.Progress(track_tqdm=True)
@@ -243,6 +244,7 @@ def run_diptych_prompting(
243
  pixel_offset: int = 8,
244
  num_steps: int = 28,
245
  guidance: float = 3.5,
 
246
  seed: int = 42,
247
  randomize_seed: bool = False,
248
  progress=gr.Progress(track_tqdm=True)
@@ -296,7 +298,7 @@ def run_diptych_prompting(
296
  controlnet_conditioning_scale=ctrl_scale,
297
  guidance_scale=guidance,
298
  negative_prompt="",
299
- true_guidance_scale=guidance
300
  ).images[0]
301
 
302
  # 5. Final cropping (logic from original script's main block)
@@ -327,7 +329,8 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
327
  attn_enforce = gr.Slider(minimum=1.0, maximum=2.0, value=1.3, step=0.05, label="Attention Enforcement")
328
  ctrl_scale = gr.Slider(minimum=0.5, maximum=1.0, value=0.95, step=0.01, label="ControlNet Scale")
329
  num_steps = gr.Slider(minimum=20, maximum=50, value=28, step=1, label="Inference Steps")
330
- guidance = gr.Slider(minimum=1.0, maximum=10.0, value=3.5, step=0.1, label="Guidance Scale")
 
331
  width = gr.Slider(minimum=512, maximum=1024, value=768, step=64, label="Image Width")
332
  height = gr.Slider(minimum=512, maximum=1024, value=768, step=64, label="Image Height")
333
  pixel_offset = gr.Slider(minimum=0, maximum=32, value=8, step=1, label="Padding (Pixel Offset)")
@@ -349,7 +352,7 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
349
 
350
  run_button.click(
351
  fn=run_diptych_prompting,
352
- inputs=[input_image, subject_name, target_prompt, attn_enforce, ctrl_scale, width, height, pixel_offset, num_steps, guidance, seed, randomize_seed],
353
  outputs=output_image
354
  )
355
 
 
222
  pixel_offset: int = 8,
223
  num_steps: int = 28,
224
  guidance: float = 3.5,
225
+ real_guidance: float = 4.5,
226
  seed: int = 42,
227
  randomize_seed: bool = False,
228
  progress=gr.Progress(track_tqdm=True)
 
244
  pixel_offset: int = 8,
245
  num_steps: int = 28,
246
  guidance: float = 3.5,
247
+ real_guidance: float = 4.5,
248
  seed: int = 42,
249
  randomize_seed: bool = False,
250
  progress=gr.Progress(track_tqdm=True)
 
298
  controlnet_conditioning_scale=ctrl_scale,
299
  guidance_scale=guidance,
300
  negative_prompt="",
301
+ true_guidance_scale=real_guidance
302
  ).images[0]
303
 
304
  # 5. Final cropping (logic from original script's main block)
 
329
  attn_enforce = gr.Slider(minimum=1.0, maximum=2.0, value=1.3, step=0.05, label="Attention Enforcement")
330
  ctrl_scale = gr.Slider(minimum=0.5, maximum=1.0, value=0.95, step=0.01, label="ControlNet Scale")
331
  num_steps = gr.Slider(minimum=20, maximum=50, value=28, step=1, label="Inference Steps")
332
+ guidance = gr.Slider(minimum=1.0, maximum=10.0, value=3.5, step=0.1, label="Distilled Guidance Scale")
333
+ real_guidance = gr.Slider(minimum=1.0, maximum=10.0, value=4.5, step=0.1, label="Real Guidance Scale")
334
  width = gr.Slider(minimum=512, maximum=1024, value=768, step=64, label="Image Width")
335
  height = gr.Slider(minimum=512, maximum=1024, value=768, step=64, label="Image Height")
336
  pixel_offset = gr.Slider(minimum=0, maximum=32, value=8, step=1, label="Padding (Pixel Offset)")
 
352
 
353
  run_button.click(
354
  fn=run_diptych_prompting,
355
+ inputs=[input_image, subject_name, target_prompt, attn_enforce, ctrl_scale, width, height, pixel_offset, num_steps, guidance, real_guidance, seed, randomize_seed],
356
  outputs=output_image
357
  )
358