Nodes/ComfyUI libigl/Connected Components
ComfyUI Node

Connected Components

One mesh file, many floating parts — this splits them apart

By PozzettiAndrea·Created 10 months ago·Updated 5 days ago· 219
Connected Components
  • trimesh
  • trimesh
  • info

Load a scan or a downloaded model and it's frequently not one object at all - it's a bunch of separate floating pieces that happen to share a file. This node finds every connected component in your mesh and splits them out, which sounds trivial and turns out to be enormously useful. Connected Components is the pack's analysis-and-separate node: give it a TRIMESH, and instead of one output you get a list of TRIMESH outputs - one per disconnected island of geometry - plus an info string.

There's exactly one required input and no parameters. You just feed it a mesh.

The interesting bit is the output shape: trimesh is marked as a list, which is the pack's way of telling you this node produces multiple meshes. In ComfyUI terms that means the output is meant to be consumed by list-aware nodes - iterate over the parts, or process each component separately, rather than trying to wire it straight into a single-mesh input. It's genuinely handy for:

  • Cleaning up a scanned scene where "one file" is actually a room full of objects.
  • Finding the main object vs. the debris - process the big component, discard the specks.
  • Prepping for per-object processing: each component gets its own remesh, its own UV unwrap, its own save.

Where it fits

It's a diagnostic and a preprocessor at the same time. Before you remesh a "model" that's secretly six pieces, splitting them means each piece gets clean, sensible topology instead of a remesher trying to bridge gaps. And for those of us who've chased a phantom error through a pipeline where the real problem was a stray disconnected triangle nobody saw - this node is how you find out.

Install

Standard pack install:

cd ComfyUI/custom_nodes
git clone https://github.com/PozzettiAndrea/ComfyUI-GeometryPack.git
cd ComfyUI-GeometryPack
pip install -r requirements.txt --upgrade
python install.py

Or ComfyUI Manager → search GeometryPack. README caveats as always: experimental comfy-env/pixi install with a big first download, and a repo under fast development where the author wants issues reported in Discussions.

The practical note

If your whole pipeline is single-mesh, the list output can look like an obstacle - but the workaround is easy: put the components back into one workflow-friendly mesh, or just process them one at a time and save each. One genuine gotcha: components are judged by connectivity, not by touch. Two parts that overlap or touch at a point may still count as separate components (vertex-sharing is the test), so don't be surprised when a single 3D-printed-looking object reports as several pieces - that's the tool working as intended.

Categorygeompack/analysis

Inputs (1)

NameTypeDefaultDescription
trimeshTRIMESH

Outputs (2)

NameTypeDescription
trimeshTRIMESH
infoSTRING