aiqtech commited on
Commit
ad93d00
·
verified ·
1 Parent(s): e9a878b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -176,7 +176,7 @@ def generate_pose_transfer(
176
 
177
  # Enhance pose if requested
178
  if enhance_pose:
179
- pose_image = extract_pose_edges(pose_image)
180
 
181
  # Prepare concatenated input with fixed size
182
  concatenated_input = prepare_images_for_kontext(reference_image, pose_image, target_size=512)
@@ -231,7 +231,7 @@ def generate_pose_transfer(
231
  if has_lora:
232
  try:
233
  # Increase LoRA strength for pose control
234
- actual_lora_scale = lora_scale * 1.0 # Boost LoRA influence
235
  pipe.set_adapters(["refcontrol"], adapter_weights=[actual_lora_scale])
236
  print(f"LoRA adapter set with boosted strength: {actual_lora_scale}")
237
  except Exception as e:
@@ -562,13 +562,14 @@ with gr.Blocks(css=css, theme=gr.themes.Soft()) as demo:
562
  guidance_scale,
563
  num_inference_steps,
564
  lora_scale,
 
565
  enhance_pose
566
  ],
567
  outputs=[result_image, seed_used, concat_preview]
568
  )
569
 
570
  extract_btn.click(
571
- fn=extract_pose_edges,
572
  inputs=[extract_source],
573
  outputs=[pose_image]
574
  )
@@ -580,7 +581,7 @@ with gr.Blocks(css=css, theme=gr.themes.Soft()) as demo:
580
  )
581
 
582
  reuse_pose_btn.click(
583
- fn=extract_pose_edges,
584
  inputs=[result_image],
585
  outputs=[pose_image]
586
  )
 
176
 
177
  # Enhance pose if requested
178
  if enhance_pose:
179
+ pose_image = process_pose_for_control(pose_image)
180
 
181
  # Prepare concatenated input with fixed size
182
  concatenated_input = prepare_images_for_kontext(reference_image, pose_image, target_size=512)
 
231
  if has_lora:
232
  try:
233
  # Increase LoRA strength for pose control
234
+ actual_lora_scale = lora_scale * 1.5 # Boost LoRA influence
235
  pipe.set_adapters(["refcontrol"], adapter_weights=[actual_lora_scale])
236
  print(f"LoRA adapter set with boosted strength: {actual_lora_scale}")
237
  except Exception as e:
 
562
  guidance_scale,
563
  num_inference_steps,
564
  lora_scale,
565
+ controlnet_scale,
566
  enhance_pose
567
  ],
568
  outputs=[result_image, seed_used, concat_preview]
569
  )
570
 
571
  extract_btn.click(
572
+ fn=process_pose_for_control,
573
  inputs=[extract_source],
574
  outputs=[pose_image]
575
  )
 
581
  )
582
 
583
  reuse_pose_btn.click(
584
+ fn=process_pose_for_control,
585
  inputs=[result_image],
586
  outputs=[pose_image]
587
  )