Unlock Professional Facial Retouching with This AI-Powered Workflow

CN
ComfyUI.org
2025-05-23 05:56:06

1. Workflow Overview

mb0dzz35ywj692csaw767ddc45bcb5191342a4d230d7d55bde28a02e704aa1d4c6793fbf964ab4fe4a.png

This workflow specializes in facial photo retouching with:

  • Automatic defect repair: Oiliness, acne, scars

  • Texture preservation: Enhances skin details without over-smoothing

  • Localized processing: Only modifies facial areas

Core Models:

  • TruePortrait XL Apex: Realistic portrait base model

  • Skin Texture Lora (weight 0.6): Optimizes pores and skin quality

  • YOLOv8m-seg: Face detection model


2. Key Components

Required Custom Nodes:

  1. Impact Pack (via ComfyUI Manager):

    • Provides FaceDetailer node

  2. Ultralytics Detector:

    • Download person_yolov8m-seg.pt

  3. Segment Anything (SAM):

    • Required model: sam_vit_b_01ec64.pth

Critical Parameters:

  • SEGSRangeFilterDetailerHookProvider:

    • Limits processing area width ≤512px

  • Detailer sampling:

    • 30 steps, CFG=5, euler sampler


3. Workflow Structure

Group Logic:

  1. Input Group:

    • Node: LoadImage (e.g., oily_face_sample.jpg)

  2. Detection Group:

    • Nodes: UltralyticsDetectorProvider + SAMLoader

    • Function: Precise face segmentation

  3. Retouching Group:

    • Core Node: FaceDetailer

    • Key Settings:

      Denoise strength: 0.4  
      Mask expansion: 10px  
      Refinement passes: 3  
  4. Output Group:

    • Node: SaveImage

    • Result: Retouched PNG with natural skin texture


4. Input & Output

Input Requirements:

  • Formats: JPG/PNG

  • Optimal Resolution: ≥1024px (short edge)

Output Features:

  • Removes oiliness/acne/scars

  • Preserves realistic skin pores


5. Usage Notes

  1. Hardware:

    • Recommended ≥8GB VRAM (SAM is resource-intensive)

  2. Troubleshooting:

    • Background artifacts: Adjust SEGSRangeFilter width threshold

    • Over-smoothed skin: Reduce Lora weight (default 0.6→0.4)

  3. Customization:

    • Swap Lora for styles (e.g., "Midnight|Flux Xiaohongshu Photography_V1")