Nodes/camera-comfyUI/SplatPolish
ComfyUI Node

SplatPolish

Running a real 3DGS optimization pass inside ComfyUI

By Alexankharin·Created about a year ago·Updated about a month ago· 36
SplatPolish
  • splats
  • frames
  • trajectory
  • polished_splats
horizontal_fov60.00
iterations300
lr_xyz0.0002
lr_rest0.0025
lambda_l10.80
lambda_dssim0.20
opacity_reg0.01
allow_torch_fallbackfalse
deviceauto

The splats you get from lifting images with SHARP are good but not great - the colors and positions are predictions, and they don't quite agree with the actual video frames you have. SplatPolish is the fix: it takes a world-frame splat cloud and runs a genuine 3D Gaussian Splatting optimization pass against your posed video frames, using gsplat's differentiable rasterizer with an L1 + D-SSIM photometric loss. In other words, it's the standard 3DGS training loop, exposed as a ComfyUI node.

This is where the pack stops being a camera-simulation toolkit and starts being a 3D reconstruction pipeline. In the video_to_4d_world workflow, VideoToFusedSplats assembles a static world cloud from keyframes, and SplatPolish fine-tunes it - nudging every Gaussian's position, scale, rotation, opacity, and color so the cloud re-renders the input frames as faithfully as possible. If the fused cloud looks soft or ghosty, polish is what sharpens it.

How it works

You feed it splats, the ground-truth frames [T,H,W,3], and the matching trajectory [T,4,4] world-to-camera poses plus horizontal_fov. Each iteration renders the cloud from a randomly sampled frame's pose and compares against the real frame - photometric error, weighted by lambda_l1 (0.8) and lambda_dssim (0.2) - then takes a gradient step. lr_xyz (default 0.00016) drives position updates, lr_rest (0.0025) the appearance/scale/rotation groups, and opacity_reg (0.01) keeps opacity honest. iterations (default 300) is how long to train; more is smoother, slower, and eventually overfits.

The output is a single polished_splats GSPLAT, ready to render, save, or hand to the 4D pipeline.

The gsplat requirement - read this

SplatPolish genuinely needs gsplat with CUDA. Without it the node raises a clear error unless you flip allow_torch_fallback, which routes optimization through a pure-torch differentiable renderer at reduced resolution - and the README is blunt about how bad that is: minutes per 100 iterations. install.py installs gsplat (its CUDA kernels JIT-compile on first use), so if you're getting the error, re-run install.py and confirm you have a CUDA GPU with a matching PyTorch build. This is one of the few nodes in the pack where "my machine can't do this" is a real, legitimate answer.

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

The gsplat step is what matters here; re-run install.py if it failed or you upgraded PyTorch.

Common issues

  • "SplatPolish requires gsplat with CUDA" - either gsplat isn't installed or you're on CPU. Re-run install.py; verify torch.cuda.is_available().
  • Slow optimization - that's the torch fallback running. Get gsplat working; it's not a tuning problem.
  • Cloud gets worse with more iterations - overfitting to the frames; drop iterations, or your poses/fov don't match the frames and the loss can't converge. Double-check trajectory and fov against the actual camera.
  • VRAM pressure - the node deliberately streams frames one at a time to keep the whole clip off the GPU, but the rasterizer + optimizer state is still real memory. Use fewer iterations or lower frame resolution.
CategoryCamera/GSplat

Inputs (12)

NameTypeDefaultDescription
splatsGSPLAT
framesIMAGEGround-truth frames [T,H,W,3].
trajectoryTENSOR[T,4,4] world-to-camera matrix per frame.
horizontal_fovFLOAT60.001–179
iterationsINT3001–100000
lr_xyzFLOAT0.00020–1
lr_restFLOAT0.00250–1Base learning rate for non-position parameters (3DGS-style ratios applied per group).
lambda_l1FLOAT0.800–10
lambda_dssimFLOAT0.200–10
opacity_regFLOAT0.010–1
allow_torch_fallbackBOOLEANfalseWithout gsplat+CUDA, optimize through the differentiable torch renderer at reduced resolution. EXTREMELY slow; expect minutes per 100 iterations.
deviceoptCOMBOauto3 options: auto, cpu, cuda

Outputs (1)

NameTypeDescription
polished_splatsGSPLAT