ComfyUI Node

Apply Stand-In Processor

Turn one photo into the face_rgba Stand-In actually wants

By WeChatCV·Created 12 months ago·Updated 12 months ago· 158
Apply Stand-In Processor
  • face_processor
  • image
  • processed_image
  • face_rgba
resize_to512
border_thresh10
face_crop_scale1.5
confidence_threshold0.50
with_neckfalse
face_only_modefalse

This is the node that turns "a photo of a person" into the exact shape Stand-In's identity pipeline expects. The README's own usage tip says it straight: use a high-resolution frontal face photo, and don't worry about resolution or file extension because "our built-in preprocessing pipeline will handle them automatically." This node is that built-in pipeline.

Stand-In is WeChat Vision/Tencent's identity-preserving adapter for Wan video - small, cheap to train (Kijai, who wrote ComfyUI-WanVideoWrapper, noted only about 1% of the base model was retrained), and this preprocessor pack is the "official" way to prepare inputs for it, correcting a mismatch between the authors' original preprocessing logic and Kijai's own implementation in his wrapper. When Stand-In first launched, one of the more common reactions on r/comfyui was confusion about what it actually does - "basically face-id support in WAN... you can faceswap with it" is about as good a plain-English summary as any. ApplyFaceProcessor is the loader side of that: it's where your source identity photo gets turned into something the rest of the pipeline can use.

How it works

Feed it your face_processor (from FaceProcessorLoader) and a reference image. It runs the YOLO detector to find the face, crops around it using face_crop_scale as a multiplier on the detected box (bigger scale = more head/shoulder context included), optionally extends the crop to include the neck (with_neck), rejects or adjusts detections that sit too close to the frame edge (border_thresh), and resizes the result to resize_to. Out come two images: a processed version of your source photo, and a separate isolated face crop on its own alpha channel.

The inputs and outputs that matter

  • face_processor and image - the two required inputs: your loaded detector and the photo you want identity from.
  • resize_to (default 512) - fine to leave alone for a first run; it's the working resolution for the crop.
  • face_crop_scale (default 1.5) - the one worth nudging if you want more of the head and shoulders in frame rather than a tight face-only crop.
  • with_neck (default false here) - worth noting because the video nodes in this pack default it to true. If you want a consistent crop shape across your still-photo prep and your video processing, set this to match whatever you're using downstream.
  • face_only_mode (default false) - same story: defaults differently here than on the video nodes.
  • Outputs: processed_image (the adjusted source photo) and face_rgba - this second one is the actual payload. It's what plugs into VideoInputPreprocessor's face_rgba input downstream.

How to install it

cd ComfyUI/custom_nodes
git clone https://github.com/WeChatCV/Stand-In_Preprocessor_ComfyUI.git
cd Stand-In_Preprocessor_ComfyUI
pip install -r requirements.txt

Restart ComfyUI, or search "Stand-In Official Preprocessor ComfyUI Nodes" in ComfyUI Manager if you'd rather not touch the terminal.

Common issues & troubleshooting

No face detected, or face_rgba comes back empty/garbage. First suspect is confidence_threshold set too aggressively - try lowering it. Second suspect is your photo itself: the README's own advice is a high-resolution frontal shot, and this detector is going to struggle on extreme angles or low-quality source images the way any single-shot face detector would.

A face near the edge of your photo gets rejected. That's border_thresh doing its job a little too eagerly - raise it if your reference photo is a tight headshot with little margin.

The pasted-in face looks too tight or too loose once it hits VideoInputPreprocessor. face_crop_scale here and face_crop_scale on the video node aren't the same value and don't have to match - but wildly different scales between the two can make the eventual blend look off. If something's not lining up downstream, this is one of the first knobs to check.

with_neck and face_only_mode silently disagree with your video-side settings. Since this node's defaults are the odd ones out in the pack, it's worth explicitly setting both here to match what you're running on VideoInputPreprocessor and VideoBackgroundRestorer - or just wire a shared FaceOnlyModeSwitch into all of them so there's one source of truth.

CategoryStand-In

Inputs (8)

NameTypeDefaultDescription
face_processorFACE_PROCESSOR
imageIMAGE
resize_toINT51264–2048
border_threshINT100–100
face_crop_scaleFLOAT1.51–3
confidence_thresholdFLOAT0.500.1–1
with_neckBOOLEANfalse
face_only_modeBOOLEANfalse

Outputs (2)

NameTypeDescription
processed_imageIMAGE
face_rgbaIMAGE