ComfyUI Node

_.min

The smallest value in a list — mirror image of _.max, same quirks.

By sfinktah·Created about a year ago·Updated 10 months ago· 7
_.min
  • list_or_dict
  • iteratee
  • *
iteratee_json

_.min is the mirror image of _.max: it returns the smallest value in a list, with the same optional iteratee for "smallest by some criterion." The two nodes share a skeleton - same inputs, same shorthand, same quirks - so if you've read the _.max page you already know most of this one. The difference is which end of the ranking you care about.

What it is

Part of the ovum/underscore family in sfinktah/comfy-ovum, wrapping the min method of underscore3, a Python port of Underscore.js. The iteratee is normalized through _.iteratee, so you can hand it a function, a key string, an object, or JSON. No iteratee means plain min(list) - numeric comparison across elements.

Inputs that matter

  • list_or_dict (type *) - the collection to search.
  • iteratee (type *, force-input) - the criterion: function, key string, or object shorthand.
  • iteratee_json (STRING, multiline) - JSON or a key selector, used when the socket isn't connected. The save-friendly path.

Output is typed * (ANY) - the winning (losing?) element itself. Chain mode works: feed a _.CHAIN and get a chain back, resolved with _.value.

The quirks (same as max, spelled out)

The port's own description is upfront about them:

  • Empty list → Infinity. Not an error, not None. If you need to distinguish "no data" from "a huge value," guard with an isEmpty check first.
  • Dict input → []. Feeding _.min a dict returns an empty list, same as _.max. Keep the input a flat list.
  • Numbers only, reliably. "Can currently only compare numbers reliably" is the honest warning. Strings might compare, but don't bet a workflow on it.

Where you'd use it

Cheapest, shortest, earliest. Pick the lowest-cost option out of a list of dicts by setting iteratee_json to "price". Find the shortest filename by key "length". Select the lowest seed. The key-selector form survives saves and reloads, so _.min is one of the more durable nodes in the family - use it the same way you'd use _.max, just at the other end of the scale.

Installing comfy-ovum

ComfyUI Manager: search for comfy-ovum, install, restart. Or by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/sfinktah/comfy-ovum
pip install -r comfy-ovum/requirements.txt

Restart and you're done. No model downloads, no CUDA - pure-Python utilities. The family is officially work in progress, but with the key-selector path and the empty-list behavior in mind, _.min is genuinely usable.

Categoryovum/underscore

Inputs (3)

NameTypeDefaultDescription
list_or_dictopt*Primary input object (expected collection). You can still pass any JSON-serializable value. Also accepts _.CHAIN to continue chaining.
iterateeopt*iteratee: ANY input to override widget. Accepts function, key string, or object shorthand.
iteratee_jsonoptSTRINGiteratee_json: JSON or key selector. Used when 'iteratee' input is not connected.

Outputs (1)

NameTypeDescription
**