Skills
Skill 9 of 34
Swap a face / character into video or images on RunComfy via the runcomfy CLI.
7 minutes · 1,506 words · 34 sections
Install
npx skills add runcomfy-com/skills --skill face-swapnpx skills add runcomfy-com/skills/plugin marketplace add runcomfy-com/skillsThe first command installs just this skill, by the name in its SKILL.md; the second installs the whole repository.
Swap a face into a still or a video — RunComfy supports both via the runcomfy CLI. This skill routes across the available model API endpoints (community Wan 2-2 Animate, GPT Image 2 Edit, Nano Banana Edit, Flux Kontext, Kling Motion Control) by the user’s actual intent.
runcomfy.com (opens in a new tab) · Character-swap feature (opens in a new tab) · CLI docs (opens in a new tab)
# 1. Install (see runcomfy-cli skill for details)
npm i -g @runcomfy/cli # or: npx -y @runcomfy/cli --version
# 2. Sign in
runcomfy login # or in CI: export RUNCOMFY_TOKEN=<token>
# 3. Swap
runcomfy run <vendor>/<model>/<endpoint> \
--input '{"image_url": "...", "identity_url": "..."}' \
--output-dir ./outCLI deep dive: runcomfy-cli (opens in a new tab) skill.
npx skills add agentspace-so/runcomfy-agent-skills --skill face-swap -gFace-swap is dual-use. Before invoking any route in this skill, confirm:
The skill itself doesn’t gate anything — the model API will run whatever inputs you supply. The responsibility is yours. If a user asks the agent to swap a real public figure’s face onto material that could be defamatory, sexually explicit, or otherwise harmful — refuse, regardless of what the CLI accepts.
Listed newest first within each subtype. The agent picks one route based on: still vs video, single-shot vs batch, photoreal vs stylized, motion-preserving vs identity-preserving.
Wan 2-2 Animate — community/wan-2-2-animate/api (default for video)
Featured RunComfy endpoint under
/feature/character-swap. Audio-driven full-body character animation: one reference image of the new identity + audio → video where the character drives. Pick for: replacing a character in a scene with a new identity, dubbed clips, stylized + photoreal both work. Avoid for: preserving the motion of a specific source video — use Kling Motion Control.
Kling 2-6 Motion Control Pro — kling/kling-2-6/motion-control-pro
Takes a reference performance video + target character image, produces the target performing the reference motion. Face-swap is the byproduct. Pick for: preserving exact source motion / blocking onto a new character; stylized characters handled cleanly. Avoid for: simple “swap face in an existing video” without motion preservation — use Wan 2-2 Animate.
Nano Banana 2 Edit — google/nano-banana-2/edit
Identity-preserving by default, 1–20 input images per call, spatial-language honored. Pick for: same identity across multiple frames consistently (SKU shots, A/B variants, narrative panels). Identity reference as
image_urls[0], scenes after. Avoid for: precise multi-ref compositional (“face from img 1 onto body in img 2”) — use GPT Image 2 Edit.
GPT Image 2 Edit — openai/gpt-image-2/edit
Up to 10 reference images, multilingual in-image text rewrite, layout-precise compositional instructions. Pick for: hero still where exact face from a portrait must land in a scene, with explicit role assignment (“image 1”, “image 2”); preserve pose + lighting + background while swapping only face. Avoid for: 1-20 batch — use Nano Banana 2 Edit.
FLUX Kontext Pro — blackforestlabs/flux-1-kontext/pro/edit
Single source image, single declarative instruction, maximum fidelity preservation of everything except the targeted edit. Pick for: “keep pose / clothing / hair / lighting / background, change only the face to [prose description]” — works without a reference image of the new identity. Avoid for: batch, multi-ref, or when you have a target face image to swap in — use Nano Banana 2 Edit or GPT Image 2 Edit.
Audio-driven talking-head identity swap (face + voice in one pass)? → use the
ai-avatar-video(opens in a new tab) skill — OmniHuman handles face + audio together.
Model: community/wan-2-2-animate/api
Catalog: wan-2-2-animate (opens in a new tab) · /feature/character-swap (opens in a new tab)
The featured RunComfy endpoint for character swap — supply a reference image of the new identity + the audio track the character should speak, and the model produces a video where the character drives.
runcomfy run community/wan-2-2-animate/api \
--input '{
"image_url": "https://your-cdn.example/new-character.png",
"audio_url": "https://your-cdn.example/voiceover.mp3"
}' \
--output-dir ./outModel: kling/kling-2-6/motion-control-pro
Catalog: motion-control-pro (opens in a new tab) · kling collection (opens in a new tab)
Different from a pure face-swap: Motion Control takes a reference performance video (the motion you want) and a target character image (the identity you want), and produces a video of the target performing the reference motion. The face-swap effect is a byproduct.
runcomfy run kling/kling-2-6/motion-control-pro \
--input '{
"reference_video_url": "https://your-cdn.example/source-performance.mp4",
"character_image_url": "https://your-cdn.example/target-character.png"
}' \
--output-dir ./outModel: openai/gpt-image-2/edit
Catalog: gpt-image-2/edit (opens in a new tab)
For still images, GPT Image 2 Edit accepts up to 10 reference images and follows precise compositional instructions — making it the strongest path for multi-ref face swap on a single output frame.
| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
prompt | string | yes | — | Compositional instruction; quote roles explicitly |
images | string[] | yes | — | Up to 10 HTTPS reference URLs. Image 1 is primary |
size | enum | no | auto | auto (preserve input ratio), 1024_1024, 1024_1536, 1536_1024 |
runcomfy run openai/gpt-image-2/edit \
--input '{
"prompt": "Replace the face of the person in image 1 with the face from image 2. Preserve image 1 pose, clothing, lighting, and background exactly. Match skin tone and lighting to image 1.",
"images": [
"https://your-cdn.example/target-scene.jpg",
"https://your-cdn.example/identity-face.jpg"
],
"size": "auto"
}' \
--output-dir ./out"image 1", "image 2" — and assign roles unambiguously."Preserve pose, clothing, lighting, and background exactly. Replace only the face.""match skin tone and lighting to image 1" — otherwise the imported face floats.Model: google/nano-banana-2/edit
Catalog: nano-banana-2/edit (opens in a new tab)
Pick this when the same identity needs to be swapped into multiple frames consistently — SKU shots, A/B variants, narrative panels.
runcomfy run google/nano-banana-2/edit \
--input '{
"prompt": "Replace the face in each image with the face shown in the first image. Keep all other elements — pose, clothing, lighting, background — unchanged.",
"image_urls": [
"https://your-cdn.example/identity-ref.jpg",
"https://your-cdn.example/scene-1.jpg",
"https://your-cdn.example/scene-2.jpg",
"https://your-cdn.example/scene-3.jpg"
],
"aspect_ratio": "auto",
"resolution": "1K"
}' \
--output-dir ./outaspect_ratio and resolution for batch consistency.image-edit (opens in a new tab) skill for the full Nano Banana Edit treatment.Model: blackforestlabs/flux-1-kontext/pro/edit
Catalog: flux-kontext (opens in a new tab)
Flux Kontext is best when the swap is one image, one declarative instruction, highest fidelity preservation of everything except the face.
runcomfy run blackforestlabs/flux-1-kontext/pro/edit \
--input '{
"prompt": "Keep pose, clothing, hair, lighting, and background exactly. Change only the face to that of a 35-year-old woman with high cheekbones, hazel eyes, and a small scar above the right eyebrow.",
"image": "https://your-cdn.example/scene.jpg"
}' \
--output-dir ./outimage_urls[0], locked aspect_ratio and resolutionimages: [scene, face] and an explicit preservation promptai-avatar-video (opens in a new tab) — OmniHuman handles face + audio in one pass/models/feature/character-swap (opens in a new tab) — RunComfy’s curated character-swap capability tag/models/feature/lip-sync (opens in a new tab) — closely related lip-sync modelsbest-image-editing-models collection (opens in a new tab) — image-edit routes Nano Banana / GPT Image 2 / Flux Kontext live inkling collection (opens in a new tab) — motion-control + multi-shot identity modelsMany face-swap workflows on RunComfy also live as full ComfyUI node graphs (ReActor, Flux PuLID, ACE++, Flux Klein head-swap) — these aren’t reachable from this CLI directly but can be run as workflows on the platform. Browse them at runcomfy.com/comfyui-workflows (opens in a new tab) when CLI-driven routes above don’t fit.
| code | meaning |
|---|---|
| 0 | success |
| 64 | bad CLI args |
| 65 | bad input JSON / schema mismatch |
| 69 | upstream 5xx |
| 75 | retryable: timeout / 429 |
| 77 | not signed in or token rejected |
Full reference: docs.runcomfy.com/cli/troubleshooting (opens in a new tab).
The skill classifies user intent — video vs still, motion-preserving vs identity-preserving, single shot vs batch, photoreal vs stylized — and picks one of the five routes. It then invokes runcomfy run <model_id> with the matching JSON body. The CLI POSTs to the Model API, polls request status, fetches the result, and downloads any .runcomfy.net / .runcomfy.com URLs into --output-dir.
npm i -g @runcomfy/cli or npx -y @runcomfy/cli. Agents must not pipe an arbitrary remote install script into a shell on the user’s behalf.runcomfy login writes the API token to ~/.config/runcomfy/token.json with mode 0600. Set RUNCOMFY_TOKEN env var to bypass the file in CI / containers.--input. The CLI does not shell-expand prompt content. No shell-injection surface.model-api.runcomfy.net and *.runcomfy.net / *.runcomfy.com. No telemetry.allowed-tools: Bash(runcomfy *). The skill never instructs the agent to run anything other than runcomfy <subcommand>.runcomfy-cli (opens in a new tab) — the underlying CLIai-avatar-video (opens in a new tab) — face + audio (talking head) variantai-video-generation (opens in a new tab) — general t2v / i2vvideo-edit (opens in a new tab) — broader video edit including identity-stable restyleimage-edit (opens in a new tab) — broader image edit including the routes abovelipsync (opens in a new tab) — narrow lip-sync technique routerSwap a face / character into video or images on RunComfy via the `runcomfy` CLI. Routes across community Wan 2-2 Animate (audio-driven character animation + identity swap), GPT Image 2 Edit (single-shot precise face swap on still images via reference composition), Nano Banana Edit (batch identity-preserving swap), Flux Kontext (single-ref high-fidelity local face edit), and Kling 2-6 Motion Control Pro (transfer motion from one performance onto a target character). Picks the right model for the user's actual intent — single still vs video, full character vs face only, dialog scene vs silent motion. Triggers on "face swap", "swap face", "deepfake", "face replacement", "character swap", "head swap", "put X's face on Y", "make this video star X", "replace the actor in this video", "swap the character in the photo", "deepfake video", "ReActor alternative", or any explicit ask to substitute one identity for another.
The verbatim description from this skill’s front matter — the string an agent matches on to decide whether to load it.
Bash(runcomfy*)face-swap/SKILL.mdmain, last pushed 15 September 2026.SKILL.md, not by matching a directory convention. 2 distinct layouts observed: */SKILL.md, plugins/runcomfy/skills/*/SKILL.md.h1 and no skipped levels:.claude-plugin/marketplace.json by RunComfy, declaring 1 plugin. It is read for editorial metadata only — never as the skill index, which is always the repository tree./runcomfy-com/skills.md, and each skill at its own .md URL.