limbicnation d3b1095d43 feat: enhance depth node with robust error handling and resource management
This comprehensive update improves the depth estimation node with:
- Robust error handling that continues workflow execution instead of crashing
- Visual error reporting with informative messages displayed on error images
- Intelligent resource management with VRAM usage tracking and requirements
- Automatic fallback to CPU when insufficient VRAM is detected
- Multiple fallback strategies for model loading issues
- Better handling of problematic inputs like NaN values
- Detailed logging for easier troubleshooting

These changes make the node much more stable and user-friendly in
complex ComfyUI setups, preventing workflow-breaking errors.
2025-05-03 18:29:07 +02:00
2025-02-25 14:29:17 +01:00
2025-02-25 14:29:17 +01:00
2024-06-07 17:27:18 +02:00
2024-06-07 17:27:18 +02:00
2024-09-05 04:13:43 +02:00
2025-02-25 22:07:57 +01:00

Depth Estimation Icon ComfyUIDepthEstimation ComfyUIDepthEstimation

Depth Estimation Logo

A custom depth estimation node for ComfyUI using Depth-Anything models to generate depth maps from images.

Features

  • Multiple model options:
    • Depth-Anything-Small
    • Depth-Anything-Base
    • Depth-Anything-Large
    • Depth-Anything-V2-Small
    • Depth-Anything-V2-Base
  • Post-processing options:
    • Gaussian blur (adjustable radius)
    • Median filtering (configurable size)
    • Automatic contrast enhancement
    • Gamma correction

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/ComfyUIDepthEstimation.git
    
  2. Navigate to the repository directory:

    cd ComfyUIDepthEstimation
    
  3. Install the required dependencies:

    pip install -r requirements.txt
    

Usage

Depth Estimation Node Preview
Depth Map Generator Showcase

Node Parameters

Node Parameters

  • image: Input image (IMAGE type)
  • model_name: Select from available Depth-Anything models
  • blur_radius: Gaussian blur radius (0.0 - 10.0, default: 2.0)
  • median_size: Median filter size (3, 5, 7, 9, 11)
  • apply_auto_contrast: Enable automatic contrast enhancement
  • apply_gamma: Enable gamma correction

Integrate with ComfyUI

  1. Copy the depth_estimation_node.py file to your ComfyUI custom nodes directory.

  2. Update ComfyUI configuration to include the custom node if necessary.

  3. Restart ComfyUI to load the new custom node.

Example Usage

  1. Add the Depth Estimation node to your ComfyUI workflow
  2. Connect an image source to the node's image input
  3. Configure the parameters:
    • Select a model (e.g., "Depth-Anything-V2-Small")
    • Adjust blur_radius (0-10) for depth map smoothing
    • Choose median_size (3-11) for noise reduction
    • Toggle auto_contrast and gamma correction as needed
  4. Connect the output to a Preview Image node or other image processing nodes

The node will process the input image and output a depth map that can be used in your ComfyUI workflow.

License

This project is licensed under the Apache License.


S
Description
No description provided
Readme Apache-2.0
2.2 MiB
Languages
Python 100%