ComfyUI Node: Metric3D Depth Map

Class Name

Metric3D-DepthMapPreprocessor

Category
ControlNet Preprocessors/Normal and Depth Estimators
Author
Fannovel16 (Account age: 3127days)
Extension
ComfyUI's ControlNet Auxiliary Preprocessors
Latest Updated
2024-06-18
Github Stars
1.57K

How to Install ComfyUI's ControlNet Auxiliary Preprocessors

Install this extension via the ComfyUI Manager by searching for ComfyUI's ControlNet Auxiliary Preprocessors
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI's ControlNet Auxiliary Preprocessors 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

Metric3D Depth Map Description

Generate depth maps from images using machine learning for AI artists, enhancing visual effects and applications.

Metric3D Depth Map:

The Metric3D-DepthMapPreprocessor node is designed to generate depth maps from input images, leveraging advanced machine learning models. This node is particularly useful for AI artists who want to add depth perception to their images, enabling more realistic and immersive visual effects. By utilizing a pre-trained Metric3DDetector model, this node processes the input image to produce a depth map, which can be used in various applications such as 3D reconstruction, augmented reality, and enhanced image editing. The node offers flexibility in terms of model selection and camera intrinsic parameters, ensuring that you can tailor the depth map generation to your specific needs.

Metric3D Depth Map Input Parameters:

backbone

The backbone parameter allows you to select the underlying model architecture used for depth map generation. You can choose from "vit-small", "vit-large", and "vit-giant2", with "vit-small" being the default option. The choice of backbone affects the accuracy and computational requirements of the depth map generation. "vit-small" is faster but less accurate, while "vit-giant2" offers higher accuracy at the cost of increased computational load.

fx

The fx parameter represents the focal length of the camera in the x-axis, specified as an integer. This parameter is crucial for accurate depth estimation as it influences the scaling of the depth map. The default value is 1000, with a minimum of 1 and a maximum defined by MAX_RESOLUTION. Adjusting this value can help fine-tune the depth map to match the characteristics of the camera used to capture the input image.

fy

The fy parameter is similar to fx but represents the focal length in the y-axis. It also plays a significant role in the scaling and accuracy of the depth map. The default value is 1000, with a minimum of 1 and a maximum defined by MAX_RESOLUTION. Properly setting this parameter ensures that the depth map accurately reflects the vertical scaling of the scene.

Metric3D Depth Map Output Parameters:

IMAGE

The output of the Metric3D-DepthMapPreprocessor node is an IMAGE that represents the depth map of the input image. This depth map encodes the distance of each pixel from the camera, allowing for a 3D representation of the scene. The depth map can be used in various applications, such as creating 3D models, enhancing image realism, or integrating with augmented reality systems.

Metric3D Depth Map Usage Tips:

  • For faster processing with reasonable accuracy, use the "vit-small" backbone. For higher accuracy, especially in complex scenes, consider using "vit-giant2".
  • Ensure that the fx and fy parameters match the intrinsic parameters of the camera used to capture the input image for the most accurate depth map results.
  • Experiment with different resolution settings to balance between processing time and the level of detail in the depth map.

Metric3D Depth Map Common Errors and Solutions:

prob_feat_nan!!!

  • Explanation: This error indicates that the probability features contain NaN (Not a Number) values, which can occur due to numerical instability during the depth regression process.
  • Solution: Ensure that the input image is properly preprocessed and normalized. If the issue persists, try using a different backbone model or adjusting the fx and fy parameters.

prob_feat_inf!!!

  • Explanation: This error signifies that the probability features contain infinite values, which can disrupt the depth map generation.
  • Solution: Check the input image for any anomalies or extreme values. Adjust the camera intrinsic parameters (fx and fy) to more realistic values if necessary.

d_nan!!!

  • Explanation: This error occurs when the depth values contain NaN, indicating a failure in the depth regression process.
  • Solution: Verify the input image quality and ensure it is free from artifacts. Consider using a different backbone model or adjusting the resolution parameter.

d_inf!!!

  • Explanation: This error indicates that the depth values contain infinite values, which can result from numerical issues during processing.
  • Solution: Ensure that the input image is correctly preprocessed. Adjust the fx and fy parameters to more appropriate values and try again.

Metric3D Depth Map Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI's ControlNet Auxiliary Preprocessors
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.