Commit 0619df98 authored by AUTOMATIC1111's avatar AUTOMATIC1111

use shallow copy for #13535

parent 7cc96429
import collections
import copy
import os.path
import sys
import gc
......@@ -360,7 +359,7 @@ def load_model_weights(model, checkpoint_info: CheckpointInfo, state_dict, timer
if shared.opts.sd_checkpoint_cache > 0:
# 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)
timer.record("apply weights to model")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment