FF: Advanced Swap Face (Video)
Full-control face swapping for video, frame by frame
- source_images
- target_video
- reference_image
- VIDEO
This is AdvancedSwapFaceImage for video - same selection modes, same layered mask system, same full model roster - plus max_workers for parallel frame processing. If you've hit the basic SwapFaceVideo node's biggest limitation (no way to say which face gets swapped when a clip has more than one person), this is where you fix it.
How it works
Every frame goes through the same pipeline as the image node: detect, select, embed, swap, mask, blend. The difference on video isn't the per-frame mechanics, it's that selection now has to stay consistent across frames, and that's where this node earns its keep over the basic one. face_selector_mode: reference - feeding a clear photo of the person you want via reference_image, with reference_face_distance controlling match strictness - locks onto a specific identity across the whole clip. Positional sorting (face_selector_mode: one with sort_order) is fine for a single-person video, but the moment two people are roughly the same size in frame, positional selection can flip between them from one frame to the next, which is the classic "the swap keeps jumping between faces" complaint on any face-swap-video setup.
Inputs a beginner actually sets
face_swapper_model(defaulthyperswap_1a_256) andpixel_boost(default512x512) - quality/speed. The pack's own guidance for video specifically:hyperswap_1c_256at512x512is the sweet spot, favoring a model you'd trust for stills over the absolute fastest option, since you're already paying the per-frame cost either way.face_selector_mode-reference(withreference_image+reference_face_distance) for multi-person clips where identity has to stay locked across frames;one(withface_position+sort_order) is fine for single-subject footage.max_workers(1–32, default 16) - parallel frame processing. The pack's own recommendation for video is 4–8, noticeably below the schema's ceiling of 32.- The same four mask toggles as the image node -
use_box_mask(on by default),use_occlusion_mask,use_area_mask,use_region_mask- for handling hands, hair, and other things that shouldn't get swapped over.
Everything else (face_mask_blur, the mask-region strings, face_occluder_model, face_parser_model, score_threshold) ships with the same defaults as the image node and is worth leaving alone until the basics are solid. Output is a single VIDEO.
Installing it
ComfyUI Manager: search Facefusion_comfyui, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/huygiatrng/Facefusion_comfyui.git
cd Facefusion_comfyui
pip install -r requirements.txt
Full restart needed - new nodes don't appear from a browser refresh. First run downloads whichever swapper, occluder, and parser models you've picked into custom_nodes/Facefusion_comfyui/models/; nothing extra for video beyond what the image node already needs.
Common issues
The swapped face flickers between two people across the clip. Switch to face_selector_mode: reference with a clean reference photo, instead of relying on sort_order. This is the single most common problem on multi-person face-swap video, reported and confirmed on the pack's own launch thread.
Out of memory partway through a longer video. Lower max_workers first (fewer frames in flight at once), then pixel_boost, then consider inswapper_128_fp16 if you're still tight.
Hands or hair intruding on the swap. Same fix as the image node: use_occlusion_mask with face_occluder_model: xseg_1 for objects/hands, use_region_mask with bisenet_resnet_34 for hairline blending.
Render is painfully slow. GPU matters far more here than max_workers - the pack's own figures put CPU at 10–50x slower than GPU for this workload, and cranking worker count on a CPU-bound run mostly just contends for the same limited resource.
Inputs (23)
| Name | Type | Default | Description |
|---|---|---|---|
| source_images | IMAGE | — | |
| target_video | VIDEO | — | |
| api_token | STRING | -1 | — |
| face_swapper_model | COMBO | hyperswap_1a_256 | 13 options: hyperswap_1a_256, hyperswap_1b_256, hyperswap_1c_256, ghost_1_256, ghost_2_256, ghost_3_256, +7 |
| face_detector_model | COMBO | scrfd | 5 options: scrfd, retinaface, yolo_face, yunet, many |
| pixel_boost | COMBO | 512x512 | 4 options: 256x256, 512x512, 768x768, 1024x1024 |
| face_occluder_model | COMBO | xseg_1 | 4 options: none, xseg_1, xseg_2, xseg_3 |
| face_parser_model | COMBO | bisenet_resnet_34 | 3 options: none, bisenet_resnet_18, bisenet_resnet_34 |
| face_mask_blur | FLOAT | 0.300–1 | — |
| face_selector_mode | COMBO | one | 3 options: one, many, reference |
| face_position | INT | 00–100 | — |
| sort_order | COMBO | large-small | 8 options: large-small, small-large, left-right, right-left, top-bottom, bottom-top, +2 |
| score_threshold | FLOAT | 0.300–1 | — |
| use_box_mask | BOOLEAN | true | — |
| use_occlusion_mask | BOOLEAN | false | — |
| use_area_mask | BOOLEAN | false | — |
| use_region_mask | BOOLEAN | false | — |
| face_mask_areas | STRING | upper-face,lower-face,mouth | — |
| face_mask_regions | STRING | skin,nose,mouth,upper-lip,lower-lip | — |
| face_mask_padding | STRING | 0,0,0,0 | — |
| max_workers | INT | 161–32 | — |
| reference_imageopt | IMAGE | — | |
| reference_face_distanceopt | FLOAT | 0.600–1 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| VIDEO | VIDEO | — |