Skip to content

Commit

Permalink
Don't update dict if contiguous.
Browse files Browse the repository at this point in the history
  • Loading branch information
comfyanonymous committed Jul 3, 2024
1 parent 3f46362 commit 537f35c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion comfy/sd.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,10 @@ 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()
t = sd[k]
if not t.is_contiguous():
sd[k] = t.contiguous()

comfy.utils.save_torch_file(sd, output_path, metadata=metadata)

0 comments on commit 537f35c

Please sign in to comment.