SplatPolish
Running a real 3DGS optimization pass inside ComfyUI
- splats
- frames
- trajectory
- polished_splats
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.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| splats | GSPLAT | — | |
| frames | IMAGE | Ground-truth frames [T,H,W,3]. | |
| trajectory | TENSOR | [T,4,4] world-to-camera matrix per frame. | |
| horizontal_fov | FLOAT | 60.001–179 | — |
| iterations | INT | 3001–100000 | — |
| lr_xyz | FLOAT | 0.00020–1 | — |
| lr_rest | FLOAT | 0.00250–1 | Base learning rate for non-position parameters (3DGS-style ratios applied per group). |
| lambda_l1 | FLOAT | 0.800–10 | — |
| lambda_dssim | FLOAT | 0.200–10 | — |
| opacity_reg | FLOAT | 0.010–1 | — |
| allow_torch_fallback | BOOLEAN | false | Without gsplat+CUDA, optimize through the differentiable torch renderer at reduced resolution. EXTREMELY slow; expect minutes per 100 iterations. |
| deviceopt | COMBO | auto | 3 options: auto, cpu, cuda |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| polished_splats | GSPLAT | — |