Fix potential shape missmatch in CFGRenormLongCatImage

This commit is contained in:
Talmaj Marinc 2026-02-23 22:00:59 +01:00
parent 87d0a15307
commit 4fe507248c

View File

@ -1,7 +1,11 @@
import logging
import torch
from typing_extensions import override
from comfy_api.latest import ComfyExtension, io
logger = logging.getLogger(__name__)
class CLIPTextEncodeLongCatImage(io.ComfyNode):
@classmethod
@ -61,6 +65,10 @@ class CFGRenormLongCatImage(io.ComfyNode):
B, C, H, W = denoised.shape
ps = 2
if H % ps != 0 or W % ps != 0:
logger.warning(f"CFG Renorm: incompatible shape {H}x{W}, skipping renorm")
return denoised
noise = x - denoised
noise_cond = x - cond_denoised