ComfyUI Node

?? UV preview

Look at Your UVs Before You Waste a Bake

By Antonioilev·Created 2 days ago·Updated a day ago· 0
?? UV preview
  • trimesh
    show_checkerfalse
    show_wireframetrue

    What it's actually for

    Baking, texture projection and material assignment all silently assume your UVs are sane. When they aren't, you find out three steps later, from the result. This node is the cheap checkpoint: a viewport right there in the graph, showing the mesh with its UV layout, so you can see stretched islands, overlaps, or "there are no UVs at all" before committing.

    It's an output node with no outputs. Its job is to render and report.

    How it works

    On each run the node copies your mesh, checks whether it actually carries UV data (a TextureVisuals with a non-empty, non-all-zero UV array - the all-zeros case catches meshes that have a UV attribute which is really just a placeholder), and then:

    • Exports a GLB preview into ComfyUI's output/ directory as preview_uv_<random>.glb.
    • If UVs exist, writes the raw UV array and face list to a matching preview_uv_<random>_uvdata.json next to it - that's what the viewer reads to draw the layout in 2D.
    • Computes UV bounds, whether the layout fits inside the unit square, vertex/face counts, and a watertightness flag, and pushes them into the node's UI data.
    • If there are no UVs, it swaps the visual for flat colours and stays alive in what the console calls "passive diagnostic mode" - you get the mesh viewport and a has_uvs: false, not an error.

    The graph side is an iframe pointing at the pack's own /viewer_uv.html, which is why this node needs the pack's web/ directory to be reachable. The console also prints a small report for whichever log-reader you are:

    >>> [ANTONIOILEV MONITOR] UV Detected: True
    >>> [ANTONIOILEV MONITOR] Watertight Integrity: NO
    

    Note the load-bearing detail: several of the pack's viewer scripts hardcode the extension path as /extensions/ComfyUI_Antonioilev/. If you cloned the repo under its default folder name - ComfyUI_Antonioilev_Lightpack - that URL won't resolve and you'll get a blank panel. Cloning into a folder named ComfyUI_Antonioilev fixes it. This is also the folder name the pack's own launch script assumes.

    The inputs that matter

    • trimesh - the mesh to preview. Everything else is cosmetic.
    • show_checker (default off) - overlay a checker pattern, which is the fastest way to see UV stretching and texel density. This is the toggle you'll actually use.
    • show_wireframe (default on) - draw the edges. Indispensable for spotting a 400-island explosion at a glance.

    No outputs - wire it anywhere, or leave it dangling off the end of a chain.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/Antonioilev/ComfyUI_Antonioilev_Lightpack.git ComfyUI_Antonioilev
    # restart ComfyUI, then hard-refresh the browser tab (Ctrl/Cmd+Shift+R)
    

    Or install "Antonioilev Light Pack" via ComfyUI Manager and rename the folder to ComfyUI_Antonioilev afterwards if the viewport comes up empty. No requirements.txt in the repo; __init__.py catches import errors and prints a count, so a missing package means a node that just isn't in the menu. This one needs trimesh and numpy.

    Where people get burned

    • Blank viewer panel. Almost always either the extension folder name mismatch above, or a browser cache holding an old script - hard-refresh before debugging anything else.
    • The viewport shows flat colours with no UV layout. That means no UVs were detected. It's the node working as designed, telling you to run an unwrap.
    • It writes GLB and JSON files to output/ every run. Harmless, but if you're running a loop you'll accumulate them; they're disposable.
    • It's a viewer, not a validator. "Watertight: NO" printed here is informational. If you want the strict check with the Euclidean number, use mesh_uv_watertight.
    CategoryAntonioilev/Viewers

    Inputs (3)

    NameTypeDefaultDescription
    trimeshTRIMESH
    show_checkeroptBOOLEANfalse
    show_wireframeoptBOOLEANtrue

    Outputs (0)

    No outputs