Nodes/comfyui_bmad_nodes/ExtendLatentList
ComfyUI Node Runs on cloud

ExtendLatentList

Merging Latent Batches Without Re-Encoding a Thing

By bmad4ever·Created 3 years ago·Updated 9 months ago· 70
ExtendLatentList
    • LATENT
    inputs_len2

    ExtendLatentList joins multiple LATENT lists into one, in order, with zero re-encoding. It's the list-family node from bmad4ever's pack that you reach for when you've got more than one source of latents and one sampler to feed.

    Why you'd reach for it

    Latents are expensive - you encode an image into latent space once and reuse it. If your workflow produces latents from several branches (different VAE-encoded references, multiple Repeat Into Grid outputs, a mix of text-to-latent and image-to-latent paths), ExtendLatentList is where they converge so a single KSampler pass or latent-batch operation sees them all.

    It's also the practical fix for a common annoyance: latent batch sizes don't always cooperate with the nodes downstream. Merging lists of latents (rather than trying to force one node to emit everything) lets you keep each source tidy and combine only at the point of consumption.

    How it works

    Identical mechanics to the rest of the family. The inputs_len widget (default 2, up to 32) sets how many latent-list inputs exist; after changing it you must right-click → "update Inputs" (the README's ❔ marker). Each input is a list of LATENT dicts, appended in order onto the output.

    Remember that a single LATENT output from a VAE Encode node is usually a batch, not a list. If a connection won't take, use the pack's ToLatentList to wrap a single latent, or check whether the upstream node actually outputs a list (the [ ] on the socket tells you).

    Install

    One install for the whole pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/bmad4ever/comfyui_bmad_nodes
    

    then restart ComfyUI. Manager users search "comfyui_bmad_nodes"; the pack's Python requirements install automatically and don't matter for this pure-Python node.

    Common issues

    • Sockets missing after changing inputs_len. Right-click → "update Inputs" - the family-wide first stumble.
    • Latent batch vs latent list. A sampler's LATENT output is a tensor batch; convert with ToLatentList where a list is required.
    • Order matters for batch-sensitive ops. Latents come out top-to-bottom; if you're pairing latents with images by index downstream, keep the sources deliberately ordered.

    Nothing clever about it, and that's a compliment. It turns "I have latents in two places" from a graph problem into a one-node fix.

    CategoryBmad/Lists/Extend

    Inputs (1)

    NameTypeDefaultDescription
    inputs_lenINT20–32

    Outputs (1)

    NameTypeDescription
    LATENTLATENT