Mesh Select Random
Grab a reproducible random chunk of the mesh
- BPY_OBJ
- BPY_OBJ
A seeded coin-flip over your mesh's geometry. It wraps Blender's real bpy.ops.mesh.select_random operator, part of Avatar Graph, the pack that runs actual Blender inside ComfyUI's process (via the bpy Python package) to build interactive 2D-to-3D avatars, auto-generating a node for every mesh operator Blender has. The one thing worth knowing up front, because it matters for how you'd actually use this inside a repeatable pipeline: the randomness is seeded, so the same inputs give you the same "random" result every single run, not a different one each time the graph executes.
How it works
It picks a random subset of whichever elements are currently selectable (respecting the active vertex/edge/face mode), sized according to a ratio you set, then either adds that subset to the selection or removes it, depending on which action you chose.
Inputs and outputs
BPY_OBJ- the mesh coming in.ratio(default0.5, range0–1) - what fraction of the mesh's elements get chosen.0.5picks roughly half; push toward0or1for a sparser or denser scatter.seed(default0) - the random seed. Same seed, same ratio, same mesh in, same result out - deterministic by design, which matters a lot in a graph you expect to re-run and get identical output from.action-SELECTorDESELECT.SELECTadds the random subset to whatever's already selected;DESELECTremoves it instead, letting you punch a random pattern of holes out of an existing selection rather than only ever building one up.
Output is a single BPY_OBJ - the same object, selection updated with the random subset applied.
Where it's actually useful
Anywhere you want a scattered, non-uniform result without hand-picking it - a randomized deletion for a stylized broken or eroded look, a random sample of vertices to spot-test a shape-key transform on before committing it to the whole mesh, or feeding a random subset into a downstream operation to break up an otherwise too-regular pattern.
Installing it
ComfyUI Manager: search "avatar-graph-comfyui", install, restart. Manually: cd ComfyUI/custom_nodes && git clone https://github.com/avatechai/avatar-graph-comfyui, then cd avatar-graph-comfyui && python -m pip install -r requirements.txt, then restart.
Python 3.10.x is the requirement to nail down first - the bpy package this pack is built on needs that exact minor version, and the README recommends a dedicated conda environment on macOS/Linux (conda create --name comfyui python=3.10) rather than trusting an existing Python install. Windows users get a prebuilt ComfyUI + Python 3.10 zip linked in the README to unzip over their install before adding the pack via Manager. Restart with --enable-cors-header (macOS also wants --force-fp16) for the live 3D preview - without it, the graph still runs fine, you just save the model manually from the pack's Avatar Main Output node instead.
Common issues
Rule out the Python version first if this pack's nodes aren't loading. The most common point of confusion here is expecting fresh randomness on every run and instead getting the exact same selection every time - that's the seed doing its job, not a bug; change seed if you actually want a different pattern. On a small mesh, a ratio near the extremes can round down to nothing selected or round up to the whole mesh, since Blender still has to land on whole elements rather than fractional ones - if you're getting an empty or full selection unexpectedly, that's usually why.
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 | — |