Nodes/Mithril-Nodes for ComfyUI/Ⓜ️ Set Multiplexer Gateway
ComfyUI Node

Ⓜ️ Set Multiplexer Gateway

Set Multiplexer Gateway is a named exit point

By MithrilMan·Created about a year ago·Updated about a year ago· 0
Ⓜ️ Set Multiplexer Gateway
  • data
    gateway_nameoutput_1

    The Set Multiplexer Gateway is the simplest node in the gateways duo, and on purpose: it's a sink that takes any data, gives it a name, and stashes it in a named store. That's it. No output, no processing - it's the exit point half of a two-node remote-control system, the other half being Get Multiplexer Gateway, which retrieves the value by name somewhere else in the graph.

    Why bother? The pitch is graph tidiness. Instead of running one long unbroken wire from where a value is produced to where it's consumed - across half the canvas, through a reroute tangle - you drop a Set Gateway at the source, name it output_1 or portrait_model, and read it back anywhere with a Get node. Complex workflows get visibly cleaner, and the names read like documentation.

    The two inputs

    • gateway_name - string, default output_1. This is the key everything hangs on. The Get node's dropdown is populated by scanning the graph for these exact names, so keep them consistent and typo-free.
    • data - *, any type. Whatever you want to make retrievable.

    When it runs it writes data into the pack's in-process gateway store under that name and reports "Set: <name>" in the UI. If you're using a Mithril Multiplexer, you don't even have to wire this by hand - right-click the multiplexer's output and pick "Add Set Gateway," and it spawns one connected to the output for you.

    The trap: ordering and lifetime

    Two things will bite you, and they're both grounded in how the store actually works:

    1. It's a Python global in the ComfyUI process. The data lives in a shared dictionary from when the Set node executes until you restart. That means the matching Get node must run after this one in the same execution, or it'll raise "Gateway not found or has not been executed yet."
    2. Names are the whole contract. Duplicate a Set node and forget to rename it, and the second one silently overwrites the first. The Get dropdown will also happily list both the live and the stale names. If a Get node errors, check that every Set name is unique and that the Set actually ran this queue.

    Install

    Part of MithrilNodes: ComfyUI Manager → Install Custom Nodes → search Mithril ("Mithril-Nodes for ComfyUI"), or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/MithrilMan/ComfyUI-MithrilNodes
    

    Restart after. No dependencies, no model files. Worth repeating that the pack is early days (0.1.0) and the README is a placeholder describing a different feature set - the gateways work as the shipped code says, but there's no tutorial safety net yet. If you want battle-tested named-routing, rgthree's Context nodes are the mature alternative; this is the lightweight new-kid take on it.

    CategoryⓂ️ MithrilNodes/Gateways

    Inputs (2)

    NameTypeDefaultDescription
    gateway_nameSTRINGoutput_1
    data*

    Outputs (0)

    No outputs