Nodes/ComfyUI-Voxels/Voxel Block Loader
ComfyUI Node

Voxel Block Loader

Load a whole folder of saved voxel blocks as a frame list, in one shot

By DanielHabib·Created 2 years ago·Updated 2 years ago· 4
Voxel Block Loader
    • voxel_blocks
    voxel_block_directory

    Voxel Block Loader is the read-half that pairs with Voxel Block Saver: point it at a directory of saved 6dv JSON files and it hands you a list of VOXEL_BLOCK arrays - one per file. It's the bridge between "I saved a bunch of blocks" and "now make them a video."

    How it works

    The node takes one string input - voxel_block_directory - and globs every *.json file in that folder. For each one it parses the pack's 6dv format, reads Dimensions to learn the grid size, then walks the flat Blocks array and unpacks each hex string back into a uint8 RGBA array. Every file is treated as a single frame (data["Blocks"][0]), so a folder of N saved blocks gives you N voxel blocks.

    Here's the important part about the output: it's a list. The node sets OUTPUT_IS_LIST = True, so when you wire it into Voxel Blocks Into Voxel Video, you're feeding frames, not a single block. That's the whole point of loading by folder instead of one file at a time - your directory is the frame sequence.

    What you should know before you point it at a folder

    • It reads everything with .json in that directory. The 6dv files from the saver look like any other JSON. Drop a ComfyUI workflow JSON or some random config in there and the node will try to parse it as a voxel block and produce garbage or crash. Keep saved blocks in their own folder.
    • No validation, no error handling. A wrong path just errors the node. There's no file picker either - you type the path, and paths are relative to ComfyUI's working directory, so a saver-written block at output/voxel_blocks/ is loaded as output/voxel_blocks.
    • Single-frame assumption. If you ever have a multi-frame 6dv file (with several entries in Blocks), only the first frame is read. Each file should be one block.

    Inputs and outputs

    • voxel_block_directory (STRING) - the folder path. The one and only input.
    • Output voxel_blocks (VOXEL_BLOCK, list) - wire this straight into the video maker, or into a list-capable viewer.

    Installing it

    The usual pack install; no requirements.txt, though this particular node only really needs numpy, which ComfyUI already has:

    # ComfyUI Manager: search "ComfyUI-Voxels", or:
    cd ComfyUI/custom_nodes
    git clone https://github.com/DanielHabib/ComfyUI-Voxels
    # restart ComfyUI
    

    This node does what it says and round-trips correctly with the saver, which puts it firmly in the "working half" of this pack. It's thin, it's unmaintained (last commit September 2024), but for its one job - folder of frames in, list of blocks out - it's fine.

    CategoryVoxels

    Inputs (1)

    NameTypeDefaultDescription
    voxel_block_directorySTRING

    Outputs (1)

    NameTypeDescription
    voxel_blocksVOXEL_BLOCK