Nodes/ComfyUI-GGUF-Loader/UniRig Apply Skinning ⚡
ComfyUI Node

UniRig Apply Skinning ⚡

Weight Painting, Automated (And Two Numbers That Decide How Well)

By ChrisColeTech·Created 2 months ago·Updated 4 days ago· 24
UniRig Apply Skinning ⚡
  • skeleton
  • skinning_model
  • rig
  • rig_info
◄voxel_grid_size196►
◄smooth_iters1►

Skinning is the part of rigging nobody volunteers for: assigning, for every vertex, how much each bone influences it. Hours of clicking in Blender, and if you get it wrong the mesh tears at the elbows. UniRig learns it instead. This node takes a mesh and a skeleton and returns per-vertex weights, which is more or less the whole job.

How it predicts the weights

Three ingredients. First a geodesic prior: the mesh is voxelized on a grid (196³ by default) and distances along the surface are used to estimate which bone each region probably belongs to - before the neural net touches anything. That's the piece that stops the model assigning a hand's weights to the opposite hip because they're close in 3D space but far along the surface.

Then the learned part: Point Transformer V3 over the geometry, Michelangelo for global context, and a bone-attention block that lets vertices attend to the joints they might belong to. Pure PyTorch, with a SubMConv3d standing in for spconv (validated against the real thing at 1e-5 max error).

Finally the cleanup. Upstream's reskin pass diffuses weights along mesh edges, and a 0.03 threshold drops negligible influences - that's the difference between "assignments" and "assignments a DCC will actually render cleanly". You control the diffusion pass count.

The two inputs that matter

  • voxel_grid_size - 196 default, 64 to 512 in steps of 4. Lower it if you're short on memory; raise it for fine detail on a large mesh where 196 voxels means chunks of surface sharing a cell. This is the highest-leverage widget here, and 196 is a well-chosen default, not a placeholder.
  • smooth_iters - 1 default, 0 to 10. Edge-diffusion passes. 0 gives you crisper, blockier weight boundaries; 2-3 gives softer joints that bend more like skin. Above 3 you're smearing influence across the mesh and the deformations go mushy.

The required skeleton comes from Extract Skeleton and skinning_model from the Skin Model Loader. Outputs: rig and rig_info. The rig object is an opaque CCTECH_UNIRIG_RIG holding the skeleton plus a weight matrix - nothing else in ComfyUI understands the type, and its only consumer is Rig to GLB. rig_info is a human-readable summary of bones and weights, which is how you sanity-check that the model actually did something.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/ChrisColeTech/ComfyUI-GGUF-Loader
pip install -r ComfyUI/custom_nodes/ComfyUI-GGUF-Loader/requirements.txt

Manager install works too. trimesh is mandatory - it's the voxelization backend, and without it the node stops with "UniRig skinning needs the 'trimesh' package (pip install trimesh; listed in requirements.txt)". You'll also need skin.safetensors (1.5 GB) in models/unirig/. This node asks ComfyUI for about 1 GB of working memory beyond the weights.

The trap that actually matters

It binds to the mesh inside the skeleton object, not to the mesh you're looking at. Extract Skeleton decimates above max_faces and passes the decimated mesh forward inside the skeleton it outputs; Apply Skinning uses that. So the rig always matches the skeleton's mesh - good - but if you were expecting weights for your original 400k-face model, you won't get them, and the mismatch will look like a bug until you go back and raise max_faces or accept the decimation.

Voxel grid too coarse for a thin mesh. Fingers, wires, sword blades - anything thinner than a voxel gets smeared into its neighbour and the weights are wrong. Raise voxel_grid_size before you start suspecting the model.

smooth_iters as a fix for a bad skeleton. It won't be. If the skeleton is anatomically wrong, diffusion just spreads the wrong weights more evenly.

The honest ceiling

Weights are only as good as the topology under them. This is the recurring truth of the whole 3D-generation pipeline - the KB's own summary of community sentiment is that "topology is still terrible for any sort of skeletal animation" - and no amount of learned skinning fixes a mesh with no edge loops at the joints. What UniRig gives you is a correct-enough first pass that you can export and hand-tune, which is a genuinely large saving over starting from an empty armature. If you expected to skip Blender entirely, you'll be disappointed; if you expected to skip an afternoon of weight painting, you won't.

For the full chain: Load Mesh → Extract Skeleton → Apply Skinning → Rig to GLB → Save 3D Model. The pack ships example_workflows/unirig_glb_to_rigged_glb_api.json doing exactly that.

Category🤖 CCTech/UniRig

Inputs (4)

NameTypeDefaultDescription
skeletonCCTECH_UNIRIG_SKELETON—
skinning_modelCCTECH_UNIRIG_SKINNING_MODEL—
voxel_grid_sizeINT19664–512Voxel grid for the geodesic skin prior (POC/upstream: 196).
smooth_itersINT10–10Edge-diffusion passes of upstream's reskin cleanup (POC: 1).

Outputs (2)

NameTypeDescription
rigCCTECH_UNIRIG_RIG—
rig_infoSTRING—