fffiloni commited on
Commit
4c0a288
·
verified ·
1 Parent(s): e237549

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -413,6 +413,14 @@ def infer_compo(style_description, ref_style_file, caption, ref_sub_file):
413
  # Reset the state after inference, regardless of success or failure
414
  reset_compo_inference_state()
415
 
 
 
 
 
 
 
 
 
416
  import gradio as gr
417
 
418
  with gr.Blocks() as demo:
@@ -455,8 +463,8 @@ with gr.Blocks() as demo:
455
  )
456
  '''
457
  submit_btn.click(
458
- fn = infer_compo,
459
- inputs = [style_description, style_reference_image, subject_prompt, subject_reference],
460
  outputs = [output_image]
461
  )
462
 
 
413
  # Reset the state after inference, regardless of success or failure
414
  reset_compo_inference_state()
415
 
416
+ def run(style_description, style_reference_image, subject_prompt, subject_reference, use_subject_ref):
417
+ result = None
418
+ if use_subject_ref is True:
419
+ result = infer_compo(style_description, style_reference_image, subject_prompt, subject_reference)
420
+ else:
421
+ result = infer(style_reference_image, style_description, subject_prompt)
422
+ return result
423
+
424
  import gradio as gr
425
 
426
  with gr.Blocks() as demo:
 
463
  )
464
  '''
465
  submit_btn.click(
466
+ fn = run,
467
+ inputs = [style_description, style_reference_image, subject_prompt, subject_reference, use_subject_ref],
468
  outputs = [output_image]
469
  )
470