Nodes/Avatar Graph/Mesh Unsubdivide
ComfyUI Node

Mesh Unsubdivide

Walking a subdivided Avatar Graph mesh back down

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Mesh Unsubdivide
  • BPY_OBJ
  • BPY_OBJ
iterations2

Subdivide is a one-way door in most people's heads - once you've added geometry, you're stuck with it, or you reach for a decimate modifier and lose control over the result. Mesh_Unsubdivide is the actual reverse gear, but it comes with a real caveat: it only works cleanly on meshes that were genuinely built by subdividing something simpler.

What it is and why you'd reach for it

This node wraps Blender's bpy.ops.mesh.unsubdivide() directly. Avatar Graph runs real Blender via the bpy package inside the ComfyUI process, and its Mesh_* nodes are largely thin wrappers around Blender's built-in mesh operators - this one included. Unsubdivide looks at the mesh's topology, tries to recognize the regular grid pattern that a subdivide leaves behind, and collapses it back toward a lower-resolution cage.

Where it's actually useful in an Avatar Graph pipeline: you ran Mesh_Subdivide earlier to get smoother deformation for shape keys, then realized you overshot - too much geometry for the real-time Shape Flow runtime to push comfortably, or the extra resolution isn't buying you anything visually. Unsubdivide gets you back down without touching topology by hand. Throw it at a mesh that wasn't built by clean subdivision - an organic auto-generated mesh straight from Create Mesh Layer, for instance - and it either does very little or makes the topology worse, because there's no regular grid pattern to collapse.

Inputs and outputs that matter

  • BPY_OBJ (optional) - the mesh coming in.
  • iterations (int, default 2, 1–1000) - how many unsubdivide passes to run. Each pass roughly halves resolution the way a subdivide pass roughly doubled it, so this should usually mirror however many number_cuts passes you're trying to undo - not the max value.

Output: a single BPY_OBJ, downsampled where it could recognize a grid to collapse.

Same rule as the rest of this family: it only touches the currently selected geometry. Select the region - or the whole mesh - you actually want reduced before running it.

Installing Avatar Graph

Everything in this pack runs on bpy, and bpy only has wheels for Python 3.10.x - that's the constraint to satisfy before anything else.

ComfyUI Manager: search avatar-graph-comfyui, install, restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/avatechai/avatar-graph-comfyui.git
cd avatar-graph-comfyui
python -m pip install -r requirements.txt

Restart with python main.py --enable-cors-header (--force-fp16 too on Mac). Windows gets a prebuilt Python 3.10 environment straight from the README; macOS/Linux is pointed at conda create --name comfyui python=3.10.

Common issues

It barely does anything. The single most common cause is running it on a mesh that wasn't produced by an actual subdivide - auto-generated character meshes from Create Mesh Layer often don't have the clean grid topology this operator needs to find a pattern in. If you want lower resolution on that kind of mesh, you're better off not over-subdividing it in the first place, or using an actual decimate step outside this node.

Topology looks worse after running it, not better. Same root cause - irregular topology going in produces an irregular (sometimes uglier) result coming out. Undo and reconsider whether unsubdivide is the right tool versus rebuilding the mesh at lower resolution upstream.

Nodes not loading. Check your Python version is exactly 3.10.x - bpy fails to import outside that range and the whole pack won't register in ComfyUI.

No live preview panel. Needs --enable-cors-header on launch; without it, export the finished mesh via right-click → Save File on Avatar Main Output instead of watching it update live.

Categoryblender

Inputs (2)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
iterationsoptINT21–1000

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ