mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-10 06:10:50 +08:00
Compare commits
4 Commits
801b9bf9db
...
d66e5dd864
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d66e5dd864 | ||
|
|
a5acc660b2 | ||
|
|
5f10b70d9c | ||
|
|
afe05d68ee |
@ -306,7 +306,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…
Reference in New Issue
Block a user