Nodes/ComfyUI-FaceChain/FC ReplaceImage
ComfyUI Node

FC ReplaceImage

FC ReplaceImage — swap a face region in, box and mask driven

By THtianhao·Created 3 years ago·Updated about a year ago· 147
FC ReplaceImage
  • source_image
  • replace_image
  • face_box
  • mask
  • IMAGE

FC ReplaceImage is a face-region replacement node from ComfyUI-FaceChain: it takes a source image, a replacement image, a face box, and a mask, and returns the source with the replacement composited into the face area. It's the "put the new face exactly here, and only here" node - the explicit, box-and-mask-driven cousin of the mask-only FC ReplaceByMask.

It's also one of the pack's older/underscore-class names, superseded in the current node list by the FC FaceSegAndReplace and FC ReplaceByMask pairing. You'll mostly meet it in old workflow JSONs and pack listings rather than new graphs - but its inputs tell you exactly how it thinks, which is instructive for building your own.

Inputs

  • source_image (IMAGE) - the base photo you're compositing onto.
  • replace_image (IMAGE) - the new face/content to paste in.
  • face_box (BOX) - where the face is. This anchors the replacement region to a detected (or supplied) bounding box.
  • mask (MASK) - the fine-grained region inside/around the box where the replacement actually wins. The box says where roughly, the mask says exactly.

One IMAGE output: the composited result.

What it teaches you about the pack's design

Notice the split of responsibilities: the box positions the region; the mask carves the exact boundary. That's the pack's mental model in miniature - FC FaceDetectCrop hands out boxes, FC FaceSegment hands out masks, and the compositing nodes consume both. If you understand this node's inputs, you understand how to wire the whole pack: detector → box → (sampler on the crop) → segment → mask → this node → pasted result.

The practical lesson for building your own graph: you don't actually need this specific node - FC ReplaceByMask does the same compositing with just image+image+mask, and you can derive the mask from the box yourself. But the box input here is a handy constraint if you want the replacement forcibly limited to the detected face region.

Install and honesty

Same pack, standard drill: ComfyUI Manager (search "ComfyUI-FaceChain") or git clone https://github.com/THtianhao/ComfyUI-FaceChain into custom_nodes/, restart. Pure compositing math, so no per-run model download for the node itself - but any graph that produces the BOX and MASK for it pulls in the pack's ModelScope detection and segmentation models on first use.

The straightforward takeaway: don't build new workflows on this legacy name. Prefer FC ReplaceByMask (simpler) or FC FaceSegAndReplace (does the whole swap with a built-in mask). This node is the historical bridge between them, and knowing it exists means you won't be baffled when an old workflow demands it.

Categoryfacechain/model

Inputs (4)

NameTypeDefaultDescription
source_imageIMAGE
replace_imageIMAGE
face_boxBOX
maskMASK

Outputs (1)

NameTypeDescription
IMAGEIMAGE