Browse Source

change state dict comparison to ref compare

Jabasukuriputo Wang 1 year ago
parent
commit
895456c4a2
1 changed files with 1 additions and 1 deletions
  1. 1 1
      modules/sd_disable_initialization.py

+ 1 - 1
modules/sd_disable_initialization.py

@@ -215,7 +215,7 @@ class LoadStateDictOnMeta(ReplaceHelper):
             would be on the meta device.
             """
 
-            if state_dict == sd:
+            if state_dict is sd:
                 state_dict = {k: v.to(device="meta", dtype=v.dtype) for k, v in state_dict.items()}
 
             original(module, state_dict, strict=strict)