ComfyUI > Nodes > camera-comfyUI > ReprojectDepth

ComfyUI Node: ReprojectDepth

Class Name

ReprojectDepth

Category
Camera/Reprojection
Author
Alexankharin (Account age: 2779days)
Extension
camera-comfyUI
Latest Updated
2025-12-26
Github Stars
0.03K

How to Install camera-comfyUI

Install this extension via the ComfyUI Manager by searching for camera-comfyUI
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter camera-comfyUI in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

ReprojectDepth Description

Transforms depth tensors between projections and generates a mask for valid pixel identification.

ReprojectDepth:

The ReprojectDepth node is designed to transform a depth tensor from one projection type to another, while also generating a mask that identifies valid pixels. This node is particularly useful in scenarios where depth data needs to be adapted to different camera perspectives or projection formats, such as transitioning from a fisheye to a rectilinear view. By reprojecting depth information, you can maintain the integrity of spatial data across various visual representations, which is crucial for applications in 3D rendering, virtual reality, and augmented reality. The node ensures that the reprojected depth data is accurate and provides a mask to highlight areas where the transformation is valid, thus offering a reliable method for depth data manipulation.

ReprojectDepth Input Parameters:

depth

This parameter represents the input depth tensor that you wish to reproject. It is crucial for defining the initial depth data that will undergo transformation. The depth tensor should be in the form of a PyTorch tensor, and its dimensions will determine how the reprojection process is applied.

input_horizontal_fov

This parameter specifies the horizontal field of view (FOV) of the input depth data. It is a float value that ranges from 0.0 to 360.0 degrees, with a default of 90.0 degrees. Adjusting this value affects how the input depth is interpreted in terms of its spatial coverage.

output_horizontal_fov

Similar to the input_horizontal_fov, this parameter defines the horizontal field of view for the output depth data. It also ranges from 0.0 to 360.0 degrees, with a default of 90.0 degrees. This setting determines the spatial extent of the reprojected depth data.

input_projection

This parameter indicates the type of projection used for the input depth data. It is essential for correctly interpreting the spatial characteristics of the input data. The available options are defined in the Projection.PROJECTIONS enumeration.

output_projection

This parameter specifies the projection type for the output depth data. It determines how the reprojected depth will be formatted and is crucial for ensuring compatibility with the desired output format. The options are also defined in the Projection.PROJECTIONS enumeration.

output_width

This integer parameter sets the width of the output depth data. It ranges from 0 to 16384, with a default of 0, which means it will use the input width. Adjusting this value allows you to control the resolution of the reprojected depth data.

output_height

Similar to output_width, this parameter defines the height of the output depth data. It ranges from 0 to 16384, with a default of 0, indicating that the input height will be used. This setting allows you to specify the desired resolution for the output.

transform_matrix

This parameter is a 4x4 matrix that defines the transformation to be applied during reprojection. It is optional and defaults to None, meaning no additional transformation is applied unless specified. This matrix can be used to apply custom transformations to the depth data.

inverse

This boolean parameter determines whether the transformation matrix should be inverted before application. It defaults to False, meaning the matrix is used as-is. Setting this to True can be useful when you need to apply the inverse of a given transformation.

ReprojectDepth Output Parameters:

reprojected_depth

This output parameter is a tensor representing the reprojected depth data. It reflects the transformed depth information according to the specified input and output projections and field of view settings. The reprojected depth is crucial for applications that require depth data in a different spatial format.

reprojected_mask

This output parameter is a tensor that acts as a mask, indicating the validity of each pixel in the reprojected depth data. Pixels with a value of 1.0 are valid, while those with 0.0 are out-of-bounds or invalid. This mask is essential for identifying areas where the reprojection process has successfully maintained data integrity.

ReprojectDepth Usage Tips:

  • Ensure that the input and output projection types are correctly specified to avoid distortions in the reprojected depth data.
  • Use the transform_matrix parameter to apply custom transformations, such as rotations or translations, to the depth data for more complex reprojection tasks.
  • Adjust the output_width and output_height parameters to match the desired resolution of your application, ensuring that the reprojected depth data meets your quality requirements.

ReprojectDepth Common Errors and Solutions:

Unsupported depth tensor with {x.dim()} dims

  • Explanation: This error occurs when the input depth tensor has an unsupported number of dimensions.
  • Solution: Ensure that the input depth tensor is either 2D, 3D, or 4D. Adjust the tensor dimensions accordingly before passing it to the node.

Invalid projection type

  • Explanation: This error arises when an unsupported projection type is specified for either the input or output projection.
  • Solution: Verify that the projection types are correctly selected from the available options in Projection.PROJECTIONS. Adjust the input or output projection parameters to valid types.

ReprojectDepth Related Nodes

Go back to the extension to check out more related nodes.
camera-comfyUI
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

ReprojectDepth