π IG PointCloud From Depth
Turn an RGB image and a metric depth map into a real 3D point cloud
- rgb_image
- depth_image
- pointcloud
IG PointCloud From Depth is where this pack stops being about images and starts being about geometry. It takes an RGB image plus a metric depth map and projects every pixel into 3D space, producing a point cloud tensor - [N, 6] of (x, y, z, r, g, b) - that you can save as a PLY and open in any 3D viewer. It's the node that turns a flat frame and its depth estimate into something you can walk around.
The model is a plain pinhole camera. For each pixel (u, v) with depth d, it computes X = (u - c_x) Β· d / f, Y = (v - c_y) Β· d / f, Z = d, where f is the focal length in pixels and (c_x, c_y) is the principal point. If you leave the intrinsics at their defaults (-1), the node fills them in sensibly: focal length defaults to the image width, and the principal point defaults to the image center. Depth values are used as radial distance in whatever unit your depth map carries - typically meters.
Inputs:
- rgb_image -
IMAGE, color channels in 0β1. - depth_image -
IMAGE, metric depth in the same resolution. - focal_length_px -
FLOAT, default-1(= image width). Lower focal length = wider field of view and more apparent distortion at the edges. - principal_x_px / principal_y_px -
INT, default-1(= image center). - stride -
INT, default1. Sub-sample every Nth pixel in each direction;stride = 2gives you a quarter of the points. This is your point-count governor - full-res depth maps produce millions of points, and dropping tostride = 4often looks identical in a viewer.
Output: pointcloud - the [N, 6] tensor (RGB scaled to 0β255). Batch size must be 1 and the two images must match resolution, or it raises.
The dependency that matters is upstream: you need a metric depth estimator, not a relative one. MiDaS gives relative depth (ordering, not meters), which will produce a squashed, wrong-looking cloud. Depth Anything v2 and ZoeDepth output real metric values - that's the family you want. The KB's own history here is instructive: the community found metric models geometrically more accurate but softer-edged than MiDaS for ControlNet work - for point clouds, you want the metric side of that tradeoff. ComfyUI's ControlNet Auxiliary Preprocessors can produce the depth map; this node does the projection, it never estimates depth itself.
Install is the pack standard:
cd ComfyUI/custom_nodes
git clone https://github.com/IDGallagher/ComfyUI-IG-Nodes
cd ComfyUI-IG-Nodes && pip install -r requirements.txt
Or ComfyUI Manager β search "IG Interpolation Nodes" β Install, restart. Then pair it with IG Save PLY PointCloud to write the result to disk. The README is :), so the camera math above is straight from nodes/pointcloud_from_depth.py.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| rgb_image | IMAGE | β | |
| depth_image | IMAGE | β | |
| focal_length_px | FLOAT | -1-1β99999999 | β |
| principal_x_px | INT | -1-1β99999999 | β |
| principal_y_px | INT | -1-1β99999999 | β |
| stride | INT | 1 | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| pointcloud | POINTCLOUD | β |