Nodes/Facefusion_comfyui/FF API: Swap Face (Video)
ComfyUI Node

FF API: Swap Face (Video)

Basic face swapping across a whole clip, in parallel

By huygiatrng·Created 9 months ago·Updated 25 days ago· 89
FF API: Swap Face (Video)
  • source_images
  • target_video
  • VIDEO
api_token-1
face_swapper_modelhyperswap_1a_256
face_detector_modelscrfd
max_workers16

This is SwapFaceImage's video sibling, and it inherits the same deal: it sits in the "FaceFusion API" category with an api_token field, but the default of -1 means it runs entirely locally - no key, no internet, just your GPU chewing through frames. The one genuinely new thing it adds over the image version is max_workers, which controls how many frames get processed in parallel instead of one at a time.

Like its image counterpart, this is the basic swap node - no face selector, no sort order, no mask picker. It swaps whatever the detector finds, frame by frame, and stitches the result back into a video. If you need to pin down exactly which face gets swapped in a multi-person clip, that control lives one node over in AdvancedSwapFaceVideo.

How it works

Same detect → embed → swap → blend pipeline as the image node, just run once per frame and fanned out across worker threads so you're not waiting for a single-threaded pass through a few hundred frames. One detail worth knowing: this node's face_swapper_model default is hyperswap_1a_256, not the hyperswap_1c_256 the image node defaults to - the pack seems to lean toward the faster variant for video, where you're paying the model's cost once per frame instead of once.

Inputs and outputs that matter

  • source_images (IMAGE) / target_video (VIDEO) - the face, and the clip to swap it into.
  • face_swapper_model (default hyperswap_1a_256, 13 choices) and face_detector_model (default scrfd) - same model list as every other swap node in the pack.
  • max_workers (1–32, default 16) - how many frames get processed at once. Higher isn't free: it trades CPU/IO and VRAM pressure for speed, and pushing it too high on a modest machine can make things stall rather than speed up.

Output is a single VIDEO, ready to hand to a Save Video node.

Installing it

ComfyUI Manager: search Facefusion_comfyui and install. Or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/huygiatrng/Facefusion_comfyui.git
cd Facefusion_comfyui
pip install -r requirements.txt

Then a full restart - not a page refresh. First run downloads whichever swapper model you've picked plus the detector into custom_nodes/Facefusion_comfyui/models/, same as the image nodes; nothing extra to fetch for video specifically.

Common issues

Faces flicker or swap back and forth between people across frames. This is the single most common complaint with any face-swap-on-video setup, this pack included - when a clip has two or more people, positional face selection can pick a different person frame to frame as they move. This basic node has no selector to fix that; AdvancedSwapFaceVideo's face_selector_mode: reference (lock onto a specific face via a reference photo) is the actual fix if you hit this.

Running out of memory on longer clips. Lower max_workers first - fewer frames in flight at once means less peak memory. If that's not enough, switch to a lighter model like inswapper_128_fp16.

Install issues (nodes missing, ONNX load errors). Identical to the image node: make sure pip install -r requirements.txt actually ran inside ComfyUI's own Python environment (portable installs need python_embeded's pip specifically), then fully restart. A model that fails to load with an ONNX runtime error is almost always a partial or locked download - delete it from custom_nodes/Facefusion_comfyui/models/ and let it re-fetch.

It's slow, even with several workers. GPU still matters more than worker count. The pack's own guidance: 10–50x faster on GPU than CPU, and its "for video" recommendation is hyperswap_1c_256 at 4–8 workers rather than cranking max_workers to the schema's ceiling of 32.

CategoryFaceFusion API

Inputs (6)

NameTypeDefaultDescription
source_imagesIMAGE
target_videoVIDEO
api_tokenSTRING-1
face_swapper_modelCOMBOhyperswap_1a_25613 options: hyperswap_1a_256, hyperswap_1b_256, hyperswap_1c_256, ghost_1_256, ghost_2_256, ghost_3_256, +7
face_detector_modelCOMBOscrfd5 options: scrfd, retinaface, yolo_face, yunet, many
max_workersINT161–32

Outputs (1)

NameTypeDescription
VIDEOVIDEO