mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-02-07 06:02:53 +08:00
use shallow copy for #13535
This commit is contained in:
parent
7cc96429f2
commit
0619df9835
@ -1,5 +1,4 @@
|
|||||||
import collections
|
import collections
|
||||||
import copy
|
|
||||||
import os.path
|
import os.path
|
||||||
import sys
|
import sys
|
||||||
import gc
|
import gc
|
||||||
@ -360,7 +359,7 @@ def load_model_weights(model, checkpoint_info: CheckpointInfo, state_dict, timer
|
|||||||
|
|
||||||
if shared.opts.sd_checkpoint_cache > 0:
|
if shared.opts.sd_checkpoint_cache > 0:
|
||||||
# cache newly loaded model
|
# cache newly loaded model
|
||||||
checkpoints_loaded[checkpoint_info] = copy.deepcopy(state_dict)
|
checkpoints_loaded[checkpoint_info] = state_dict.copy()
|
||||||
|
|
||||||
model.load_state_dict(state_dict, strict=False)
|
model.load_state_dict(state_dict, strict=False)
|
||||||
timer.record("apply weights to model")
|
timer.record("apply weights to model")
|
||||||
|
Loading…
Reference in New Issue
Block a user