Nodes/ComfyUI_Antonioilev_Lightpack/🧩 CapGPU (Advanced Sealer)
ComfyUI Node

🧩 CapGPU (Advanced Sealer)

The 'GPU' in the name is a lie, but the sealer works

By AntonioilevΒ·Created 2 days agoΒ·Updated a day agoΒ· 0
🧩 CapGPU (Advanced Sealer)
  • mesh
  • info
  • mesh
β—„modesimple_triangulateβ–Ί
β—„offset_down0.15β–Ί
β—„bottom_segments24β–Ί
β—„relaxation_rings4β–Ί
β—„squeeze_power1.2β–Ί
β—„bottom_radius_xy0.60β–Ί
β—„cap_scale_x1.00β–Ί
β—„cap_scale_z1.00β–Ί
β—„cap_rotate0β–Ί
β—„cap_flip_directionfalseβ–Ί
β—„cap_shift_x0.00β–Ί
β—„cap_shift_z0.00β–Ί
β—„invert_capfalseβ–Ί

Three seconds after you generate your first image-to-3D mesh you discover the bottom is missing. That is not a bug - a Hunyuan3D or TRELLIS reconstruction only builds what the camera could see, so a bust, a statue or a helmet comes back with a ragged open rim where the object continues off-frame. CapGPU's whole job is to close that rim so the mesh becomes something a slicer, a boolean, or a physics engine will accept.

It is called "GPU" and it touches no GPU. The file is numpy over trimesh. Whatever. It does the job.

What it actually does

It finds the boundary edges of your mesh (edges used by exactly one face), builds a graph from them, and extracts the cycles - then takes the largest loop. That's the rim. Everything else it does is about what it grows out of that rim.

mode gives you two answers. On simple_triangulate it drops a single new vertex at the rim's centroid, pushes it along the rim's plane normal by offset_down Γ— the rim's average radius (0.15 by default - so 15% of the hole radius), and fans triangles from the rim to that point. That's a flat-ish plug. On advanced_cap it instead builds interpolation rings from your original rim out to a circular target ring, sized by bottom_radius_xy (a multiple of the rim radius), stretched by cap_scale_x / cap_scale_z, rotated by cap_rotate degrees, and pushed down by abs(offset_down) Γ— the model's Y extent, converging on a tip. That's a plinth, or a socket, or a decorative pedestal bottom.

One thing that trips people: in advanced_cap "down" is -Y, not -Z. That's the glTF convention and it's right for Hunyuan/Trellis output, but if you fed it a Z-up mesh you'll get a cap growing out the side of your model. If the new geometry appears sideways, that's why.

Second trap, straight from the source: the mode switch is overridden by relaxation_rings. If that's 0, you get the simple fan even if you selected advanced_cap. Rings are the advanced path; zero rings means there's nothing to interpolate.

The inputs worth touching

  • mesh - the TRIMESH socket. Anything in the ComfyUI 3D ecosystem plugs in: core Load3D, 3D-Pack output, this pack's own LoadMesh.
  • mode - pick simple_triangulate for a print, advanced_cap when you want a shaped base.
  • offset_down - the only dial that matters in simple mode. Positive moves the plug away from the model; invert_cap flips it the other way, which is what you want when the rim's winding came back inside out.
  • relaxation_rings (advanced only) - how many rings between your messy rim and the clean circular target. 3–5 smooths a ragged rim nicely; 0 silently demotes you to simple mode.
  • invert_cap - flips the direction the cap is offset, and the only other parameter simple mode reads.
  • bottom_segments, squeeze_power, bottom_radius_xy, cap_scale_x/z, cap_rotate, cap_flip_direction, cap_shift_x/z - the shaping block for the pedestal. All ignored in simple mode.

Outputs are info (a STRING report: loop size, mode, faces added, whether the result is watertight, and how long it took) and mesh. info is slot one. Wire mesh from the second output - the classic mistake with this pack is dragging the first socket and getting a string where a mesh should be. Actually read the string once; watertight=True is the receipt that it worked, and No boundary loops found is the honest failure message.

Install

ComfyUI Manager β†’ search Antonioilev Light Pack, or:

cd ComfyUI/custom_nodes
git clone https://github.com/Antonioilev/ComfyUI_Antonioilev_Lightpack.git

Then restart. There is no requirements.txt and no install.py in this repo, so nothing gets installed for you, ever. This node needs trimesh and networkx in the same Python environment ComfyUI runs in:

python -m pip install trimesh networkx

Run pip against ComfyUI's own interpreter (portable build: python_embeded\python.exe). The pack's loader is defensive: it prints [Antonioilev_Light_pack] Loaded N nodes (M failed) at startup, so if CapGPU is absent from the node menu, that line plus a !!! CapGPU: No module named ... under it is your answer.

When it misbehaves

It capped the wrong hole. It always takes the largest loop, so on a mesh with a neck opening larger than the bottom rim, you get a neck plug. Compare the Largest loop: N verts figure against what you expected, and if it's wrong, close the other hole first or reshape the mesh so the intended rim is the bigger one.

No boundary loops found means the mesh is already closed (nothing to do) or the boundary is non-manifold and the edge test can't see it - run a repair pass first (MeshFixer Fast, Mesh One Surface), then cap.

Looks fine in the preview, black in the viewer. The new faces inherited the wrong winding. Smart Normals Conform afterwards is the cheap fix.

Typical chain: generate β†’ cap β†’ MeshFixer Fast for the rest of the grit β†’ Composite Mesh Saver to .stl for the printer. The cap is what turns "impressive render" into "manifold object", and for printing that's the entire difference between a demo and a part.

CategoryAntonioilev/Mesh

Inputs (14)

NameTypeDefaultDescription
meshTRIMESHβ€”
modeCOMBOsimple_triangulate2 options: simple_triangulate, advanced_cap
offset_downFLOAT0.15-2–2β€”
bottom_segmentsINT243–128β€”
relaxation_ringsINT40–20β€”
squeeze_powerFLOAT1.20.1–10β€”
bottom_radius_xyFLOAT0.600.01–3β€”
cap_scale_xFLOAT1.000.1–5β€”
cap_scale_zFLOAT1.000.1–5β€”
cap_rotateFLOAT00–360β€”
cap_flip_directionBOOLEANfalseβ€”
cap_shift_xFLOAT0.00-2–2β€”
cap_shift_zFLOAT0.00-2–2β€”
invert_capBOOLEANfalseβ€”

Outputs (2)

NameTypeDescription
infoSTRINGβ€”
meshTRIMESHβ€”