Qwen Image 2512 + SAM3 Face Inpainting Workflow
About this model
๐จ Qwen Image 2512 + SAM3 Face Inpainting Workflow
> Generate stunning portraits with automatic face detail enhancement โ using single prompts or batch scheduling.
## โจ What This Workflow Does
This ComfyUI workflow combines Qwen Image 2512 (a powerful text-to-image model) with SAM3 Smart Inpainter to:
1. ๐ผ๏ธ Generate high-quality images from text prompts
2. ๐ค Automatically find and enhance faces (man + woman) using AI segmentation
3. ๐ Support single prompt OR batch prompt scheduling for creative variations
4. โก Speed up generation with CacheDiT acceleration
5. ๐ฏ Use advanced sampling for better results
Perfect for: character portraits, fashion shoots, story illustration, face refinement, and creative batch generation.
## โจ What's New in V1.1
### ๐ Auto-Reset Counter (No More Manual Reset!)
- Replaced the old PrimitiveInt node with my new AutoResetInt node
- โ
Automatically resets to 0 after each generation
- โ Also resets if you cancel a generation
- โ Want to run multiple batches? Just wait for the first image to finish โ the counter resets itself!
- ๐ฏ No more forgetting to reset โ just click "Queue" and go
### โ๏ธ Model Format Switch
- Added a simple toggle to choose your model format:
- GGUF โ for lower VRAM / quantized setups
- FP8 / BF16 โ for full quality on powerful GPUs
- ๐ฏ Pick what works best for your hardware โ no need to edit the workflow
## ๐ฆ Required Custom Nodes
Install these in your ComfyUI/custom_nodes/ folder:
| Node Pack | Purpose | Link |
|-----------|---------|------|
| RES4LYF | Advanced sampler with better quality control | |
| SAM3_SmartInpainter | Auto-detect & inpaint faces using SAM3 | |
| ComfyUI-CacheDiT | Speed up Qwen Image generation | |
| comfyui_auto_prompt_schedule | Run multiple prompts in one batch | |
### Also Required:
- ComfyUI-Easy-Sam3 or ComfyUI-RMBG (provides the sam3 Python package for SAM3_SmartInpainter)
- Qwen Image model files: qwen_image_vae.safetensors, qwen_2.5_vl_7b_fp8_scaled.safetensors, and your chosen checkpoint (e.g., Qwen-Overcooked_fp8_V2.safetensors)
- SAM3 model: Download sam3.pt from โ place in ComfyUI/models/sam3/
## ๐ง How to Use
### Step 1: Install & Setup
1. Clone all required node packs into custom_nodes/
2. Install Python requirements (see each repo's README)
3. Download models and place them in correct folders
4. Restart ComfyUI
### Step 2: Load the Workflow
1. Drag the .json file into ComfyUI
2. Wait for nodes to load (missing nodes will show red)
### Step 3: Choose Your Mode
#### ๐ฏ Single Prompt Mode (Default)
- Set the toggle true=Single Prompt | false=Batch Prompts โ true
- Edit the prompt in the โกSingle Promptโก node
- Click Queue Prompt
#### ๐ Batch Prompt Mode
- Set the toggle โ false
- Edit prompts in the Input Prompts for Schedule node (format: "0": "prompt text", "30": "next prompt", ...)
- Set max_frames in PromptSchedule node to control how many to generate
- Click Queue Prompt โ it will auto-run through your list
### Step 4: Face Inpainting (Automatic)
The workflow automatically:
1. Finds the woman's face โ enhances it with prompt: "woman, exquisite detailed face..."
2. Finds the man's face โ enhances it with prompt: "man with dark beard, exquisite detailed face..."
3. Blends both back into the main image
๐ก Tip: To inpaint different subjects, chain more SAM_SmartInpainter nodes and change the prompt field (e.g., "hat", "eyes", "scarf").
### Step 5: Adjust Key Settings
| Parameter | Recommended | What It Does |
|-----------|-------------|--------------|
| min_mask_area | 0.001 | Allows tiny faces to be detected |
| crop_padding | 32โ128 | Extra space around face for better inpainting |
| inpaint_resolution | 1280 | Higher = more detail in repainted face |
| denoise | 0.3โ0.5 | Lower = subtle changes, higher = more creative |
| steps | 6 | Qwen Image works well with low steps |
| cfg | 1.0 | Keep low for Qwen Image |
---
## ๐ก Pro Tips
๐น Small or distant faces not detected?
โ Lower min_mask_area to 0.0005 and text_threshold to 0.25
๐น Inpainting looks blurry?
โ Raise inpaint_resolution to 1280 or 1536
๐น Edges look harsh?
โ Use blend_mode: feather and increase mask_blur
๐น Want to inpaint more than faces?
โ Change the SAM prompt to "hat", "logo", "hands" โ it will find and repaint that area
๐น Batch generation too slow?
โ Enable CacheDiT and use fp8 models for faster runs
## โ ๏ธ Important Notes
๐ธ This workflow is designed for Qwen Image 2512 โ other models may need parameter adjustments
๐ธ I do not monitor this post โ I may not reply to comments or issues. This is shared for the community to use and improve.
๐ธ Always test with one image first before running large batches
---
## ๐ Credits
- Qwen Image 2512 โ Alibaba Cloud / Qwen Team
- SAM3 Model โ Meta AI Research / Majidfida (HuggingFace)
- RES4LYF โ @ClownsharkBatwing
- SAM3_SmartInpainter โ @majidfida
- CacheDiT โ @Jasonzzt
- Auto Prompt Schedule โ @ReinerBforartists
> ๐จ Simple rule: Start with single prompt โ get it perfect โ then try batch mode for variations.
> If faces aren't found โ lower min_mask_area. If results look soft โ raise inpaint_resolution.
Happy creating! โจ๐ซ๐ผ๏ธ
Related Models
Similar AI models you may like
ON-THE-FLY ๅฎๆถ็ๆ๏ผWan-AI ไธ็ธ/ Wan2.1 Video Model (multi-specs) - CausVid&Comfy&Kijai - workflow included
ใWAN2.1ใIMG to VIDEO
ComfyUI Image Workflows
WAN 2.2 Workflow T2V-I2V-T2I (Kijai Wrapper)
[Lah] Mysterious | Qwen update
Hunyuan ๐ป AllInOne
Moody Simple Zimage Turbo/Distilled Workflow