comfyui_controlnet_aux

2888
By tstandley
Updated about 1 month ago
View on GitHub →See Common Issues →

Available Nodes

MiDaS-DepthMapPreprocessor

MiDaS-DepthMapPreprocessor Documentation

Overview

The MiDaS-DepthMapPreprocessor node is part of the ComfyUI's ControlNet Auxiliary Preprocessors, designed to generate depth maps from input images. This specific node leverages the MiDaS model, a powerful depth estimation network, to create depth images that can be used in various applications, such as 3D scene reconstruction, object detection, and computer vision tasks within the ComfyUI environment.

Functionality

The MiDaS-DepthMapPreprocessor node processes an input image to produce a depth map. Depth maps are grayscale images where lighter shades indicate closer proximity, while darker shades represent farther distances. This data allows for advanced visual manipulations and enhancements in digital media projects.

Inputs

The MiDaS-DepthMapPreprocessor node accepts the following inputs:

  • Image: The primary image input that you wish to process to generate a depth map.
  • A (Angle): A floating-point value ranging from 0 to approximately 15.71 (π×5), with a default value of approximately 6.283 (2×π). This parameter may adjust the algorithm's sensitivity or behavior related to the depth estimation.
  • Background Threshold (bg_threshold): A floating-point value with a default of 0.1. This threshold may determine how the background is isolated relative to objects based on their depth.
  • Resolution: An integer specifying the desired resolution for the output depth map. The default resolution is set to 512 pixels.

Outputs

The MiDaS-DepthMapPreprocessor node produces the following output:

  • IMAGE: A depth map image derived from the input image, encoded as a single grayscale image where pixel intensity correlates to depth distance estimates.

Usage

In ComfyUI workflows, the MiDaS-DepthMapPreprocessor node can be integrated as part of a pipeline to convert standard images into depth maps. These depth maps can then be used to guide ControlNet or T2I-Adapter for enhanced control over image generation processes or within any application that benefits from depth data.

Example Workflow

  1. Image Loading: Start with loading your source image into ComfyUI.
  2. Node Placement: Add the MiDaS-DepthMapPreprocessor node to your working canvas.
  3. Input Configuration: Attach your source image as the input to the node, and adjust parameters like resolution and background threshold to suit your desired outcomes.
  4. Process and Output: Execute the node to produce a depth map that can be further used in the workflow or saved for other purposes.

Considerations

  • Performance: Processing time can vary depending on image resolution and input size. Larger images or higher resolutions may incur more processing time.
  • Parameter Tuning: Experimenting with the 'A' and 'Background Threshold' parameters may be necessary to achieve optimal results depending on the complexity and characteristics of your input images.
  • Integration: The node is particularly useful in scenarios requiring depth cues, such as virtual reality, robotics, and advanced image synthesis projects involving ControlNet hints.

Additional Information

The ComfyUI ControlNet Auxiliary Preprocessors repository on GitHub (https://github.com/Fannovel16/comfyui_controlnet_aux) provides further insights and updates on the available nodes, including installation steps and usage examples. This node is distributed with these auxiliary preprocessors, allowing for seamless integration and expanded functionality within image processing workflows using ComfyUI.