Nodes/comfyui-ValiTools/VRandomSelector
ComfyUI Node

VRandomSelector

VRandomSelector - passes one of its connected inputs through at random. Connect as many inputs as you like (a new empty slot appears as you connect); all inputs must share one type, and the first connection locks that type. Only the selected input's upstream branch is executed (lazy evaluation) - the other branches stay cold. from_input / to_input restrict the pick to a slot range (0 = no limit). Outputs the selected value and its 1-based input index.

By vangel76·Created 19 days ago·Updated 3 days ago· 0
VRandomSelector
  • input_1
  • input_2
  • input_3
  • input_4
  • input_5
  • input_6
  • input_7
  • input_8
  • input_9
  • input_10
  • input_11
  • input_12
  • input_13
  • input_14
  • input_15
  • input_16
  • input_17
  • input_18
  • input_19
  • input_20
  • input_21
  • input_22
  • input_23
  • input_24
  • input_25
  • input_26
  • input_27
  • input_28
  • input_29
  • input_30
  • selected
  • selected_index
seed0
from_input0
to_input0
CategoryValiTools

Inputs (33)

NameTypeDefaultDescription
seedINT00–18446744073709550000Same seed with the same connected inputs always picks the same one. Keep it on 'randomize' for a new pick each queue.
from_inputINT00–30Restrict the pick to inputs numbered from this one on. 0 = no lower limit.
to_inputINT00–30Restrict the pick to inputs numbered up to this one. 0 = no upper limit.
input_1opt*
input_2opt*
input_3opt*
input_4opt*
input_5opt*
input_6opt*
input_7opt*
input_8opt*
input_9opt*
input_10opt*
input_11opt*
input_12opt*
input_13opt*
input_14opt*
input_15opt*
input_16opt*
input_17opt*
input_18opt*
input_19opt*
input_20opt*
input_21opt*
input_22opt*
input_23opt*
input_24opt*
input_25opt*
input_26opt*
input_27opt*
input_28opt*
input_29opt*
input_30opt*

Outputs (2)

NameTypeDescription
selected*
selected_indexINT