signsur4739379373 commited on
Commit
b470073
·
verified ·
1 Parent(s): 45056bf

duration max 25, steps_per_chunk param

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -921,6 +921,7 @@ def generate_chunk_handler(
921
  ipnc_svicamera_l: float = 100.0,
922
  # chunking params
923
  session_id: str = "",
 
924
  chunk_step: str = "0",
925
  progress=gr.Progress(track_tqdm=True),
926
  ):
@@ -952,7 +953,7 @@ def generate_chunk_handler(
952
  gen_w, gen_h = _compute_dims(str(aspect_ratio), image_paths[0], bool(use_ref_aspect))
953
  n_frames = max(1, round(float(duration_secs) * int(base_fps)))
954
  steps = int(num_steps)
955
- STEPS_PER_CHUNK = 2
956
  chunk_idx = int(float(chunk_step or 0))
957
  step_start = chunk_idx * STEPS_PER_CHUNK
958
  step_end = min(step_start + STEPS_PER_CHUNK, steps)
@@ -992,7 +993,7 @@ def generate_chunk_handler(
992
  sampler_id = "57" if use_high else "58"
993
 
994
  # Inject chunk nodes: save/load latent, save/load conditioning
995
- # Batch multiple steps per chunk (STEPS_PER_CHUNK=2 for short videos)
996
  api_wf[sampler_id]["inputs"]["steps"] = steps
997
  api_wf[sampler_id]["inputs"]["start_at_step"] = step_start
998
  api_wf[sampler_id]["inputs"]["end_at_step"] = step_end
@@ -1258,7 +1259,7 @@ with gr.Blocks(title="Bernini-R Wan 2.2 R2V Lightning") as demo:
1258
  gpu_budget = gr.Slider(0, 540, value=0, step=10, label="ZeroGPU budget (0=auto)")
1259
  with gr.Row():
1260
  num_steps = gr.Slider(4, 20, value=6, step=1, label="Steps")
1261
- duration_secs = gr.Slider(1, 15, value=5, step=0.5, label="Duration (s)")
1262
  sampler_name = gr.Dropdown(choices=["uni_pc", "lcm"], value="lcm", label="Sampler")
1263
  base_fps = gr.Number(value=15, precision=0, label="Combine FPS")
1264
  rife_mode = gr.Dropdown(
@@ -1293,6 +1294,7 @@ with gr.Blocks(title="Bernini-R Wan 2.2 R2V Lightning") as demo:
1293
  )
1294
 
1295
  _chunk_session_id = gr.Textbox(visible=False, value="")
 
1296
  _chunk_step_txt = gr.Textbox(visible=False, value="0")
1297
  _chunk_btn = gr.Button(visible=False)
1298
  _chunk_btn.click(
@@ -1309,7 +1311,7 @@ with gr.Blocks(title="Bernini-R Wan 2.2 R2V Lightning") as demo:
1309
  ipnc_wamu_l, ipnc_dreamly_l,
1310
  s_svicamera_h, s_svicamera_l,
1311
  ipnc_svicamera_h, ipnc_svicamera_l,
1312
- _chunk_session_id, _chunk_step_txt,
1313
  ],
1314
  outputs=[output_video, output_status],
1315
  api_name="generate_chunk",
 
921
  ipnc_svicamera_l: float = 100.0,
922
  # chunking params
923
  session_id: str = "",
924
+ steps_per_chunk: str = "2",
925
  chunk_step: str = "0",
926
  progress=gr.Progress(track_tqdm=True),
927
  ):
 
953
  gen_w, gen_h = _compute_dims(str(aspect_ratio), image_paths[0], bool(use_ref_aspect))
954
  n_frames = max(1, round(float(duration_secs) * int(base_fps)))
955
  steps = int(num_steps)
956
+ STEPS_PER_CHUNK = max(1, int(float(steps_per_chunk or 2)))
957
  chunk_idx = int(float(chunk_step or 0))
958
  step_start = chunk_idx * STEPS_PER_CHUNK
959
  step_end = min(step_start + STEPS_PER_CHUNK, steps)
 
993
  sampler_id = "57" if use_high else "58"
994
 
995
  # Inject chunk nodes: save/load latent, save/load conditioning
996
+ # Batch multiple steps per chunk (set by the caller)
997
  api_wf[sampler_id]["inputs"]["steps"] = steps
998
  api_wf[sampler_id]["inputs"]["start_at_step"] = step_start
999
  api_wf[sampler_id]["inputs"]["end_at_step"] = step_end
 
1259
  gpu_budget = gr.Slider(0, 540, value=0, step=10, label="ZeroGPU budget (0=auto)")
1260
  with gr.Row():
1261
  num_steps = gr.Slider(4, 20, value=6, step=1, label="Steps")
1262
+ duration_secs = gr.Slider(1, 25, value=5, step=0.5, label="Duration (s)")
1263
  sampler_name = gr.Dropdown(choices=["uni_pc", "lcm"], value="lcm", label="Sampler")
1264
  base_fps = gr.Number(value=15, precision=0, label="Combine FPS")
1265
  rife_mode = gr.Dropdown(
 
1294
  )
1295
 
1296
  _chunk_session_id = gr.Textbox(visible=False, value="")
1297
+ _chunk_spc_txt = gr.Textbox(visible=False, value="2")
1298
  _chunk_step_txt = gr.Textbox(visible=False, value="0")
1299
  _chunk_btn = gr.Button(visible=False)
1300
  _chunk_btn.click(
 
1311
  ipnc_wamu_l, ipnc_dreamly_l,
1312
  s_svicamera_h, s_svicamera_l,
1313
  ipnc_svicamera_h, ipnc_svicamera_l,
1314
+ _chunk_session_id, _chunk_spc_txt, _chunk_step_txt,
1315
  ],
1316
  outputs=[output_video, output_status],
1317
  api_name="generate_chunk",