fffiloni commited on
Commit
e2461d2
1 Parent(s): fe3f83a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -182,9 +182,10 @@ def infer(ref_style_file, style_description, caption, progress):
182
  lam_style=1, lam_txt_alignment=1.0,
183
  use_ddim_sampler=True,
184
  )
185
- for i, (sampled_c, _, _) in enumerate(sampling_c, 1):
186
- if i % 5 == 0: # Update progress every 5 steps
187
- progress(0.4 + 0.3 * (i / extras.sampling_configs['timesteps']), f"Stage C reverse process: step {i}/{extras.sampling_configs['timesteps']}")
 
188
  sampled_c = sampled_c
189
 
190
  progress(0.7, "Starting Stage B reverse process")
@@ -347,7 +348,7 @@ def infer_compo(style_description, ref_style_file, caption, ref_sub_file, progre
347
 
348
  def run(style_reference_image, style_description, subject_prompt, subject_reference, use_subject_ref):
349
  result = None
350
- progress = gr.Progress()
351
  if use_subject_ref is True:
352
  result = infer_compo(style_description, style_reference_image, subject_prompt, subject_reference, progress)
353
  else:
 
182
  lam_style=1, lam_txt_alignment=1.0,
183
  use_ddim_sampler=True,
184
  )
185
+ for (sampled_c, _, _) in progress.tqdm(sampling_c, total=extras.sampling_configs['timesteps']):
186
+ #for i, (sampled_c, _, _) in enumerate(sampling_c, 1):
187
+ # if i % 5 == 0: # Update progress every 5 steps
188
+ # progress(0.4 + 0.3 * (i / extras.sampling_configs['timesteps']), f"Stage C reverse process: step {i}/{extras.sampling_configs['timesteps']}")
189
  sampled_c = sampled_c
190
 
191
  progress(0.7, "Starting Stage B reverse process")
 
348
 
349
  def run(style_reference_image, style_description, subject_prompt, subject_reference, use_subject_ref):
350
  result = None
351
+ progress = gr.Progress(track_tqdm=True)
352
  if use_subject_ref is True:
353
  result = infer_compo(style_description, style_reference_image, subject_prompt, subject_reference, progress)
354
  else: