Nodes/comfy-ovum/Uncachable List Copy (immutable)
ComfyUI Node

Uncachable List Copy (immutable)

The node that breaks Comfy's cache so your loop re-runs

By sfinktah·Created about a year ago·Updated 10 months ago· 7
Uncachable List Copy (immutable)
  • py_list
  • LIST

Here's a ComfyUI quirk that sends people down rabbit holes: ComfyUI caches node outputs, and if a node mutates a list in place instead of producing a new object, the cache never sees a change. Your loop runs once, then every subsequent pass reuses the stale result, and no amount of re-wiring fixes it. Uncachable List Copy exists to break that deadlock.

What it actually does

Despite the scary name, it's two things stacked together:

  1. It makes a copy. Given a list, it returns list(py_list[:]) - a fresh Python list with the same elements. Given a dict, it returns list(dict.values()). Non-mutating, always.
  2. It lies to the cache. Its IS_CHANGED returns NaN, which forces ComfyUI to consider the node changed on every single execution. Combined with the fresh copy, downstream nodes see a "new" value each run and actually re-execute.

That second part is the whole point. The IS_CHANGED trick is the same one the rest of the pack's utility nodes lean on - the NewPointer base class the comfy-ovum author uses across list and cast nodes applies it everywhere so graph utilities never get cached away.

When you'd reach for it

You're in loop territory. You've got a Foreach-style iteration (this pack has its own loop nodes) where each pass is supposed to consume a list or build one up, and results keep coming back identical because the same list object keeps flowing through. Slip this node in front of the list before each iteration and you force the graph to treat it as fresh.

It's also handy if you're mutating a shared list in a custom node and want to guarantee downstream never sees the mutated original - the copy isolates you.

Inputs and outputs

  • py_list (required, *) - the list, tuple, or dict to copy. Anything else (a scalar, a string) returns an empty list [].
  • LIST (output, *) - the fresh copy, or [] for unsupported input types.

No widgets, nothing to configure.

Installing it

Part of the comfy-ovum pack:

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

Restart ComfyUI. Or ComfyUI Manager → search "comfy-ovum" → Install. No models, no GPU cost - it's a pure-Python utility.

Common gotchas

  • The copy is shallow. list(py_list[:]) copies the outer list, but nested lists and objects inside are still the same references. If something deep inside gets mutated, the "fresh copy" still carries the change. For deep isolation you'd need copy.deepcopy, which this deliberately doesn't do.
  • Wrong input type silently gives you []. A dict becomes its values; a scalar becomes an empty list. If your output suddenly looks blank, check what you're feeding in - it may not be list-shaped at all.
  • Don't use it outside loops for fun. The always-changed behavior means it re-runs every pass of the graph, which is exactly what you want in an iteration and exactly what you don't want in a hot path that never changes.
Categoryovum/loop

Inputs (1)

NameTypeDefaultDescription
py_list*

Outputs (1)

NameTypeDescription
LIST*