Nodes/Eden.art nodesuite/Load_Embeddings_From_Folder
ComfyUI Node Runs on cloud

Load_Embeddings_From_Folder

Your Style Library, Back on the Graph

By edenartlabΒ·Created 3 years agoΒ·Updated 6 months agoΒ· 119
Load_Embeddings_From_Folder
    • embeddings
    • avg_embed_norm
    β—„directory_patheden_images/xander_bigβ–Ί

    If you've ever re-encoded the same stack of reference images through an IP-Adapter encoder every single run, you've wasted a lot of GPU time. Load_Embeddings_From_Folder is the reload side of the fix: point it at a folder of saved .pth embedding files and it stacks them into one EMBEDS tensor you can feed straight into a mixing node or an IP-Adapter.

    It's a file loader with almost no knobs. One input - directory_path, a string, default "eden_images/xander_big" - and it scans that directory for every .pth file, torch.loads each one, and stacks them into a single tensor. Two outputs come out:

    • embeddings - the EMBEDS stack, one per saved file. Straight into Random_Style_Mixture or any IP-Adapter embedding input.
    • avg_embed_norm - the mean vector norm across the stack, a FLOAT. That's not incidental; the mixing nodes in this pack use it as the renormalization target so random blends land at a consistent "loudness."

    The default path is the giveaway that this is an internal Eden.art tool surfaced publicly - "xander_big" is somebody's dataset folder, not a convention you need to honor. Set it to your own cache.

    Why the pairing works

    The full loop is: embed a batch of reference images once, save each embedding as a per-image .pth file with SavePosEmbeds, then later Load_Embeddings_From_Folder the whole library and start mixing. You pay the encoder cost once and reuse the vectors forever. It's the same trick as caching anything you compute repeatedly - and for style exploration, where you're sampling dozens of blends from one reference set, it turns a minutes-long re-encode into a file read.

    A small caution from the IP-Adapter panel in the KB: embeddings are baked against a specific image encoder. Cache them with one CLIP-vision variant and they still load fine against another, but the geometry won't be quite right. Keep the encoder consistent across the save/load pair.

    Installing it

    Part of the Eden.art nodesuite. ComfyUI Manager β†’ search "Eden" β†’ install, or:

    cd ComfyUI/custom_nodes/
    git clone https://github.com/edenartlab/eden_comfy_pipelines.git
    cd eden_comfy_pipelines
    pip install -r requirements.txt
    

    Restart, and it's under Eden 🌱.

    Common issues

    Two real ones. First, the node loads every .pth in the folder and doesn't filter - if your cache mixes different embedding shapes, the torch.stack dies with a shape error. Keep one encoder's output per folder. Second, a file that fails to load is just skipped with a console message rather than an error, so you can silently end up with fewer embeddings than you expected. If your mixing output looks thinner than it should, count the .pth files and check the console for "Failed to load" lines.

    CategoryEden 🌱

    Inputs (1)

    NameTypeDefaultDescription
    directory_pathSTRINGeden_images/xander_bigβ€”

    Outputs (2)

    NameTypeDescription
    embeddingsEMBEDSβ€”
    avg_embed_normFLOATβ€”