Object Vertex Group Quantize
Weights Too Sloppy? Snap Them to a Fixed Number of Levels
- BPY_OBJ
- group_select_mode
- BPY_OBJ
Don't be fooled by the name - this has nothing to do with quantizing a diffusion model. Object Vertex Group Quantize snaps vertex weights to a fixed number of discrete steps, turning a continuous gradient of values into a clean, stepped ramp. With the default of 4 steps, every weight lands on 0, 0.25, 0.5, 0.75, or 1.0.
Why would you want that? Some pipelines do. Stylized rigs, certain game engines, and anyone who wants predictable, readable weights rather than float soup. It's also a great debugging tool: after quantizing, ragged weight distributions stand out immediately.
How it works
An auto-generated wrapper around Blender's bpy.ops.object.vertex_group_quantize. BPY_OBJ in, edit mode, operator runs, same object out. Two inputs:
- steps - the number of quantization levels (default 4, up to 1000). 4 gives you clean quarters; higher values are a gentler nudge toward tidier weights.
- group_select_mode - plain text field feeding Blender's enum; type
ALLorACTIVEto choose whether every group gets snapped or just the active one.
The output is the same BPY_OBJ, so you can chain it right after the assign/smooth work and before normalization.
A useful pairing: run Quantize, then Object Vertex Group Normalize All. Quantize gets you the stepped values; normalize makes sure they still sum to 1 afterward, because snapping can knock sums off.
Installing it
It's part of the Avatar Graph pack:
cd ComfyUI/custom_nodes
git clone https://github.com/avatechai/avatar-graph-comfyui
cd avatar-graph-comfyui
python -m pip install -r requirements.txt
Restart ComfyUI, or install "Avatar Graph" from ComfyUI Manager. Pack-wide notes: bpy==3.6.0 pins you to Python 3.10 (README suggests a conda env for it), and bpy is a multi-hundred-MB headless Blender, so the install takes a minute.
Common issues
People usually hit one of two walls. First: they expect quantization to "clean up" weights and it actually makes them blockier - that's the point, so set steps higher if the steps are too coarse. Second: the group_select_mode text field trips people up because it has no dropdown in the UI - type ALL or ACTIVE exactly, or the operator gets nothing valid.
And as always in this pack: no BPY_OBJ wired in from an upstream mesh node means nothing happens.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| BPY_OBJopt | BPY_OBJ | — | |
| group_select_modeopt | B_ENUM | — | |
| stepsopt | INT | 41–1000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| BPY_OBJ | BPY_OBJ | — |