Nodes/comfy-ovum/Create Empty List
ComfyUI Node

Create Empty List

The seed every Ovum loop starts from

By sfinktah·Created about a year ago·Updated 10 months ago· 7
Create Empty List
    • py_list

    Create Empty List is four lines of Python wearing a trench coat: it has no inputs, and it returns []. That's it. And it earns its place in the ovum/loop category because an empty list is exactly what you need to start most of the list-building patterns in this pack.

    Think of it as the "0" you press on a calculator before adding numbers. If you're assembling a list across multiple addValueToList nodes, or seeding an accumulator for a ForeachListBeginOvum loop, you need a concrete empty list object to wire in as the starting point - not the abstract idea of one. ComfyUI is a graph; values have to come from somewhere, and this node is that somewhere for "an empty Python list."

    When you actually need it

    • Loop accumulator seed. ForeachListBeginOvum has an init_accum input precisely for this. Wire Create Empty List into it (or into accum) so each iteration appends onto a fresh list instead of a None or a stale one from a previous run.
    • Building a list incrementally. Combine it with addValueToList - the empty list flows in, values get appended conditionally, and you end up with exactly the items you wanted.
    • Guarding against "no items." Some downstream nodes choke on None; an empty list is the safe, well-defined "nothing here yet" value.

    The output is a single py_list socket typed *, so it plugs into anything in the pack's list family (and most of the ecosystem's, since Ovum's list nodes use permissive types).

    Installing it

    It's part of sfinktah/comfy-ovum:

    cd ComfyUI/custom_nodes
    git clone https://github.com/sfinktah/comfy-ovum
    

    or search comfy-ovum in ComfyUI Manager, then restart ComfyUI. No models, no extra setup.

    Gotchas

    The one thing to keep in mind is a fresh-list-per-run discipline. If you reuse a list object across runs and something upstream mutates it in place, you can get leakage between generations - old items hanging around in the "new" list. That's a general ComfyUI list gotcha, not this node's fault, but it's why "start each run from a fresh empty list" is the habit. There are also the pack's Passthru variants and Uncachable List Copy if you ever need to force ComfyUI to treat a list as changed every run. For the boring, correct start to all of that: this node.

    Categoryovum/loop

    Inputs (0)

    No inputs

    Outputs (1)

    NameTypeDescription
    py_list*