SAM3D Cam Shot Toolkit
Minimal SAM3D body reconstruction toolkit for calibrated camera-shot workflows in ComfyUI.
Nodes (10)
The Load SAM3D node with no settings (and a 2.8 GB first run)
The SAM3 person detector that knows Meta's repo is gated
Describe a pose-render camera in feet and degrees, not vibes
Turn a folder of pose GLBs into a scene ingredient
Where synthetic scenes become labeled training images
Save a pose once, reuse it in a thousand synthetic shots
Populate a floor with people who don't overlap
The payoff node that puts your person back in the shot
Turning one photo into a rigged 3D human, the honest version
The one node that gives you an actual rigged human
SAM3D Body ComfyUI Cam Shot Toolkit
Minimal ComfyUI custom node package for:
Cam Shot Toolkit: Load SAM3D ModelCam Shot Toolkit: Load SAM3 Person DetectorCam Shot Toolkit: Process ImageCam Shot Toolkit: Render Offset View
This repo is a focused extraction from a larger SAM3DBody node pack, trimmed for calibrated pose-to-camera-shot workflows.
Install
- Clone or copy this repo into
ComfyUI/custom_nodes/. - Install dependencies with ComfyUI-Manager or manually:
python -m pip install -r requirements.txt
- Restart ComfyUI.
This package installs into ComfyUI's active Python environment. It does not attempt to replace ComfyUI's existing torch / torchvision install. A working ComfyUI CUDA environment is expected already.
Registry Publishing
This repository is prepared for Comfy Registry publishing.
Before publishing:
- Set your real
PublisherIdinpyproject.toml. - Create a Registry publishing API key for that publisher.
- Publish with:
comfy node publish
Included
- SAM3D model loader with Hugging Face auto-download
- SAM3 person detector loader with official gated repo support and ungated mirror fallback for prompt-based multi-person detection
- single-image SAM3D processing node
- person selection for SAM3D outputs:
person_index=-1uses all detected people, while0..Nselects a specific detected person. When no mask is connected, nonzero selection modes automatically run a torchvision person detector so multi-person inputs produce multiple SAM3D crops. - calibrated offset renderer with pivot, background, and lighting controls
- interactive browser viewer for scouting the render camera with orbit, pan, roll, and dolly controls
- optional render
automode that ignores saved viewer camera state and realigns from each SAM3D input for API workflows - rigged GLB export (one named mesh + armature per person, matching capture camera)
- PoseRig node group for procedural pose-reference scenes (
CamShotToolkit/posing):Save Pose Rig— a reconstruction becomes a named rig asset:<set>/<label>.glb(rigged, feet on the floor, opens in Blender) plus arig.jsonentry with actor count, footprint, capture camera and source hash.Load Pose Rigs— reads a rig set back (numpy-only GLB reader).Camera Spec— real-unit mount (height / tilt / hfov / standoff / lateral) plus additive position and rotation offsets and per-axis seeded jitter ranges (0 = locked). Also emits theinteractive_statestring the offset renderer honours.Assemble Scene— rolls K actor groups (a weighted distribution) onto the floor with footprint clearance, in-frame and 2D occlusion checks; deterministic reroll-then-drop policy; pinned placements via JSON; per-actor mirror/yaw.Render Clay Grid— clay render of the assembled scene, a proximity-faded 1 ft floor grid drawn last and z-tested against the bodies, union + per-actor MASKs with optional dilation, and a scene manifest JSON (labels, actors, effective camera).
Node Categories
CamShotToolkitCamShotToolkit/processingCamShotToolkit/visualizationCamShotToolkit/ioCamShotToolkit/posing
Tests
tests/ covers the numpy core of the PoseRig group (no ComfyUI needed):
python -m pytest -c tests/pytest.ini --rootdir tests tests -q
Notes
- Model weights are downloaded automatically on first use into
ComfyUI/models/sam3dbody. - SAM3 detector weights are downloaded into
ComfyUI/models/sam3_person_detector. The detector loader triesfacebook/sam3first inautomode and falls back to an ungated mirror such asjetjodh/sam3if official access is gated. - The render node uses a self-contained NumPy mesh rasterizer. It does not use
pyrender, PyOpenGL, pyglet, OSMesa, or EGL. - The browser viewer remains a Three.js preview for camera scouting. The saved camera state is rendered by the backend rasterizer during workflow execution.
install.pyis intentionally a no-op for Registry compliance. Dependency installation should be handled by ComfyUI-Manager or an explicitpip install -r requirements.txt.
Donations & Support
If this saves you time, you can support the work here: