mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-03-15 14:09:36 +00:00
Remove unsafe embedding load for very old pytorch.
This commit is contained in:
parent
2feb8d0b77
commit
cba58fff0b
@ -388,13 +388,10 @@ def load_embed(embedding_name, embedding_directory, embedding_size, embed_key=No
|
|||||||
import safetensors.torch
|
import safetensors.torch
|
||||||
embed = safetensors.torch.load_file(embed_path, device="cpu")
|
embed = safetensors.torch.load_file(embed_path, device="cpu")
|
||||||
else:
|
else:
|
||||||
if 'weights_only' in torch.load.__code__.co_varnames:
|
|
||||||
try:
|
try:
|
||||||
embed = torch.load(embed_path, weights_only=True, map_location="cpu")
|
embed = torch.load(embed_path, weights_only=True, map_location="cpu")
|
||||||
except:
|
except:
|
||||||
embed_out = safe_load_embed_zip(embed_path)
|
embed_out = safe_load_embed_zip(embed_path)
|
||||||
else:
|
|
||||||
embed = torch.load(embed_path, map_location="cpu")
|
|
||||||
except Exception:
|
except Exception:
|
||||||
logging.warning("{}\n\nerror loading embedding, skipping loading: {}".format(traceback.format_exc(), embedding_name))
|
logging.warning("{}\n\nerror loading embedding, skipping loading: {}".format(traceback.format_exc(), embedding_name))
|
||||||
return None
|
return None
|
||||||
|
Loading…
Reference in New Issue
Block a user