_.omit
Strip the Junk Keys Out of a Dictionary
- py_dict
- keys
- DICT
_.omit is the "delete the keys I don't want" node. You give it a dict and a list of keys, and it returns a copy of that dict with those keys removed. It's the blacklist twin of _.pick, and it's one of the more genuinely useful nodes in the underscore family - mostly because real-world workflow data is messy, and metadata dicts in particular accumulate keys you don't want to carry around.
When you'd reach for it
Think about what comes out of metadata extractors, VHS-style info nodes, or image-info payloads: a dict with twenty keys when you need six. You can't always control what upstream nodes emit, but you can strip it down before it reaches a saver, a display node, or a downstream formatter. _.omit is also handy for scrubbing sensitive keys (API tokens, paths, session IDs) out of a dict before it gets serialized or logged.
The inputs are minimal:
py_dict- the dictionary to filterkeys- a single key, or a JSON array of keys like["token", "path"]
Output: a DICT with the named keys gone.
How it works
Under the hood it flattens the key list and builds a new dict containing every original key that isn't in that list. The original is left untouched - you get a copy, so wiring the same dict into two branches and omitting different keys in each is safe. That non-mutating behavior is consistent across the family: the node deep-copies its input before doing anything.
The keys input accepts JSON, which is the part that trips people up. A single key works as plain text, but for multiple keys you want a JSON array - ["a", "b"] - not a comma-separated string. The pack's String Format node is a convenient way to build that array dynamically if your key list changes.
Omit vs. pick
Both do the same job from opposite directions. _.omit keeps everything except what you name - the right call when you know what you don't want. _.pick keeps only what you name - the right call when you know exactly what you want and the "everything else" could be huge. For "scrub the bad stuff out of a big metadata blob," omit is usually the one you want.
Installing
Part of comfy-ovum. ComfyUI Manager → search comfy-ovum → Install, or:
cd ComfyUI/custom_nodes
git clone https://github.com/sfinktah/comfy-ovum
Restart ComfyUI. No models, no extra pip packages for the underscore nodes - the port ships in the repo.
The bottom line
A clean, non-destructive blacklist for dictionaries. Remember JSON arrays for multiple keys, and you'll be scrubbing metadata like a pro.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| py_dictopt | * | Primary input object (expected object). You can still pass any JSON-serializable value. Also accepts _.CHAIN to continue chaining. | |
| keysopt | * | keys: JSON allowed for arrays/objects where applicable. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| DICT | DICT | — |