Nodes/Avatar Graph/Mesh Remove Doubles
ComfyUI Node

Mesh Remove Doubles

ComfyUI Node Guide

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Mesh Remove Doubles
  • BPY_OBJ
  • BPY_OBJ
threshold0.00
use_unselectedfalse
use_sharp_edge_from_normalsfalse

This is one of the more genuinely useful nodes in Avatar Graph, Avatech's node pack for building interactive 2.5D avatars inside ComfyUI. If you've ever generated or edited a mesh programmatically and ended up with weird shading artifacts or a mesh that just feels "wrong" when deformed, duplicate vertices are usually the culprit - and this node is the fix.

Mesh Remove Doubles wraps Blender's bpy.ops.mesh.remove_doubles operator directly. Fun naming note: in modern Blender's UI this same operator is labeled "Merge by Distance," but the underlying operator ID never changed, which is why the node keeps the old name. Avatar Graph embeds Blender's Python API (bpy) inside ComfyUI, so this - like most of the pack's mesh nodes - is a literal passthrough of a real Blender mesh-editing tool rather than something Avatech built from scratch.

What it actually does: it merges any vertices that sit within a set distance of each other into a single vertex. This matters a lot when meshes are generated programmatically - Avatar Graph builds mesh layers from segmented image parts, joins meshes together, and runs boolean-ish operations, all of which are classic sources of coincident or near-coincident vertices at seams. Duplicate verts cause shading seams, break UV unwrapping, and can make deformation (like the Shape Flow blink/lipsync rigging this whole pack exists for) look glitchy at the joints. Running this after any mesh-generation or mesh-join step is cheap insurance.

The inputs worth knowing:

  • threshold - the distance below which two vertices get merged, in Blender units. The tiny default (about 0.0001) only catches truly coincident verts; if you're still seeing seam artifacts after running this, try bumping it up a bit - but go too high and you'll accidentally weld vertices that were never supposed to touch, collapsing detail you wanted to keep.
  • use_unselected - whether to also consider unselected geometry when merging. Leave this off unless you specifically want to merge across a selection boundary.
  • use_sharp_edge_from_normals - marks edges as sharp based on face normal angle during the merge. Niche; leave it off unless you're chasing a specific shading issue.

Output is the same BPY_OBJ, cleaned up and ready for the next step - commonly a UV unwrap or a shading pass right after this.

Installing it: there's no standalone install for this one node - you get it as part of the full Avatar Graph pack. Simplest route is ComfyUI Manager, searching "Avatar Graph" or avatar-graph-comfyui. Manual install: cd ComfyUI/custom_nodes, git clone https://github.com/avatechai/avatar-graph-comfyui, cd in and pip install -r requirements.txt, then restart.

The gotcha that actually causes install failures: Avatar Graph requires Python 3.10.x, because the bpy package it depends on only publishes wheels for that exact version. Running a newer Python (very common if you set up ComfyUI recently) means the install just won't work - the README itself recommends a dedicated environment (conda create --name comfyui python=3.10) rather than trying to shoehorn it into whatever you're already running. For the live preview in Avatech's own web editor you also need --enable-cors-header on launch (add --force-fp16 on Mac); without it you still get full functionality, just no live in-browser preview - export .glb/.gltf and view it in Blender instead.

Keep in mind the pack is explicitly labeled work-in-progress by its own README, so minor behavior shifts between updates aren't a bug report, they're just where the project is. And since BPY_OBJ is specific to this pack, this node only does anything useful wired to a mesh that came from earlier in an Avatar Graph chain.

Categoryblender

Inputs (4)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
thresholdoptFLOAT0.009.999999974752427e-7–50
use_unselectedoptBOOLEANfalse
use_sharp_edge_from_normalsoptBOOLEANfalse

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ