Adaptive Projected Guidance: Shape mismatch fix

This commit is contained in:
TheToxin-git 2026-06-02 07:08:30 +00:00 committed by TheToxin
parent c96fcddb81
commit 1af8dcacac

View File

@ -73,7 +73,7 @@ class APG(io.ComfyNode):
guidance = cond - uncond guidance = cond - uncond
if momentum != 0: 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 running_avg = guidance
else: else:
running_avg = momentum * running_avg + guidance running_avg = momentum * running_avg + guidance