Nodes/rgthree's ComfyUI Nodes/Context Merge (rgthree)
ComfyUI Node Runs on cloud

Context Merge (rgthree)

Context Merge (rgthree)

By rgthree·Created 3 years ago·Updated 13 days ago· 3,294
Context Merge (rgthree)
    • CONTEXT
    • MODEL
    • CLIP
    • VAE
    • POSITIVE
    • NEGATIVE
    • LATENT
    • IMAGE
    • SEED

    Context Merge combines two or more Context bundles into one. Where the plain Context node builds a bundle from loose inputs, and Context Switch picks one bundle out of several, Context Merge overlays them - it takes multiple context wires and produces a single context where later inputs fill in or override the fields of earlier ones. It's the node you reach for when two separate parts of your graph each carry half of what you need on one wire, and you want to stitch them together.

    Why you'd reach for it

    Context nodes are all about carrying a bundle of connections down one tidy wire. But sometimes your workflow splits and the pieces you care about end up on different context streams: one branch has your model and clip sorted out, another has produced the latent and conditioning you want to pair with them. Rather than exploding both bundles and hand-rewiring the individual pieces, Context Merge lets you overlay one context onto another and get a single, complete bundle back out.

    Think of it as layering: pass in a base context, then merge a second one whose set fields win where they're present and whose empty fields leave the base showing through. The result is a merged bundle you carry onward as usual. It's a niche node - most workflows never need it - but when you're doing something structurally branchy, it's the clean way to recombine.

    Inputs and outputs

    The inputs are dynamic - you connect two or more context wires and the node takes them in order, so there's no fixed named-input list. Order matters: later contexts overlay earlier ones, so put the bundle whose values should win last.

    The output is the familiar full context spread: a single CONTEXT wire (RGTHREE_CONTEXT) carrying the merged bundle, plus every field exploded out - MODEL, CLIP, VAE, POSITIVE, NEGATIVE, LATENT, IMAGE, and SEED - so you can carry the tidy wire onward or tap any single piece directly. Because it emits standard RGTHREE_CONTEXT, the merged result flows into any other context node, switch, or exploded output exactly like a bundle built the normal way.

    Installing it

    Context Merge ships in rgthree-comfy. Install through ComfyUI Manager (search rgthree's ComfyUI Nodes) or clone the repo:

    cd ComfyUI/custom_nodes
    git clone https://github.com/rgthree/rgthree-comfy.git
    

    Restart ComfyUI. No models to download, no heavy dependencies - the pack is all graph and UI code.

    Common issues

    The concept to keep straight is merge vs. switch. They sound similar and they're not. Context Switch picks one whole bundle (the first non-empty one) and ignores the rest - that's for branching. Context Merge combines all of them into one, overlaying field by field - that's for recombining. If you wanted a fork and reached for Merge, you'll get an unexpected blend; if you wanted a blend and reached for Switch, you'll lose everything but one branch.

    Second, mind the overlay order. Later inputs win where they have a value, so if a field is coming out "wrong," check which context is later in the merge and whether it's setting that field. An empty field in the later context lets the earlier one show through - that's the intended behavior, but it can surprise you if you assumed the last bundle was authoritative for everything.

    And the pack-wide caveat: if the node renders oddly, check whether ComfyUI's Nodes 2.0 frontend is enabled. The Vue rewrite broke several rgthree nodes and the standing workaround is to leave it off.

    Categoryrgthree

    Inputs (0)

    No inputs

    Outputs (9)

    NameTypeDescription
    CONTEXTRGTHREE_CONTEXT
    MODELMODEL
    CLIPCLIP
    VAEVAE
    POSITIVECONDITIONING
    NEGATIVECONDITIONING
    LATENTLATENT
    IMAGEIMAGE
    SEEDINT