From 1af8dcacac9a470375366e927675f149d8cfd90a Mon Sep 17 00:00:00 2001 From: TheToxin-git <79914682+TheToxin-git@users.noreply.github.com> Date: Tue, 2 Jun 2026 07:08:30 +0000 Subject: [PATCH] Adaptive Projected Guidance: Shape mismatch fix --- comfy_extras/nodes_apg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comfy_extras/nodes_apg.py b/comfy_extras/nodes_apg.py index 4a352038a..fd8e13ff5 100644 --- a/comfy_extras/nodes_apg.py +++ b/comfy_extras/nodes_apg.py @@ -73,7 +73,7 @@ class APG(io.ComfyNode): guidance = cond - uncond if momentum != 0: - if not torch.is_tensor(running_avg): + if not torch.is_tensor(running_avg) or (running_avg.shape != guidance.shape): running_avg = guidance else: running_avg = momentum * running_avg + guidance