Hand Repair Workflow: Boosting AI Image Quality with Low GPU Memory
1. Workflow Overview

This workflow is designed to fix deformed hands in AI-generated images with low GPU memory usage. Key features:
Hand Localization: Masks precisely mark defective hand areas.
Local Inpainting: Combines Flux models and depth learning for hand detail repair.
Seamless Blending: Ensures natural transitions between repaired and original areas.
Core Models:
Base Model:
基础算法_F.1
(UNET for general image generation).Flux Model: Loaded via
DualCLIPLoader
(versiont5xxl_fp8_e4m3fn
).Auxiliary:
SegmentAnythingUltra V2
(auto-segment hands).
2. Key Nodes & Installation
Node | Function | Installation |
---|---|---|
InpaintResize | Resizes input image/mask to fit repair area. | Built-in. |
GrowMaskWithBlur | Expands and blurs mask edges for smooth blending. | Install |
SegmentAnythingUltra V2 | Auto-generates hand masks. | Install |
BasicGuider | Optimizes conditioning with Flux for hand details. | Built-in. |
SamplerCustomAdvanced | Custom sampler controls noise/detail during repair. | Built-in. |
Dependencies:
Flux model via
DualCLIPLoader
.Place
ae.sft
inmodels/vae
.
3. Workflow Structure
Group 1: Input & Preprocessing
Input: Original image (e.g.,
clipspace-mask-175661.png
) and hand mask.Steps:
Load image/mask via
LoadImage
.Resize with
InpaintResize
(e.g., 1536x1536).Remove alpha channel via
ImageRemoveAlpha
.
Group 2: Hand Repair
Input: Preprocessed image, mask, prompt (e.g., "perfect hand").
Steps:
Crop hand area via
InpaintCrop
.Optimize conditioning with
BasicGuider
.Generate repaired latent image via
SamplerCustomAdvanced
(Euler sampler).
Group 3: Blending & Output
Input: Repaired hand image, original, mask.
Steps:
Blend with
InpaintStitch
(method:bislerp
).Save result via
SaveImage
(e.g.,flux/20240513_142301_修手.png
).
4. Inputs & Outputs
Inputs:
Image: Include hands (resolution ≥800x800).
Mask: Accurately mark defective areas (black/white).
Prompt: Simple target description (e.g., "perfect hand").
Output:
Repaired PNG saved in
flux/date/time_修手.png
.
5. Notes
VRAM Optimization:
Optimized for ≥6GB GPUs. Reduce
InpaintResize
output (e.g., 1024x1024) if needed.
Mask Accuracy:
Manually refine masks if auto-segmentation fails.
Compatibility:
Ensure Flux model matches base algorithm version.
Debugging:
Adjust
GrowMaskWithBlur
(default: 30px expansion, 0.1 blur) for better edges.