Fabrice-TIERCELIN commited on
Commit
b910ee3
·
verified ·
1 Parent(s): de06100

Unloading

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -1259,12 +1259,15 @@ def worker_video_end(input_video, end_frame, prompts, n_prompt, seed, batch, res
1259
  stream.output_queue.push(('progress', (None, '', make_progress_bar_html(0, 'CLIP Vision encoding ...'))))
1260
 
1261
  if not high_vram:
1262
- load_model_as_complete(image_encoder, vae, target_device=gpu)
1263
 
1264
  image_encoder_output = hf_clip_vision_encode(input_image_np, feature_extractor, image_encoder)
1265
 
1266
  # 20250507 pftq: Process end frame if provided
1267
  if end_frame is not None:
 
 
 
1268
  stream.output_queue.push(('progress', (None, '', make_progress_bar_html(0, 'End frame encoding ...'))))
1269
  end_latent, end_clip_embedding = image_encode(
1270
  end_frame, target_width=width, target_height=height, vae=vae,
@@ -1841,8 +1844,8 @@ with block:
1841
 
1842
  with gr.Accordion("Debug", open=False):
1843
  input_image_debug = gr.Image(type="numpy", label="Image Debug", height=320)
1844
- end_image_debug = gr.Image(type="numpy", label="End Image Debug", height=320)
1845
  input_video_debug = gr.Video(sources='upload', label="Input Video Debug", height=320)
 
1846
  prompt_debug = gr.Textbox(label="Prompt Debug", value='')
1847
  total_second_length_debug = gr.Slider(label="Additional Video Length to Generate (seconds) Debug", minimum=1, maximum=120, value=1, step=0.1)
1848
 
 
1259
  stream.output_queue.push(('progress', (None, '', make_progress_bar_html(0, 'CLIP Vision encoding ...'))))
1260
 
1261
  if not high_vram:
1262
+ load_model_as_complete(image_encoder, target_device=gpu)
1263
 
1264
  image_encoder_output = hf_clip_vision_encode(input_image_np, feature_extractor, image_encoder)
1265
 
1266
  # 20250507 pftq: Process end frame if provided
1267
  if end_frame is not None:
1268
+ if not high_vram:
1269
+ load_model_as_complete(vae, target_device=gpu)
1270
+
1271
  stream.output_queue.push(('progress', (None, '', make_progress_bar_html(0, 'End frame encoding ...'))))
1272
  end_latent, end_clip_embedding = image_encode(
1273
  end_frame, target_width=width, target_height=height, vae=vae,
 
1844
 
1845
  with gr.Accordion("Debug", open=False):
1846
  input_image_debug = gr.Image(type="numpy", label="Image Debug", height=320)
 
1847
  input_video_debug = gr.Video(sources='upload', label="Input Video Debug", height=320)
1848
+ end_image_debug = gr.Image(type="numpy", label="End Image Debug", height=320)
1849
  prompt_debug = gr.Textbox(label="Prompt Debug", value='')
1850
  total_second_length_debug = gr.Slider(label="Additional Video Length to Generate (seconds) Debug", minimum=1, maximum=120, value=1, step=0.1)
1851