1
mirror of https://github.com/comfyanonymous/ComfyUI.git synced 2025-08-02 23:14:49 +08:00

Fix some issues.

This commit is contained in:
comfyanonymous
2024-08-03 15:06:40 -04:00
parent 1e68002b87
commit 2ba5cc8b86
3 changed files with 9 additions and 3 deletions

View File

@@ -51,6 +51,9 @@ def weight_dtype(sd, prefix=""):
w = sd[k]
dtypes[w.dtype] = dtypes.get(w.dtype, 0) + 1
if len(dtypes) == 0:
return None
return max(dtypes, key=dtypes.get)
def state_dict_key_replace(state_dict, keys_to_replace):