ComfyUI > Nodes > camera-comfyUI > ZDepthToRayDepthNode

ComfyUI Node: ZDepthToRayDepthNode

Class Name

ZDepthToRayDepthNode

Category
Camera/Depth
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

ZDepthToRayDepthNode Description

Converts depth tensor to ray-depth using camera properties for accurate 3D visualization.

ZDepthToRayDepthNode:

The ZDepthToRayDepthNode is a specialized node designed to convert a single-channel depth tensor into a ray-depth tensor by considering the camera's intrinsic properties. This node is particularly useful in scenarios where you need to transform depth information from a standard depth map into a format that accounts for the camera's field of view, effectively simulating how rays would travel from the camera to each point in the scene. By leveraging the pinhole camera model, this node ensures that the depth data is accurately represented in terms of ray depth, which is crucial for applications like 3D reconstruction, augmented reality, and computer vision tasks. The primary benefit of using this node is its ability to provide a more realistic representation of depth by incorporating the camera's horizontal field of view, thereby enhancing the accuracy of depth-based computations and visualizations.

ZDepthToRayDepthNode Input Parameters:

depth

The depth parameter is a tensor that represents the input depth map. This tensor should be in the format [1, H, W, 1], where H and W are the height and width of the image, respectively. The depth map provides the initial depth information for each pixel, which will be transformed into ray depth. This parameter is crucial as it serves as the foundation for the conversion process, and any inaccuracies in the depth map will directly affect the resulting ray depth.

fov

The fov parameter stands for the horizontal field of view of the camera, measured in degrees. It is a floating-point value with a default of 60.0 degrees, a minimum of 1.0 degrees, and a maximum of 179.0 degrees. This parameter is essential because it determines how the depth values are adjusted to account for the camera's perspective. A wider field of view will result in a different ray depth calculation compared to a narrower one, as it affects the perceived distance and angle of the rays emanating from the camera.

ZDepthToRayDepthNode Output Parameters:

ray depth

The ray depth output is a tensor that represents the converted depth information, taking into account the camera's field of view. This tensor is in the format [1, H, W, 1], similar to the input depth map, but it now reflects the ray depth, which is the metric depth adjusted by the ray-length factor. This output is significant because it provides a more accurate depiction of depth as perceived by the camera, which is essential for realistic rendering and analysis in various applications.

ZDepthToRayDepthNode Usage Tips:

  • Ensure that the input depth map is accurately calibrated and represents the scene correctly, as any errors in the depth map will propagate to the ray depth output.
  • Adjust the fov parameter to match the actual field of view of the camera used to capture the depth map. This will ensure that the ray depth calculation is as accurate as possible.

ZDepthToRayDepthNode Common Errors and Solutions:

Invalid depth tensor shape

  • Explanation: The input depth tensor does not have the expected shape [1, H, W, 1].
  • Solution: Verify that the input depth tensor is correctly formatted with the specified dimensions before passing it to the node.

Field of view out of range

  • Explanation: The fov parameter is set outside the allowable range of 1.0 to 179.0 degrees.
  • Solution: Adjust the fov parameter to be within the specified range to ensure proper functioning of the node.

ZDepthToRayDepthNode 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.