Custom ComfyUI nodes for advanced reprojections, point cloud processing, and camera-driven workflows.
- Overview
- Features
- Installation
- Node Categories
- Node Reference
- Workflows
- Example Workflows
- Contributing
- TODO List
A collection of ComfyUI custom nodes to handle diverse camera projections (pinhole, fisheye, equirectangular), depth‐to‐point cloud conversions, dynamic reprojections, and inpainting/outpainting pipelines. Use these nodes to craft complex VR and 3D‐aware image transformations with minimal setup.
- ⚡ Continuous Reprojection: Transform images and depth maps between projection models.
- 🌐 Point Cloud Pipelines: Convert depth to 3D, clean, transform, and reproject point clouds.
- 🎥 Camera Motion & Outpainting: Animate camera trajectories, perform text‐guided outpainting in arbitrary views.
- 📦 Modular Nodes: Groupable ComfyUI nodes for flexible graph composition.
- 🛠️ Example Workflows: Ready‐to‐use JSON workflows demonstrating reprojection, inpainting, and view synthesis.
-
Clone into your ComfyUI custom nodes folder:
git clone https://github.com/Alexankharin/camera-comfyUI.git custom_nodes/camera-comfyUI
-
System Dependencies (Ubuntu):
sudo apt-get update && sudo apt-get install build-essential ffmpeg libsm6 libxext6 -y
-
Python Requirements:
pip install -r custom_nodes/camera-comfyUI/requirements.txt
- Optional:
open3d
for GUI point cloud tools.
- Optional:
-
Additional Nodes (for certain workflows):
- Clone the following repositories directly into your
custom_nodes
folder: - Important: If the
ComfyUI-Flux-Inpainting
repository is cloned asComfyUI-Flux-Inpainting-main
, rename the folder toinpainting_flux
:mv custom_nodes/ComfyUI-Flux-Inpainting-main custom_nodes/inpainting_flux
- Clone the following repositories directly into your
-
Flux Models (Hugging Face):
pip install huggingface_hub huggingface-cli login
-
Restart ComfyUI to load new nodes.
-
ReprojectImage
,ReprojectDepth
,OutpaintAnyProjection
-
TransformToMatrix
,TransformToMatrixManual
-
DepthEstimatorNode
,DepthToImageNode
,ZDepthToRayDepthNode
CombineDepthsNode
,DepthRenormalizer
,FisheyeDepthEstimator
-
DepthToPointCloud
,TransformPointCloud
,ProjectPointCloud
,PointCloudUnion
PointCloudCleaner
,LoadPointCloud
,SavePointCloud
,ProjectAndClean
-
CameraMotionNode
,CameraInterpolationNode
,CameraTrajectoryNode
SaveTrajectory
,LoadTrajectory
,PointcloudTrajectoryEnricher
(See inline tooltips in ComfyUI for parameter details.)
Node | Description |
---|---|
ReprojectImage |
Reproject image between projection types (Pinhole, Fisheye, Equirectangular). |
ReprojectDepth |
Same as above but for depth maps. |
OutpaintAnyProjection |
Extracts a patch in any view, outpaints (Flux), reprojects back. |
DepthEstimatorNode |
Runs HF Depth‐Anything-v2 models to produce metric depth. |
DepthToPointCloud |
Converts Depth and image to → 3D point cloud tensor (N×7). |
DepthToImageNode |
Converts depth to image (N×3) using a color map. |
ZDepthToRayDepthNode |
Converts Z-depth (output of metric-depth-anything) to ray depth to compensate lens curvature. |
TransformPointCloud |
Applies 4×4 rotation matrix to point cloud. |
ProjectPointCloud |
Z-buffer–based projection of point cloud into image + mask. |
PointCloudCleaner |
Removes isolated points via voxel filtering. |
PointCloudUnion |
Combines multiple point clouds into one. |
LoadPointCloud |
Loads a point cloud from .npy or .ply format. |
SavePointCloud |
Saves a point cloud to .npy or .ply format. |
CameraMotionNode |
Generates image and mask sequences along a camera trajectory with optional mask dilation/inversion. |
CameraInterpolationNode |
Builds a trajectory tensor from two poses. |
CameraTrajectoryNode |
Interactive Open3D GUI for recording camera waypoints. |
SaveTrajectory |
Saves a trajectory tensor to a file. |
LoadTrajectory |
Loads a trajectory tensor from a file. |
VideoCameraMotionSequence |
Processes video frames and depth maps along a camera trajectory, generating reprojected outputs. |
DepthFramesToVideo |
Converts a sequence of depth maps into video frame tensors for saving. |
VideoMetricDepthEstimate |
Estimates metric depth for a sequence of frames using VideoDepthAnything. |
A set of JSON workflows illustrating typical use cases. Each workflow lives in workflows/
and can be loaded directly in ComfyUI.
Workflow | Description |
---|---|
demo_camera_workflow.json | Masked reprojection demo: pinhole → fisheye/equirect |
outpainting_fisheye.json | Text‐guided fisheye outpainting (built‐in inpaint node) |
outpainting_fisheye_flux.json | Flux‐based outpainting with clear reprojection scheme |
Outpaint_node_test.json | Test harness for the universal outpaint node |
Outpaint_fisheye180.json | 180° fisheye outpainting via OutpaintAnyProjection |
Fisheye_depth_workflow.json | Fisheye → metric depth → point cloud → PLY export |
Pointcloud.json | Metric‐depth‐anything v2 → point cloud → camera view synthesis |
pointcloud_inpaint.json | Inpaint + backproject to 3D for dynamic camera motion videos |
Pointcloud_walker.json | GUI‐based camera control via Open3D |
sbs180_workflow.json | Generate stereo (side-by-side) wide-angle/fisheye/equirectangular stereo pairs from a high-res input |
video_camera.json | Camera trajectory movement workflow using wan-vace for video inpainting. |
Basic reprojection pipeline: apply masks, rotate pinhole camera, outpaint fisheye, move point cloud, reproject.
Simplest text‐guided fisheye outpainting built with the core inpaint node.
Flux Inpainting ensures sharper results and explicit reprojection stages.
180° fisheye outpainting via the universal OutpaintAnyProjection
node.
Convert fisheye images to metric depth and generate a PLY point cloud.
Quick test for the universal outpaint node in arbitrary views and camera movement
Depth→PointCloud pipeline with interactive camera movement and reprojection views.
Inpaint image with shifted camera and backproject for dynamic camera‐driven video outputs.
Take a wide-angle (fisheye or equirectangular) high-resolution (e.g., 4096×4096) image and generate a stereo pair by moving the camera horizontally. The output is a wide-angle stereo pair (side-by-side), simulating a fisheye or equirectangular stereo camera.
Interactive Open3D-based GUI for walking and setting camera trajectory inside pointcloud.
This workflow demonstrates camera trajectory movement using the wan-vace
video inpainting model. It generates smooth camera movements along a trajectory while filling missing regions with high-quality inpainting.
A trajectory in camera-comfyUI is a sequence of camera poses, each represented as a 4×4 transformation matrix. This set of matrices defines the path and orientation of the camera through 3D space, enabling smooth and complex camera movements for view synthesis, point cloud rendering, and video generation.
There are two main ways to create a trajectory:
-
Camera Matrices Interpolation:
Define two or more camera poses (as matrices), and interpolate between them to generate a smooth path. TheCameraInterpolationNode
automates this process, producing a trajectory tensor for use in camera motion nodes. -
Walking in Open3D Environment:
Use the interactive Open3D GUI (CameraTrajectoryNode
) to "walk" through the point cloud. As you move the camera, waypoints (poses) are recorded, forming a trajectory that can be exported and reused.
The CameraMotionNode
takes a trajectory (set of matrices) and interpolates camera positions and orientations along it, producing smooth camera movements for rendering sequences or videos.
Point clouds can be saved and loaded in two formats:
- .npy: Numpy array format (fast, preserves all tensor data, recommended for internal pipelines).
- .ply: Polygon File Format (widely supported, viewable in external 3D tools).
Use the SavePointCloud
and LoadPointCloud
nodes to handle I/O operations in either format.
Contributions welcome! Please open issues or PRs to add features, improve docs, or refine workflows.
- Add processing to pointcloud or depthmap to remove outlier and lonely points at depth borders.
- Use built-in comfyUI mask type an image.
- Unite nodes into groups to simplify workflows.
- Create a single workflow for view synthesis.
- Implement easier and more flexible camera control - more complex camera movements with more than 2 points.
- Add more examples and documentation for each node.
- Add pointcloud union
- Fix imports for renamed folders (e.g., inpainting_flux)
- Integrate camera movement pipeline with video models (e.g., wan2.1) for smooth, high-quality inpainting along camera trajectories.