dagloop5 commited on
Commit
84c1ca9
·
verified ·
1 Parent(s): 08370f7

Update h3_dpmpp_2s_ancestral.py

Browse files
Files changed (1) hide show
  1. h3_dpmpp_2s_ancestral.py +8 -2
h3_dpmpp_2s_ancestral.py CHANGED
@@ -377,7 +377,10 @@ class MiniMaxH3DPMppSdeStep(ModularPipelineBlocks):
377
  def __call__(self, components: MiniMaxH3ModularPipeline, block_state: BlockState, i: int, t: torch.Tensor):
378
  ncv = block_state.num_condition_video_rows
379
  nca = block_state.num_condition_audio_rows
380
- is_last_step = i == len(block_state.row_timestep_plan) - 1
 
 
 
381
  is_first_step = i == 0
382
 
383
  unique_timesteps, timestep_indices = block_state.row_timestep_plan[i]
@@ -497,7 +500,10 @@ class MiniMaxH3Seeds2Step(ModularPipelineBlocks):
497
  def __call__(self, components: MiniMaxH3ModularPipeline, block_state: BlockState, i: int, t: torch.Tensor):
498
  ncv = block_state.num_condition_video_rows
499
  nca = block_state.num_condition_audio_rows
500
- is_last_step = i == len(block_state.row_timestep_plan) - 1
 
 
 
501
  is_first_step = i == 0
502
 
503
  unique_timesteps, timestep_indices = block_state.row_timestep_plan[i]
 
377
  def __call__(self, components: MiniMaxH3ModularPipeline, block_state: BlockState, i: int, t: torch.Tensor):
378
  ncv = block_state.num_condition_video_rows
379
  nca = block_state.num_condition_audio_rows
380
+ # Not the loop's own last index — for a Staged Denoising slice that's this *stage's* last step, not
381
+ # necessarily the trajectory's. `components.scheduler.sigmas[i + 1] == 0.0` is the real end regardless
382
+ # of how many steps this particular call's schedule holds.
383
+ is_last_step = float(components.scheduler.sigmas[i + 1]) == 0.0
384
  is_first_step = i == 0
385
 
386
  unique_timesteps, timestep_indices = block_state.row_timestep_plan[i]
 
500
  def __call__(self, components: MiniMaxH3ModularPipeline, block_state: BlockState, i: int, t: torch.Tensor):
501
  ncv = block_state.num_condition_video_rows
502
  nca = block_state.num_condition_audio_rows
503
+ # Not the loop's own last index — for a Staged Denoising slice that's this *stage's* last step, not
504
+ # necessarily the trajectory's. `components.scheduler.sigmas[i + 1] == 0.0` is the real end regardless
505
+ # of how many steps this particular call's schedule holds.
506
+ is_last_step = float(components.scheduler.sigmas[i + 1]) == 0.0
507
  is_first_step = i == 0
508
 
509
  unique_timesteps, timestep_indices = block_state.row_timestep_plan[i]