Object Select Random
Pick a random subset of your scene, reproducibly
- BPY_OBJ
- BPY_OBJ
Object Select Random does what it says: selects a random subset of the objects in your scene. It wraps bpy.ops.object.select_random. If you've got a hundred identical leaves, a crowd of background avatars, or any pile of "samey" objects and you want to vary only some of them, this is the node that picks which ones - with a seed so the same pick comes back every time.
The inputs that matter
- BPY_OBJ - becomes the active object; for chaining.
- ratio - what fraction of objects to select,
0.0to1.0, default0.5. Half the scene by default; crank down for "a few", up for "most". - seed - the reproducibility dial. Same seed, same selection, every run. Different seed, different subset. This is what turns randomness into something you can iterate on.
- action -
SELECTorDESELECT. Same as it sounds: pick a random subset to select, or randomly deselect from the current selection (a way to thin out an existing selection).
Output is a single BPY_OBJ, the active object.
Where it earns its keep
Random selection is the partner to Object Randomize Transform: select a random 30% of your hair strands or crowd, then run a randomize so the scene has organic variation instead of everything shuffled identically. Pairing a seeded Select Random with a seeded Randomize Transform gives you fully deterministic chaos - same look every time you execute, which matters when the scene resets between runs and you need reproducible output for a batch or a demo.
Installing it
Part of the Avatar Graph pack. ComfyUI Manager → search "Avatar Graph" → install → restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/avatechai/avatar-graph-comfyui
cd avatar-graph-comfyui
python -m pip install -r requirements.txt
Pack-wide caveats: bpy==3.6.0 needs Python 3.10, first import auto-downloads the SAM checkpoint and mediapipe models. And the one thing to remember: ratio is a fraction of the whole scene, not of your target group - if your scene is full of unrelated objects, your "30% of hair" is really "30% of everything." Select your group first, then read the ratio honestly.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| BPY_OBJopt | BPY_OBJ | — | |
| ratioopt | FLOAT | 0.500–1 | — |
| seedopt | INT | 00–2147483647 | — |
| actionopt | COMBO | 2 options: SELECT, DESELECT |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| BPY_OBJ | BPY_OBJ | — |