ComfyUI Node

Example Output Node

It outputs what you put in — the trick is that it counts as an output

By jhj0517·Created 2 years ago·Updated 2 years ago· 44
Example Output Node
    • int
    value

    Example Output Node takes an integer and hands it straight back to you, unchanged. As a result it's useless. As a lesson it's the most important node in its pack - because this is the demo of what an output node is, and the whole workflow depends on having at least one.

    It ships in ComfyUI-CustomNodes-Template, jhj0517's starter repo for writing your own custom nodes (same author as Whisper-WebUI and the finetuning-notebooks trainers). The template exists so people can fork it and replace the demos with real logic, and this node is the demo of the one flag every final node in a graph needs: OUTPUT_NODE = True.

    How it works

    The source is nearly empty on purpose. INPUT_TYPES declares one required input, value (INT); RETURN_TYPES/RETURN_NAMES declare the output as int; and the result() method returns (value,) verbatim. A pass-through. The interesting line is OUTPUT_NODE = True.

    Here's what that flag actually does. ComfyUI executes a workflow by walking backward from its output nodes - Preview Image and Save Image are the ones you know - and it aggressively caches anything upstream whose inputs didn't change. An output node is the anchor of that backward walk, and the engine won't even let you queue a graph that has none; the template's own note spells it out: "Without an output node, the workflow cannot be queued." So this node's real job is to mark the end of the line for the demo graph, and to show you how you'd write a custom output node - the pattern you'd use for a "save my custom result" node that does something with the final value instead of passing it through.

    Inputs and outputs

    • value (required INT) - whatever integer you feed it, from a widget or a wire.
    • int (INT) - the same value, unchanged.

    There's nothing else. If you connect it to the template's Calculate Minus output and run, the number you see is exactly a - b. You'll notice the example workflow routes it into a Display Any (rgthree) node just so the value is visible on screen.

    Installing it

    ComfyUI Manager won't surface this pack - the template isn't in the Manager community index, only jhj0517's functional packs are. Clone it:

    cd ComfyUI/custom_nodes
    git clone https://github.com/jhj0517/ComfyUI-CustomNodes-Template
    

    Restart and it appears under the CustomNodesTemplate category. requirements.txt is empty, so there's no pip step and nothing to download. (And don't run the README's clone command literally - it's a template placeholder that says replace-this-with-your-github-repository-url.git.)

    Common issues

    • "Workflow has no output node" when you delete it. That's expected - this node is the output node of the demo graph. If you remove it, wire something else with OUTPUT_NODE semantics into the chain (a Preview Image, a Save, or a display node) or the queue button won't run.
    • It "does nothing." Correct by design. It's a pass-through teaching you the output-node pattern, not a processor.
    • The example workflow needs rgthree. It ends in a Display Any (rgthree) node, so install rgthree-comfy or replace that node before loading workflows/example-1.json.
    CategoryCustomNodesTemplate

    Inputs (1)

    NameTypeDefaultDescription
    valueINT

    Outputs (1)

    NameTypeDescription
    intINT