From 6db2d113ba696ed5268a082cad543279eede2fba Mon Sep 17 00:00:00 2001 From: kijai <40791699+kijai@users.noreply.github.com> Date: Wed, 20 Aug 2025 17:12:04 +0300 Subject: [PATCH] Update nodes.py --- nodes.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/nodes.py b/nodes.py index 570d3dd..ef89013 100644 --- a/nodes.py +++ b/nodes.py @@ -3050,7 +3050,7 @@ class WanVideoSampler: is_first_clip = True arrive_last_frame = False cur_motion_frames_num = 1 - audio_start_idx = iteration_count = 0 + audio_start_idx = iteration_count = step_iteration_count= 0 audio_end_idx = audio_start_idx + clip_length indices = (torch.arange(4 + 1) - 2) * 1 current_condframe_index = 0 @@ -3273,10 +3273,12 @@ class WanVideoSampler: cache_state=self.cache_state, multitalk_audio_embeds=audio_embs) sampling_pbar.update(1) - + if callback is not None: callback_latent = (latent_model_input.to(device) - noise_pred.to(device) * t.to(device) / 1000).detach().permute(1,0,2,3) - callback(iteration_count, callback_latent, None, estimated_iterations) + callback(step_iteration_count, callback_latent, None, estimated_iterations*(len(timesteps)-1)) + + step_iteration_count += 1 # update latent if scheduler == "multitalk":