From 3f46362d227fa0ca578a69aeb194951b9f87aea0 Mon Sep 17 00:00:00 2001 From: "Alex \"mcmonkey\" Goodwin" <4000772+mcmonkey4eva@users.noreply.github.com> Date: Tue, 2 Jul 2024 17:16:33 -0700 Subject: [PATCH] fix non-contiguous tensor saving (from channels-last) (#3932) --- comfy/sd.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/comfy/sd.py b/comfy/sd.py index dda0887ba69..b28bfe35851 100644 --- a/comfy/sd.py +++ b/comfy/sd.py @@ -627,5 +627,7 @@ def save_checkpoint(output_path, model, clip=None, vae=None, clip_vision=None, m sd = model.model.state_dict_for_saving(clip_sd, vae.get_sd(), clip_vision_sd) for k in extra_keys: sd[k] = extra_keys[k] + for k in sd: + sd[k] = sd[k].contiguous() comfy.utils.save_torch_file(sd, output_path, metadata=metadata)