ComfyUI Node

AIHub Expose Latent

Receive a latent straight from the client

By otavanopisto·Created about a year ago·Updated 22 days ago· 7
AIHub Expose Latent
    • LATENT
    idexposed_latent
    labelLatent
    tooltip
    index0
    optionalfalse

    AIHub Expose Latent is the one expose node that never touches pixels. Everything else in this pack hands your workflow image tensors; this one receives a latent - the compressed LATENT tensor that ComfyUI's VAE encoder produces and samplers actually operate on - directly from the client. If your mental model of AIHub is "editor sends image, ComfyUI returns image," this is the node that skips the middleman on purpose.

    Why would you want that? Latents are cheaper than images and they're lossy by design, but more importantly some workflows are latents. The README's own example is step-by-step video generation with LTXV: intermediate results are far more reasonably stored and passed around as latent files than as decoded frames. An external app that speaks AIHub can hold onto the latent from one workflow run and feed it to the next workflow via this node - continuing a generation without round-tripping through an encoder.

    Mechanically it's the same story as the other exposes: the client uploads the latent file over the AIHub websocket (port 8111), the server drops it into a temp dir and injects the path as a hidden input, and the node hands you a ready-to-sample LATENT. Wire it into a KSampler's latent input, or into VAE decode at the end of the chain. Standalone in the web UI it has nothing to load - expected.

    The inputs that matter

    There really are only three you touch:

    • id - unique protocol identity for the field (alphanumeric, _, -).
    • label - what the client displays.
    • optional - set true and a missing latent returns a null tensor instead of aborting the run.

    Plus the ever-present index for sort order and tooltip. That's the entire surface area. This is a thin node by design: the actual heavy lifting - where the latent came from - is decided entirely by the client app, and this node is just the receiving dock.

    Install & gotchas

    Install the pack via ComfyUI Manager (search ComfyUI-aihub-workflow-exposer) or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/otavanopisto/ComfyUI-aihub-workflow-exposer
    

    then restart. No requirements.txt, no model downloads - the pack uses only ComfyUI's own bundled dependencies. The standard AIHub folders (ComfyUI/aihub/...) and a workflow controller with a unique id are expected before a client will talk to you.

    The practical gotcha is latent size and shape. A latent from a model with one VAE won't silently work in a sampler expecting another - the README is explicit that latents need to be stored and passed between workflows that share a model family. If your second workflow uses a different model, decode the latent to an image and pass that instead. And if the client sends a latent you can't use, optional won't save you - it only guards against a missing file, not a mismatched one.

    Categoryaihub/expose

    Inputs (5)

    NameTypeDefaultDescription
    idSTRINGexposed_latentA unique custom ID for this workflow.
    labelSTRINGLatentThis is the label that will appear in the field.
    tooltipSTRINGAn optional tooltip
    indexINT0This value is used for sorting the input fields when displaying; lower values will appear first.
    optionalBOOLEANfalseIf set to true, it will not raise an error if the latent is not found

    Outputs (1)

    NameTypeDescription
    LATENTLATENT