From 7e290c67bff1f906cdab84523018573f6c9d4d7f Mon Sep 17 00:00:00 2001 From: kijai <40791699+kijai@users.noreply.github.com> Date: Mon, 28 Jul 2025 23:16:06 +0300 Subject: [PATCH] Fix comfy progress bar when not doing full steps --- nodes.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nodes.py b/nodes.py index 9162256..327fe6a 100644 --- a/nodes.py +++ b/nodes.py @@ -2222,7 +2222,7 @@ class WanVideoSampler: from latent_preview import prepare_callback else: from .latent_preview import prepare_callback #custom for tiny VAE previews - callback = prepare_callback(patcher, steps) + callback = prepare_callback(patcher, len(timesteps)) log.info(f"Sampling {(latent_video_length-1) * 4 + 1} frames at {latent.shape[3]*vae_upscale_factor}x{latent.shape[2]*vae_upscale_factor} with {steps} steps") @@ -2860,14 +2860,14 @@ class WanVideoSampler: callback_latent = (latent_model_input[:,:-phantom_latents.shape[1]].to(device) - noise_pred[:,:-phantom_latents.shape[1]].to(device) * t.to(device) / 1000).detach().permute(1,0,2,3) else: callback_latent = (latent_model_input.to(device) - noise_pred.to(device) * t.to(device) / 1000).detach().permute(1,0,2,3) - callback(idx, callback_latent, None, steps) + callback(idx, callback_latent, None, len(timesteps)) else: pbar.update(1) del latent_model_input, timestep else: if callback is not None: callback_latent = (zt_tgt.to(device) - vt_tgt.to(device) * t.to(device) / 1000).detach().permute(1,0,2,3) - callback(idx, callback_latent, None, steps) + callback(idx, callback_latent, None, len(timesteps)) else: pbar.update(1)