ComfyUI Node

List (VixUI)

A dropdown that can display one value but emit another

By Visionatrix·Created 2 years ago·Updated about a year ago· 3
List (VixUI)
    • *
    default_value
    possible_values[]
    display_nameDropdown list
    optionaltrue
    advancedtrue
    order99
    custom_id
    hiddenfalse

    VixUiList is the dropdown of the VixUI family - and it's cleverer than it looks. You give it a JSON list of options and it renders as a select box in the Visionatrix UI, but here's the trick: possible_values can be a JSON object (a dict) instead of a list, and then the node maps - the user picks from the keys, and the node outputs the corresponding value. Pick "Portrait" and it emits 832x1216. That's the whole superpower.

    Like the rest of the VixUI nodes, in plain ComfyUI it's mostly a pass-through with metadata. Its purpose is Visionatrix flows where a user should choose from a fixed set of options instead of typing.

    Inputs that matter

    • default_value (STRING) - the option selected by default. This is also what flows out when possible_values is a plain list.
    • possible_values (STRING, multiline, default "[]") - the options, as JSON. A list looks like ["SD1.5", "SDXL", "Flux"]. A mapping object looks like {"Portrait": "832x1216", "Square": "1024x1024"}. The node calls json.loads on this field, so malformed JSON is the #1 way this node fails.
    • display_name (default "Dropdown list"), optional, advanced, order, custom_id - the standard VixUI metadata.

    hidden is the optional input.

    Outputs

    A single * (any-type) output. It emits either the chosen default_value (list mode) or the mapped value (dict mode). Any-type means it can feed a STRING input, and since values are strings at rest, most string-consuming nodes take it happily.

    How it works

    The implementation is short: parse possible_values as JSON; if it's a dict and the current default_value is one of its keys, return the mapped value; otherwise return default_value itself. That's it - the mapping is where the real design freedom lives. A flow can show "Fast / Balanced / Quality" and emit 20 / 30 / 40 steps depending on the pick, all from one dropdown wired to the steps input.

    Install

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

    Restart ComfyUI, or install ComfyUI-Visionatrix via ComfyUI Manager. No model downloads; deps are torch, pillow, numpy.

    Gotchas

    JSON strictness is the trap: ["A", "B"] is valid, ["A", "B"] with a trailing comma is not, and single quotes will fail json.loads. If your dropdown suddenly outputs nothing, check the field - and remember default_value must exactly match a key when you use dict mode (case matters, spaces matter). Also note this node returns the value, not the label: in dict mode you can't recover which option was picked from the output alone. If you need the label for downstream logic, that's what VixUiListLogic is for.

    CategoryVisionatrix/UI

    Inputs (8)

    NameTypeDefaultDescription
    default_valueSTRING
    possible_valuesSTRING[]
    display_nameSTRINGDropdown list
    optionalBOOLEANtrue
    advancedBOOLEANtrue
    orderINT99
    custom_idSTRING
    hiddenoptBOOLEANfalse

    Outputs (1)

    NameTypeDescription
    **