sd-face-editor  by ototadana

SD extension for face editing in Stable Diffusion

created 2 years ago
1,067 stars

Top 36.0% on sourcepulse

GitHubView on GitHub
Project Summary

This repository provides a Stable Diffusion Web UI extension for advanced face editing in generated images. It targets users needing to fix distorted faces, alter expressions, or apply specific processing to facial regions, offering a post-processing solution to refine generated outputs.

How It Works

The extension operates as a post-processor. It first detects faces in a generated image, crops and resizes them to a uniform size (e.g., 512x512 or 1024x1024 for SDXL), and then uses img2img with specified denoising strength to recreate the faces. Finally, it pastes the new faces back into the original image and uses inpainting to blend them seamlessly, minimizing visible borders.

Quick Start & Requirements

  • Install: Via AUTOMATIC1111's Stable Diffusion Web UI: Extensions tab -> Install from URL, enter https://github.com/ototadana/sd-face-editor.git, click Install, then Apply and restart UI.
  • Prerequisites: Stable Diffusion Web UI (AUTOMATIC1111 or SD.Next).
  • Docs: Workflow Editor

Highlighted Details

  • Supports individual prompting for multiple faces using || separators.
  • Features a flexible Workflow Editor for customizing face detection, processing, and masking pipelines.
  • Offers fine-grained control over mask size, blur, face margin, and denoising strengths for both faces and the overall image.
  • Includes options for automatic tilt adjustment and face size scaling based on the SDXL model.

Maintenance & Community

  • Open to contributions, particularly for new workflow definitions and alternative component implementations (FaceDetector, FaceProcessor, MaskGenerator).
  • Issues can be opened for questions and guidance.

Licensing & Compatibility

  • License: MIT.
  • Compatible with AUTOMATIC1111's Stable Diffusion Web UI and SD.Next.

Limitations & Caveats

  • The effectiveness of face editing can be sensitive to initial image generation quality and parameter tuning.
  • Handling of very close or overlapping faces may require specific workflow configurations and the "Use minimal area" option.
Health Check
Last commit

10 months ago

Responsiveness

1 day

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

Explore Similar Projects

Feedback? Help us improve.