Nodes/camera-comfyUI/SaveSplats4D
ComfyUI Node

SaveSplats4D

Archiving a whole 4D scene so the motion survives the session

By Alexankharin·Created about a year ago·Updated about a month ago· 36
SaveSplats4D
  • splats4d
    filename_prefixComfyUISplat4D
    export_ply_framesfalse

    A GSPLAT4D scene is more than a pile of Gaussians - it's the canonical splat cloud plus the track trajectories and time values that make objects move when you sweep time. That's a chunky, structured object, and it's exactly the kind of thing you don't want to rebuild from scratch every session. SaveSplats4D writes the whole scene to disk as a compressed .npz archive - canonical splats, the trajectory control points, their per-point time values, and the optional static background - so LoadSplats4D can bring it back intact later.

    Why bother? Building a 4D scene is the most expensive thing this pack does: VGGT pose estimation, motion masking, SHARP splat fusion, SplatPolish optimization, CoTracker3 tracking, and BuildSplats4D on top. That's a lot of GPU-hours to re-run because you want to render a different camera path next week. Save the scene once, and rendering becomes cheap - feed the loaded scene into RenderSplats4DFrame or RenderSplats4DVideo with any new trajectory and re-render as much as you like. The README's TODO list notes the current .npz stores raw tensors (a compressed export format is on the roadmap), so files are honest about their size.

    The inputs

    • splats4d - the GSPLAT4D scene.
    • filename_prefix - default ComfyUISplat4D; supports %date:yyyy-MM-dd% format tokens, counter appended.
    • export_ply_frames - default false. Flip it true and the node also evaluates the scene at each stored time value and writes one standard 3DGS .ply per timestep. That's how you hand a 4D animation to an external viewer or tool that only understands static splats: a folder of frame PLYs you can loop.

    It's an output node, so nothing comes out the right side - you get a UI entry for the .npz (and the per-frame PLYs, if enabled) in ComfyUI/output/.

    How it works

    The save is numpy-based: the canonical splat tensors are packed into the archive alongside trajectories and times, plus rotations and static when present, and written with np.savez_compressed. Loading reverses it. One practical note: if you enabled export_ply_frames, the per-frame PLY export can take a while for a long scene - each timestep is a full at_time evaluation plus a PLY write. If you're just checkpointing work, leave it off and export PLYs only when you need them.

    Installing it

    Part of camera-comfyUI. Manager → Custom Nodes Manager → camera-comfyUI → Install → restart, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Alexankharin/camera-comfyUI.git
    cd camera-comfyUI && python install.py
    

    Saving needs no optional deps; building a scene to save needs the heavy stack (vggt, SHARP, gsplat), which install.py sets up.

    Common issues

    • No file appears - check it's the end of a real scene; the node needs a valid GSPLAT4D (usually from BuildSplats4D or LoadSplats4D).
    • .npz is surprisingly large - raw tensors, per the roadmap. If size is a problem, export only the PLYs you need and skip the archive.
    • PLY export is slow - expected per-timestep work. Reduce the scene's time samples if you don't need every frame.

    Save the world, move on to rendering it.

    CategoryCamera/GSplat4D

    Inputs (3)

    NameTypeDefaultDescription
    splats4dGSPLAT4D
    filename_prefixSTRINGComfyUISplat4DPrefix for the .npz file. You can include format-tokens like %date:yyyy-MM-dd%.
    export_ply_framesBOOLEANfalseAlso write one 3DGS .ply per timestep (evaluated via at_time).

    Outputs (0)

    No outputs