Mastering AI Portrait Editing: A Step-by-Step Workflow for Stunning Results
1. Workflow Overview

This workflow, named "AI Portrait Workflow", is designed for high-quality portrait generation and editing, integrating AI generation, face detection, inpainting, and style control.
Core Models:
Stable Diffusion XL (SDXL):
LEOSAM HelloWorld _ SDXL_v7.0
(base model).ControlNet:
xinsir_union_promax.safetensors
(pose/structure control).IPAdapter: Style transfer and detail enhancement.
Florence-2: Face detection and segmentation.
Functions:
Automatic face detection and masking.
Multi-ControlNet integration (pose, depth, edges).
Background replacement and style fusion.
Low-strength inpainting for detail refinement.
2. Key Nodes
Node Name | Description | Installation |
---|---|---|
CheckpointLoaderSimple | Loads SDXL base model. | Download to |
ControlNetLoader | Loads ControlNet models (pose/depth). | Place |
Florence2ModelLoader | Loads Florence-2 for face segmentation. | Install |
IPAdapterUnifiedLoader | Loads IPAdapter for style transfer. | Install |
Sam2Segmentation | Precise masking via SAM2. | Install |
AIO_Preprocessor | Image preprocessing (e.g., edge detection). | Install |
Image Comparer | Compares original vs. generated images. | Install |
3. Workflow Structure
Key functional groups:
Face Detection & Masking:
Florence2Run
detects faces →Sam2Segmentation
refines masks.
ControlNet Control:
ControlNetApplySD3
applies pose/depth constraints.
IPAdapter Style Transfer:
Transfers style from reference images (e.g., "Cyberpunk Girl").
Inpainting & Refinement:
Light inpainting + PS masking for detail fixes.
4. Inputs & Outputs
Inputs:
Source image (e.g., portrait).
Optional prompts (default uses Florence-2 captions).
Control parameters (e.g., ControlNet weight).
Outputs:
Final portrait with stylized background.
Side-by-side comparisons via
Image Comparer
.
5. Notes
Model Dependencies:
Download SDXL, ControlNet, and Florence-2 (total >20GB).
Model links:
SDXL: LEOSAM HelloWorld
ControlNet: xinsir_union_promax
Hardware:
≥12GB VRAM (RTX 3080+), 24GB recommended for full pipeline.
Troubleshooting:
Poor masking: Adjust
Sam2Segmentation
bboxes
or manual coordinates.Over-stylization: Reduce
weight
inIPAdapterAdvanced
(default: 0.7).