Nodes/comfyui_cv/CV Pick Value (sorted)
ComfyUI Node

CV Pick Value (sorted)

Picks one scalar out of a small array: sorts the values (or sorts by the optional key array, e.g. 'the angle of the hand with the largest radius') and returns the rank-th one. The rank is clamped to the array, and an empty input yields 0.0 / index -1 instead of an error - gate on a found flag upstream.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
CV Pick Value (sorted)
  • values
  • key
  • value
  • index
orderlargest first
rank1
Categoryimage/CV/points

Inputs (4)

NameTypeDefaultDescription
valuesNPARRAY(N,) numeric array.
orderCOMBOlargest firstSort direction before applying rank (by values, or by 'key' if connected).
rankINT11–40961 = first in the chosen order; clamped to N.
keyoptNPARRAYSort by these values instead (same length); the output still comes from 'values'.

Outputs (2)

NameTypeDescription
valueFLOAT
indexINTPosition in the input array (-1 when empty).