Qwen Image 2512 + SAM3 Face Inpainting Workflow
Workflow
Qwen
Workflow
Qwen
v1.1

Qwen Image 2512 + SAM3 Face Inpainting Workflow

eagle42
Creator
โญ 0.0
โฌ‡ 195 Downloads
๐Ÿ‘ 1 Views
๐Ÿ–ผ 16 Images

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