Unlock Professional-Grade Portrait Editing with AI-Powered Workflow

CN
ComfyUI.org
2025-04-10 15:16:56

1. Workflow Overview

m9bi3mvrfz3xbbeqonub45b014d7479d0c50a58130a0d88f99533b2b535e6b2d6c8cbacde7f43e6a89c.jpg

This workflow is designed to automatically beautify portrait photos through AI models, featuring functions like skin smoothing, acne removal, hair refinement, and background blurring. It primarily uses the majicMIX realistic model for realistic-style enhancements, with Ultralytics detectors and SAM models for facial region localization and detailing.

2. Core Models

  • majicMIX realistic v2: Main model for photorealistic portraits (download to ComfyUI/models/checkpoints).

  • YOLOv8m-seg: Ultralytics segmentation model for face detection (requires comfyui-detection plugin).

  • SAM (Segment Anything Model): Meta's model for mask refinement (download sam_vit_b_01ec64.pth).

3. Key Nodes

Node Name

Function

Installation

FaceDetailer

Core node for face refinement

Built-in (requires ComfyUI-Impact-Pack)

UltralyticsDetectorProvider

Provides YOLOv8 detector

Install comfyui-detection via ComfyUI Manager

SEGSRangeFilterDetailerHook

Filters non-facial regions

Part of Impact-Pack

4. Workflow Structure

  1. Model Loading Group:

    • Input: None

    • Output: Model, CLIP, VAE

    • Nodes: CheckpointLoaderSimple

  2. Face Detection & Masking:

    • Input: Raw image

    • Output: Face BBox and masks

    • Nodes: UltralyticsDetectorProvider + SAMLoader

  3. Beautification Group:

    • Input: Image + prompts (e.g., "smooth skin, 8K")

    • Output: Enhanced image

    • Nodes: FaceDetailer + CLIPTextEncode

5. Inputs & Outputs

  • Inputs:

    • Image (e.g., 87979.jpg)

    • Positive prompt: "Smooth skin, refine, remove acne, HD"

    • Negative prompt: "Split hair, large pores"

  • Outputs: Saved image in ComfyUI folder.

6. Notes

  • Requires β‰₯6GB VRAM (GPU recommended).

  • Effects may be subtle; adjust prompts/parameters (e.g., denoise=0.5) manually.

  • Dependencies: ComfyUI-Impact-Pack, comfyui-detection.