Voxel Viewer
See a single voxel block in 3D, right inside the node — this viewer actually works
- voxel_block
Voxel Viewer is the one you'll actually reach for while fiddling with this pack: feed it a single VOXEL_BLOCK and it renders the thing in a 3D viewport inside the node - spin it with your mouse, zoom in, admire the voxelization. It's one of the two nodes here with a working frontend (the other is Voxel Video Preview), and it's the fastest way to sanity-check anything that comes out of Mesh To Voxel.
How it works
The Python side takes voxel_block (VOXEL_BLOCK), flattens the N×N×N×4 array into the pack's hex format - each voxel becomes null or a #rrggbbaa string - and sends it to the browser under a voxel_block UI key. The JavaScript (useless_extension.js, which does at least one useful thing despite the name) catches that payload and builds a THREE.Group: one unit cube per occupied voxel, colored straight from the hex value. A grid helper, ambient light, and OrbitControls give you a scene you can pan and spin. It's straightforward, it's fast for small grids, and it makes the whole pack feel less like a headless experiment.
The one input
- voxel_block (
VOXEL_BLOCK) - a single block, e.g. from Mesh To Voxel. Note it takes one block, not a list - the multi-frame equivalent in this pack is Voxel Video Viewer, which (fair warning) has no working frontend. For a single block, this is the node.
No outputs, no settings. Terminal preview node.
What will trip you up
- The viewer is only as good as the block's colors. The cube colors come straight from the block's RGB values. Blocks out of Mesh To Voxel carry averaged vertex colors, so a mesh with no vertex colors renders as black voxels - which looks broken but is just the data. And never feed it output from Voxelize Mesh: that node writes x/y/z coordinates into the color channels, so the "colors" you see are positions.
- Grid size is the performance lever. Every occupied voxel becomes a separate box mesh. At the default 20³ (up to 8000 cubes) it's fine. Crank
voxel_sizetoward 100 and the browser will start to sweat. If you want high resolution and a smooth viewer, that combination doesn't really exist in this pack - keep the preview grid small and save the big one to disk. - It re-executes every run.
IS_CHANGEDis random, same as the rest of the pack, so the node always runs. Harmless, just don't expect caching to skip it.
Installing it
Standard pack install; three.js is bundled inside the pack's web/ directory so nothing extra is downloaded, and the viewer pops up in the node's canvas after a restart:
# ComfyUI Manager: search "ComfyUI-Voxels", or:
cd ComfyUI/custom_nodes
git clone https://github.com/DanielHabib/ComfyUI-Voxels
# restart ComfyUI
It's the same single-commit, September-2024 pack with no requirements.txt - but of all the nodes in it, this one is the most pleasant surprise: simple, works as described, and gives you a real 3D look at what you're building.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| voxel_block | VOXEL_BLOCK | — |
Outputs (0)
No outputs