Update nodes.py

This commit is contained in:
kijai
2025-03-25 21:30:44 +02:00
parent d40b28bad6
commit d67c96e4b5
+2 -1
View File
@@ -2055,6 +2055,8 @@ class WanVideoSampler:
noise_pred_uncond=noise_pred_uncond[0].to(intermediate_device)
noise_pred_text = noise_pred_cond
#https://github.com/WeichenFan/CFG-Zero-star/
if use_cfg_zero_star:
positive_flat = noise_pred_text.view(batch_size, -1)
negative_flat = noise_pred_uncond.view(batch_size, -1)
@@ -2062,7 +2064,6 @@ class WanVideoSampler:
alpha = optimized_scale(positive_flat,negative_flat)
alpha = alpha.view(batch_size, 1, 1, 1)
if (idx <= zero_star_steps) and use_zero_init:
noise_pred = noise_pred_text*0.
else: