Fix issue when saving advanced prompt embeds. No such file or directory error

This commit is contained in:
Jaret Burkett 2026-04-16 12:22:56 -06:00
parent 0792352dab
commit 2faba22b46
1 changed files with 2 additions and 0 deletions

View File

@ -1,3 +1,4 @@
import os
from safetensors.torch import load_file, save_file
@ -115,6 +116,7 @@ class AdvancedPromptEmbeds:
f"Cannot save key {key!r}: expected list of length 1, got {len(value)}"
)
data[key] = value[0]
os.makedirs(os.path.dirname(path), exist_ok=True)
save_file(data, path, metadata=metadata)
@classmethod