From 34b4a0841a9421f5b3ec4c98a3470ed6669aab3d Mon Sep 17 00:00:00 2001 From: chaObserv <154517000+chaObserv@users.noreply.github.com> Date: Sat, 6 Sep 2025 21:14:05 +0800 Subject: [PATCH] Only apply channels_last for 4d latent model --- comfy/model_base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comfy/model_base.py b/comfy/model_base.py index 39a3344bc..874d8807f 100644 --- a/comfy/model_base.py +++ b/comfy/model_base.py @@ -136,7 +136,7 @@ class BaseModel(torch.nn.Module): else: operations = model_config.custom_operations self.diffusion_model = unet_model(**unet_config, device=device, operations=operations) - if comfy.model_management.force_channels_last(): + if self.latent_format.latent_dimensions == 2 and comfy.model_management.force_channels_last(): self.diffusion_model.to(memory_format=torch.channels_last) logging.debug("using channels last mode for diffusion model") logging.info("model weight dtype {}, manual cast: {}".format(self.get_dtype(), self.manual_cast_dtype))