mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-03-16 14:27:06 +08:00
Merge a5acc660b28b29d4d0f555e75726a00e90f8f47f into 650e716dda0a966a083f0efe299f3e83336f920e
This commit is contained in:
commit
1fd59902dc
@ -305,7 +305,10 @@ class BaseModel(torch.nn.Module):
|
||||
to_load[k[len(unet_prefix):]] = sd.pop(k)
|
||||
|
||||
to_load = self.model_config.process_unet_state_dict(to_load)
|
||||
m, u = self.diffusion_model.load_state_dict(to_load, strict=False)
|
||||
# assign=True will reuse the tensor storage in state dict, this will avoid copy and saving CPU memory
|
||||
# when loading large models with mmap.
|
||||
delay_copy_with_assign = utils.MMAP_TORCH_FILES or not utils.DISABLE_MMAP
|
||||
m, u = self.diffusion_model.load_state_dict(to_load, strict=False, assign=delay_copy_with_assign)
|
||||
if len(m) > 0:
|
||||
logging.warning("unet missing: {}".format(m))
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user