A simple set of nodes to generate a point cloud from an image and its depth map, perform transformations and some basic operations.
A simple set of nodes to generate a point cloud from an image and its depth map, perform transformations and some basic operations.
Here an example of what can be done (not the gif, but the various rotations)
<div class="grid" align="center" markdown> <img src=".//assets/start.jpg" width=40%> <img src=".//assets/gif.gif" width=40%> </div>On the console in the custom_nodes filder execute:
git clone https://github.com/chri002/ComfyUI_depthMapOperation
these nodes require in order to function:
GPU-accelerated version using PyTorch tensors. Maintains gradient flow and supports automatic device placement.
Input Parameters:
image
: Input RGB/RGBA imagedepth_image
: Depth map imagedepth
: Z-axis scaling factor (1-1024)quality
: Downsampling quality (1=1 point:1 pixel , 16=16 interpolate points every 2 pixel)Output:
Points3D
: XYZ coordinates + RGB colorsApplies 3D transformations to point clouds (rotation, translation, scaling).
Input Parameters:
points
: Input point cloud (Points3D)rot_x/y/z
: Euler angles in degreestrl_x/y/z
: Translation offsetsscale_x/y/z
: Axis-specific scaling factorsOutput:
Points3D
: Transformed point cloud (XYZ coordinates + RGB colors)Renders 3D points to 2D image using orthographic projection.
Input Parameters:
images
: Template for output dimensionspoints
: Point cloud to render (Points3D)color
: Enable RGB coloringOutput:
IMAGE
: Rendered grayscale/RGB imagePerspective projection renderer with customizable FOV.
Input Parameters:
images
: Template for output dimensionspoints
: Point cloud to render (Points3D)color
: Enable RGB coloringfov
: Field of View in degrees (1-2000)Output:
IMAGE
: Rendered grayscale/RGB imageFilters points within relative cube dimensions (0-100% of original bounds).
Input Parameters:
points
: Point cloud to render (Points3D)Output:
Points3D
: Subset of points within cube (XYZ coordinates + RGB colors)Removes outliers using KDTree neighborhood analysis.
Parameters:
points
: Point cloud to render (Points3D)k
: Minimum neighbors requiredm
: Max neighbor distance thresholdOutput:
Points3D
: Cleaned point cloud (XYZ coordinates + RGB colors)Generates new points through neighborhood-based interpolation using KDTree. Enhances point cloud density in sparse regions by creating intermediate points between existing neighbors.
Input Parameters:
points
: Input 3D point cloudvalue
: (0-1) Blend ratio for new points (0=keep original, 1=full interpolation)n
: Number of nearest neighbors to consider (0-32)Output:
Points3D
: Point cloud with added interpolated points (XYZ coordinates + RGB colors)Exports point cloud to PLY format (ASCII/binary).
Input Parameters:
points
: Point cloud to render (Points3D)multiple_files
: Split XYZ/RGB dataformat_out
: File encoding formatImport PLY point cloud files into compatible Point3D format. (Sperimental)
Input Parameter:
.ply
file selectionOutput:
Points3D
: Loaded point cloud data (XYZ coordinates + RGB colors)Displays point cloud statistics and coordinate ranges.
Output:
STRING
: Formatted summary text