Nodes/ComfyUI libigl/Preview Mesh Batch (VTK)
ComfyUI Node

Preview Mesh Batch (VTK)

Flip through a whole batch of meshes in one scientific viewer

By PozzettiAndrea·Created 10 months ago·Updated 4 days ago· 218
Preview Mesh Batch (VTK)
  • trimesh
    modefields
    index0

    The plain preview viewer shows you one mesh. A batch loader hands you forty. Between them sits the gap this node fills: Preview Mesh Batch (VTK) renders a list of meshes in a VTK.js viewer with index navigation, so you can flip through the results of a batch pipeline like a contact sheet. Load a folder, process every mesh, and instead of forty separate preview widgets you get one viewer and a "next" button.

    It's part of ComfyUI-GeometryPack ("ComfyUI libigl") by Andrea Pozzetti. It's the batch member of the viewer family, alongside the single Preview Mesh (Three.js) and the multi-input Preview Mesh Multi - the difference is that this one takes a list, which is what batch workflows actually produce.

    How it works

    The trimesh input is the list from a loader like Load Mesh Batch or Load Mesh (Glob). The mode combo picks the rendering style, same as the other VTK-family viewers:

    • fields (default) - scientific visualization: meshes carrying scalar fields (curvature, distance, whatever a processing node stamped on them) render colorized. This is the mode that makes batch analysis possible - you're not just looking at shapes, you're looking at shapes colored by their metrics.
    • texture - textured rendering for meshes with real materials.

    The index input (default 0, range 0–100) is which mesh the viewer starts on. That's mostly a "where do I land when it opens" control - once the widget is up, navigation is click-through in the browser - but it's also the seed for the one genuinely clever trick: feed index from a graph variable and the initial view can be driven by logic, not luck.

    The node does its own export decision under the hood: it checks whether the mesh has scalar fields or is a point cloud, and picks VTP export when either is true (STL can't carry fields or point clouds), falling back to STL otherwise.

    When it's the right node

    • Batch QA - forty decimated meshes, one viewer, click through to find the three that broke.
    • Field inspection at scale - every mesh carrying a quality or distance field, colorized, so patterns across the batch show up instead of getting buried.
    • Pipeline confirmation - the output of a full load → process → batch flow, verified in one place.

    It's an output node with no outputs; its entire output is the experience of flipping through your batch.

    Install and caveats

    Pack standard: search "GeometryPack" in ComfyUI Manager, or:

    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
    

    Restart after. The comfy-env installer pulls pixi and a heavy isolated environment on first launch, and the VTK viewers are copied into place at startup - a blank viewer after an update is restart-first, reinstall-second.

    The realistic limits: it's built for browsing, not deep inspection - when one mesh in the batch turns out to be the problem, pull it out into the single viewer to study it. And since it's VTK.js-based with fields mode as the default, it's heavier than the Three.js viewer; for a quick no-fields look at a small batch, the plain viewer per mesh is lighter. For "I processed a folder and need to check it," this is the node.

    Categorygeompack/visualization

    Inputs (3)

    NameTypeDefaultDescription
    trimeshTRIMESH
    modeCOMBOfields2 options: fields, texture
    indexINT00–100

    Outputs (0)

    No outputs