Nodes/cozy_ex_dynamic/Dynamic Node (cozy)
ComfyUI Node

Dynamic Node (cozy)

The ComfyUI node with zero inputs (that's the whole point)

By cozy-comfyui·Created 2 years ago·Updated about a year ago· 41
Dynamic Node (cozy)
    • IMAGE

    What you're actually looking at

    Let me save you the scavenger hunt: Dynamic Node (cozy) is not a tool. It's a lesson. It's the smallest possible working example of one specific ComfyUI mechanism - dynamic inputs - written by Alexander G. Morano (the same person behind the big Jovimetrix pack) as a teaching artifact. The README is upfront about it: people ask the same "how do you make a node with a variable number of inputs?" question over and over, and every answer is buried inside a compound repo you have to untangle. So he stripped it to two files.

    That's also why it sits in the _EXAMPLES category, sorted to the bottom of the node menu. If a workflow you downloaded from somewhere references "Dynamic Node (cozy)," it's almost certainly a leftover placeholder from whoever built the graph. You can usually just delete it and move on. Really.

    What it does

    Drop it on the canvas and you get one gray IMAGE input slot. Connect an image and the slot renames itself image_1, and a fresh gray slot appears beneath it. Connect another - image_2. The pattern repeats as long as you keep wiring things in. On the Python side, run() scoops up whatever landed in its kwargs and returns the first connected value as IMAGE. So it's a one-wire passthrough that exists to prove the plumbing works.

    How the mechanism actually works

    This is the part node authors care about, and it's the reason the node looks weird. A normal node declares its inputs in INPUT_TYPES() on the Python side, and the frontend just renders that list. This one declares nothing - both required and optional come back empty, which is why info_schema lists zero inputs. The inputs don't exist until your browser creates them.

    That creation happens in web/node/dynamicnode.js. The extension hooks onConnectionsChange and does four things when you plug in a cable: it looks up the source node's output type and retypes the slot to match; it renames slots with an index (image_1, image_2) so names stay unique; it deletes any unconnected slot; and it always keeps one empty gray image slot at the end as the next landing pad. Disconnect something and the empty slot gets removed. The Python never knows how many inputs there will be - it just reads whatever lands in **kw.

    That's the entire trick behind every "accepts any number of X" node in the ecosystem (think rgthree's or Kijai's dynamic-input work). The README credits Kijai, pythongosssss, and melMass for the concepts, which tracks - all three are core to how the modern ComfyUI frontend works.

    Inputs and outputs

    • Output: one IMAGE - a standard image tensor you can wire into any image-consuming node (VAE decode, save, compositing, whatever).
    • Inputs: none declared, and that's by design. The dynamic ones appear as you connect.

    Two things that bite people. First, it returns only the first connected image; connect three and the other two are silently ignored. Second, with nothing connected it returns None, which will error out anything downstream. It's a demo, not a merge node.

    Install

    There are no extra requirements - requirements.txt is literally empty and the pyproject.toml declares zero dependencies. One clone, one restart:

    cd ComfyUI/custom_nodes
    git clone https://github.com/cozy-comfyui/cozy_ex_dynamic
    

    Then restart ComfyUI. Or use ComfyUI Manager and search "Cozy Dynamic" / cozy_ex_dynamic - it's the same thing.

    Gotchas

    • The inputs are frontend-created. If you install and see a node with no slots at all, the web extension didn't load - hard-refresh the browser (Ctrl+Shift+R) or restart ComfyUI. This applies to any dynamic-input node, not just this one.
    • It's a reference, not a workhorse. It has no opinionated use case in a real pipeline. If you're a user, skip it; if you're learning to write custom nodes, it's genuinely one of the cleanest two-file examples of the dynamic-input pattern you'll find.
    Category_EXAMPLES

    Inputs (0)

    No inputs

    Outputs (1)

    NameTypeDescription
    IMAGEIMAGE