RangeItem (Yogurt Nodes)
Grab One Value Out of a Range
- range
- string
- int
- float
YogurtRangeItem is the "give me just one number from a list of numbers" node. You hand it a range and an index, and it hands back a single value in three convenient flavors: string, int, and float. One output will be useful, and you pick whichever matches what's waiting downstream.
Two inputs, both simple:
range- the list of values. Defaults to[0, 1, 0.1], and it accepts a plain list or aRANGEfrom the pack's ownYogurtRangenode.index- which value to return.0is the first value, and negative indices count from the end, so-1grabs the last one.
The negative-index bit is the feature people forget. In a sweep loop driven by a batch count, the last value is almost always the "final" run you care about, and -1 gets it without you needing to know the list length.
How you'll actually use it
It pairs with YogurtRange the way a for-loop pairs with its range: YogurtRange builds the list, YogurtRangeItem picks an entry. Common patterns:
- A "current strength" value for a LoRA in a sweep -
YogurtRangesupplies the series,YogurtRangeItemfeeds one value into the run. - A seed or config picker where you have a short list and a selector index from elsewhere in the graph.
- Pulling a value by negative index for "the last one" without hardcoding a position.
The three output types exist so you don't have to convert. If the downstream node wants a FLOAT, use float; if it's comparing against an INT, use int. The conversion is done for you, which saves a String To Number detour in most cases.
Install
Ships in ComfyUI-YogurtNodes, same as its sibling. ComfyUI Manager → search ComfyUI-YogurtNodes → install, or clone it manually:
cd ComfyUI/custom_nodes
git clone https://github.com/yogurt7771/ComfyUI-YogurtNodes.git
cd ComfyUI-YogurtNodes
pip install -r requirements.txt
Restart ComfyUI, find it under "Yogurt Nodes" (the "(Yogurt Nodes)" suffix is part of the display name).
The only gotcha is thinking it's smarter than it is. The index is a plain number lookup - there's no clamping and no "closest value" logic. Ask for index 50 in a 10-item list and you'll get an out-of-range error, so keep your index within bounds or drive it from something that already knows the length (that's what YogurtRange's count output is for).
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| range | LIST | 0,1,0.1 | — |
| index | INT | 0 | index of the value to return, 0 means first value, negative means last value |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| string | STRING | — |
| int | INT | — |
| float | FLOAT | — |