Nodes/Comflowy's Custom Nodes/Replicate xiankgx/face-swap
ComfyUI Node

Replicate xiankgx/face-swap

Swap a face via Replicate without hosting a single model

By 6174·Created 2 years ago·Updated 2 years ago· 17
Replicate xiankgx/face-swap
  • source_image
  • local_target
  • local_source
  • STRING
target_image
request_id
det_thresh0.10
cache_days10
weight0.50
force_rerunfalse

Face swapping is one of those jobs where a local setup gets annoyingly heavy fast - you're pulling in InsightFace, face analyzers, and a 500MB inswapper model, and the VRAM bill keeps climbing. This node sidesteps all of it: it's a thin wrapper around Replicate's xiankgx/face-swap model, so the actual swap happens in the cloud. You feed it a face and a photo, it sends the job off, and the swapped image comes back into your graph. No GPU, no model download, no InsightFace install.

It belongs to the Comflowy pack's bigger pitch: most of what you run locally is open-source, and the closed or fiddly models you can't easily run get bridged in as API nodes instead. This is one of those, on the "Replicate" side of the house.

How it actually works

The pack auto-generates its Replicate nodes from each model's OpenAPI schema, stored in the repo's schemas/ folder. When you run the node, it posts a payload to app.comflowy.com with model_type: "replicate", the pinned model version, and your inputs. Comflowy's backend runs the actual Replicate job and bills your Comflowy credits - you never need your own Replicate API token. The result URL comes back, the node downloads the image, and hands it to your workflow as a tensor.

One honest gotcha before you get excited: this node outputs a STRING, not an IMAGE. It's the swapped image's URL. That's unusual for the pack's image nodes and it makes the node awkward to chain directly into a Save Image - you'll more likely read the URL and fetch it elsewhere, or grab it for inspection. Worth knowing going in, because the first time you run it you'll stare at a text output and think you broke something.

The inputs that matter

  • source_image (IMAGE): the face you want to appear. Wire in your reference photo.
  • target_image (STRING): a URL pointing at the photo whose face gets replaced. Yes, one is a tensor and one is a URL - the schema's quirks made it that way. local_target and local_source are also there as direct image inputs if you'd rather wire both in.
  • weight (default 0.5): how strongly the source face blends in. Too high and it can look pasted; too low and the swap is timid.
  • det_thresh (default 0.1): face-detection threshold. Lower catches more (smaller/blurrier) faces.
  • cache_days (default 10): results are cached server-side for this many days, so identical runs don't re-bill you. Pair it with force_rerun to bypass the cache when you actually want a fresh result.

Install

Same story as every Comflowy node. Install the pack via ComfyUI Manager (search "Comflowy's Custom Nodes"), or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/6174/comflowy-nodes

Restart ComfyUI. The only Python dependency is requests - everything else runs server-side. Then drop in a Comflowy Set API Key node once, paste your key from your Comflowy account settings, and you're done. No model files land on your machine.

Where people get burned

The usual Comflowy failure mode applies: if the network can't reach app.comflowy.com, the request fails. Because this node outputs a string, you'll get the error message back as its output - which, inconvenient as that is, at least tells you what went wrong. (The pack's image-outputting nodes are worse: they quietly return a black placeholder, so a black rectangle in any Comflowy workflow means "check your network / your API key," not "the swap failed.") Also remember every run costs credits, so think about how you'll consume that URL before you build a whole workflow around it.

CategoryComflowy Replicate

Inputs (9)

NameTypeDefaultDescription
target_imageoptSTRING
source_imageoptIMAGE
request_idoptSTRING
det_threshoptFLOAT0.10
local_targetoptIMAGE
local_sourceoptIMAGE
cache_daysoptINT10
weightoptFLOAT0.50
force_rerunoptBOOLEANfalse

Outputs (1)

NameTypeDescription
STRINGSTRING