ComfyUI > Nodes > ComfyUI-Depth-Pro > Metric Depth to Relative

ComfyUI Node: Metric Depth to Relative

Class Name

MetricDepthToRelative

Category
Depth-Pro
Author
spacepxl (Account age: 452days)
Extension
ComfyUI-Depth-Pro
Latest Updated
2024-10-23
Github Stars
0.14K

How to Install ComfyUI-Depth-Pro

Install this extension via the ComfyUI Manager by searching for ComfyUI-Depth-Pro
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-Depth-Pro 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
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Metric Depth to Relative Description

Transform metric depth images into relative representations for visual interpretation and processing in various applications, enhancing contrast and detail visibility.

Metric Depth to Relative:

The MetricDepthToRelative node is designed to transform metric depth images into relative depth representations, which are more suitable for visual interpretation and further processing in various applications. This node is particularly useful in scenarios where depth information needs to be normalized across different images or within a single image to enhance contrast and detail visibility. By converting metric depth values to a relative scale, this node allows for more consistent and visually coherent depth maps, which can be crucial for tasks such as 3D reconstruction, augmented reality, and image editing. The node offers flexibility through its parameters, enabling you to adjust the conversion process to suit specific needs, such as inverting the depth map or applying gamma correction to fine-tune the output.

Metric Depth to Relative Input Parameters:

depth

The depth parameter is the input image that contains the metric depth information. This image serves as the basis for the conversion process, where each pixel's depth value is transformed into a relative scale. The depth image should be in a format that the node can process, typically a single-channel image representing depth values.

per_image

The per_image parameter is a boolean option that determines whether the depth normalization should be applied individually to each image in a batch or across the entire batch. When set to True, each image is normalized independently, which is useful when images have varying depth ranges. The default value is True.

invert

The invert parameter is a boolean option that specifies whether the relative depth values should be inverted. Inverting the depth can be useful for certain visualizations or when the depth map needs to be interpreted in reverse. The default value is True, meaning the depth map will be inverted by default.

gamma

The gamma parameter is a float value that allows you to apply gamma correction to the relative depth map. This adjustment can enhance or reduce the contrast of the depth map, depending on the gamma value used. The parameter accepts values ranging from 0.01 to 100, with a default value of 1.0, which means no gamma correction is applied by default.

Metric Depth to Relative Output Parameters:

depth

The depth output parameter is the resulting image after the conversion from metric to relative depth. This image represents the depth information on a normalized scale, making it easier to interpret and use in subsequent processing steps. The relative depth map is typically a single-channel image where pixel values indicate relative depth, with adjustments applied based on the input parameters.

Metric Depth to Relative Usage Tips:

  • To achieve consistent depth normalization across a batch of images, set the per_image parameter to False. This will ensure that all images are normalized using the same scale, which can be beneficial for batch processing tasks.
  • Use the gamma parameter to adjust the contrast of the depth map. A gamma value less than 1 will increase contrast, while a value greater than 1 will decrease it. Experiment with different values to find the optimal setting for your specific application.

Metric Depth to Relative Common Errors and Solutions:

"Invalid depth image format"

  • Explanation: The input depth image is not in a supported format or does not contain valid depth information.
  • Solution: Ensure that the input image is a single-channel depth map and is in a format that the node can process.

"Gamma value out of range"

  • Explanation: The gamma parameter is set to a value outside the allowed range of 0.01 to 100.
  • Solution: Adjust the gamma value to be within the specified range to ensure proper gamma correction is applied.

"Normalization failed due to zero range"

  • Explanation: The depth map has a zero range, meaning all depth values are the same, leading to a division by zero during normalization.
  • Solution: Check the input depth map for uniform values and ensure it contains varying depth information before processing.

Metric Depth to Relative Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-Depth-Pro
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.