Nodes/ComfyUI-gen2/Gen2 Input Panel
ComfyUI Node

Gen2 Input Panel

One Configure dialog instead of a tangle of INPUT_* nodes

By petmycat·Created 7 months ago·Updated 12 days ago· 23
Gen2 Input Panel
    • panel_link
    • param_0
    • param_1
    • param_2
    • param_3
    • param_4
    • param_5
    • param_6
    • param_7
    • param_8
    • param_9
    • param_10
    • param_11
    • param_12
    • param_13
    • param_14
    • param_15
    • param_16
    • param_17
    • param_18
    • param_19
    • param_20
    • param_21
    • param_22
    • param_23
    • param_24
    • param_25
    • param_26
    • param_27
    • param_28
    • param_29
    • param_30
    • param_31
    _config[]

    Building a workflow meant to be driven from outside ComfyUI - an app, a Discord bot, a web frontend that POSTs an API payload - is where the fun leaks out of ComfyUI. You end up with a bunch of INPUT_* constant nodes scattered around the graph, and your external code has to scan node titles to figure out which is which. This node collapses all of that into a single configurable panel. Click Configure, define your parameters, and every name becomes both a typed output slot on the node body and a key in the API-export JSON.

    What it does

    Each parameter you define has a name (the slot label and the API key), a type (STRING / INT / FLOAT / BOOLEAN / IMAGE - plus COMBO and SEED under the hood), and a default. Numeric types get range and step:

    • min / max - the accepted value range. Here's the nice bit: an out-of-range value interrupts the workflow with a clear error (parameter 'strength' = 1.5 is above max 1.0) instead of silently clamping. You find out about bad input immediately, which is what you want when a remote caller sends the values.
    • step - the UI snapping increment and a documentation value. 0.05 means the widget snaps 1.00, 1.05, 1.10, ….
    • default - used when no runtime value is provided. null means "no default", i.e. the parameter must be provided.

    One subtlety the README calls out: exporting the workflow/API always yields the default values, not whatever was set during a run. The node's widgets serialize defaults, so your exported workflow JSON is a clean template rather than a snapshot of your last tinkering. That's deliberate, and it matters if you're the one committing workflow JSON to version control.

    Inputs and outputs

    The only required input is _config, a STRING holding the serialized JSON of your configured parameters (default "[]"). Outputs are a fixed bank of wildcard slots: panel_link plus param_0 through param_31. The frontend renames the configured ones, and panel_link is the one you wire into a Gen2 Output Panel's PANEL_LINK input to bind the pair - that's also how the Output Panel learns your schema.

    In the exported API payload, the node looks like this:

    "Gen2_InputPanel": {
      "inputs": {
        "_config": "[{\"name\":\"seed\",\"type\":\"INT\",\"default\":0,\"min\":0,\"max\":999,\"step\":1},...]",
        "seed": 0,
        "loraStrength": 1.0,
        "genMode": false,
        "imageUrl": null
      },
      "class_type": "Gen2_InputPanel"
    }
    

    An external frontend scans for class_type == "Gen2_InputPanel", reads and writes the parameter keys directly, and never has to parse node titles again.

    Installation

    Install the pack via ComfyUI Manager (search "ComfyUI-gen2"), or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/petmycat/ComfyUI-gen2
    cd ComfyUI-gen2
    pip install -r requirements.txt
    

    Restart, then add the node. The panel backend uses ComfyUI's V3 node API and works on both the legacy LiteGraph and Nodes 2.0 (Vue) frontends, but it needs ComfyUI ≥ v0.10.0. The frontend extension (web/js/gen2Panels.js) is what provides the Configure popup, the per-parameter widgets with range/step snapping, and image upload.

    Common issues

    • "Parameter X is above max" interrupting runs - that's the feature, not a bug. It's a hard stop, so if you're hammering the API with values from an old client, check min/max in your config.
    • Params missing from the API export. Remember the export uses defaults; if you set values interactively and then export, you get the template, not the run. Wire the panel so your backend sends values explicitly.
    • On older ComfyUI, the node doesn't appear. V3 io.ComfyNode classes are recent - update ComfyUI.

    If you run ComfyUI headlessly or through a wrapper, this is one of those "I didn't know I needed this" nodes. Pair it with the Output Panel and the whole API surface of a workflow fits in two boxes.

    CategoryGen2/API

    Inputs (1)

    NameTypeDefaultDescription
    _configSTRING[]

    Outputs (33)

    NameTypeDescription
    panel_link*
    param_0*
    param_1*
    param_2*
    param_3*
    param_4*
    param_5*
    param_6*
    param_7*
    param_8*
    param_9*
    param_10*
    param_11*
    param_12*
    param_13*
    param_14*
    param_15*
    param_16*
    param_17*
    param_18*
    param_19*
    param_20*
    param_21*
    param_22*
    param_23*
    param_24*
    param_25*
    param_26*
    param_27*
    param_28*
    param_29*
    param_30*
    param_31*