ComfyUI Node

_.most

Did Most of These Pass? Only Sort Of

By sfinktah·Created about a year ago·Updated 10 months ago· 7
_.most
  • obj
  • *
percent0

_.most answers a question you don't often get to ask in ComfyUI: "did more than X percent of these elements pass a truth test?" It's a threshold check over a whole collection, returning a single boolean. Think of it as the crowd-vote version of every and some - not "all of them" or "at least one," but "enough of them."

The catch: the percent knob on this node is an integer widget, and the math underneath compares against a fraction. That mismatch turns what should be a 30-second workflow into a head-scratch.

What it does

The implementation is a simple counter: walk the collection, count how many elements are truthy, then return (yes / total) >= percent as a BOOLEAN. An empty collection short-circuits to True - an edge case worth knowing if you're gating a downstream branch on the result.

The inputs are just:

  • obj - the collection (or _.CHAIN)
  • percent - an INT widget, default 0

The wart

Because percent is an integer, and the comparison is fraction >= percent, you can't actually express "75%" - 0.75 isn't representable in an INT widget. I ran the numbers: with the default 0, (yes/total) >= 0 is always true for any non-empty list, so the node returns True no matter what you feed it. Set percent to 1 and it behaves like "all elements must pass" - which is just every with extra steps. There's no middle ground.

So in practice this node has two usable states:

  • percent = 1 - every element must be truthy
  • leave it at 0 - you get True, which is probably not a useful decision

If you genuinely want "at least 60% of these passed," you'd do it more honestly with a _.filter (or _.reject) plus a length comparison downstream. _.most is the one node in the underscore family where the widget design undercuts the feature.

A note on the family

_.most isn't a stock underscore.js method - it's a custom addition in this port, which explains why it feels less battle-tested than _.filter or _.pluck. The whole family runs on a bundled Python port of underscore.js, so there are no extra dependencies and no models to fetch.

Installing

It ships in comfy-ovum. ComfyUI Manager → search comfy-ovum → Install, or:

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

Restart ComfyUI and it's there.

The bottom line

_.most works, but its integer percent widget means "most" is really only usable as "all." If you need a genuine percentage threshold, build it from filter + a size check - you'll get more control and fewer surprises.

Categoryovum/underscore

Inputs (2)

NameTypeDefaultDescription
objopt*Primary input object. Also accepts _.CHAIN to continue chaining.
percentoptINT0percent (number)

Outputs (1)

NameTypeDescription
**