diff --git a/latent_node.py b/latent_node.py index 6b19b2e..160291d 100644 --- a/latent_node.py +++ b/latent_node.py @@ -77,11 +77,17 @@ class LoadLatentAbsolute: def load(self, path): path = os.path.expanduser(path) - samples = safetensors.torch.load_file(path, device="cpu") + raw = safetensors.torch.load_file(path, device="cpu") with safetensors.safe_open(path, framework="pt") as f: meta = f.metadata() + # ComfyUI's built-in save latent uses key "latent_tensor" → remap to "samples" + if "latent_tensor" in raw and "samples" not in raw: + raw["samples"] = raw.pop("latent_tensor") + + samples = dict(raw) + # Restore original devices if meta and "devices" in meta: devices = json.loads(meta["devices"])