depthmap2mask  by Extraltodeus

Stable Diffusion WebUI script for depth-based masking

created 2 years ago
358 stars

Top 79.2% on sourcepulse

GitHubView on GitHub
Project Summary

This extension for AUTOMATIC1111's Stable Diffusion WebUI creates masks for img2img operations using depth estimation from the MiDaS model. It targets Stable Diffusion users seeking to generate masks based on image depth, offering a streamlined workflow for background removal and subject isolation.

How It Works

The extension leverages the MiDaS model to generate a depth map from an input image. Users can then adjust a "contrast cut level" to threshold the depth map, effectively creating a binary mask. Options to override inpainting settings and control mask blur are provided for convenience. The extension also supports alpha channel cropping for direct background removal.

Quick Start & Requirements

  • Install by copying the repository URL into the Stable Diffusion WebUI's extension tab or by cloning into the extensions folder. A UI restart may be required.
  • Requires AUTOMATIC1111/stable-diffusion-webui.
  • Recommended sampler: DDIM. Avoid Euler a.
  • Official documentation: https://github.com/Extraltodeus/depthmap2mask

Highlighted Details

  • Utilizes MiDaS models for depth estimation.
  • "Contrast cut level" slider for thresholding depth maps.
  • "Save alpha mask" option for direct background removal.
  • Overrides inpainting settings for Masked content and Mask blur.

Maintenance & Community

  • Developed by Extraltodeus.
  • Relies on MiDaS models (Ranftl et al.).
  • Bug reporting instructions provided in the README.

Licensing & Compatibility

  • License not explicitly stated in the README.
  • Compatible with AUTOMATIC1111/stable-diffusion-webui.

Limitations & Caveats

The README suggests avoiding the Euler a sampler due to potentially poor results. Compatibility with specific MiDaS model versions or performance on diverse hardware is not detailed.

Health Check
Last commit

2 years ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
0 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.