Agent skill

Faceswap

by calesthio in calesthio/OpenMontage

Swap faces in a video using AI via the HeyGen API. An agent skill from calesthio/OpenMontage.

AGPL-3.0Auto-check passedMedia & Creative

Install Faceswap

skills CLI
$ npx skills add calesthio/OpenMontage --skill faceswap -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install calesthio/OpenMontage faceswap --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/calesthio/OpenMontage.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/faceswap .claude/skills/faceswap && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
faceswap
GitHub stars
66k
Token cost
~1.8k tokens
SKILL.md length
271 words
Files
1
Skills in repo
41
Repo updated
First seen
Licence
AGPL-3.0

At a glance

Swap faces in a video using AI via the HeyGen API. An agent skill from calesthio/OpenMontage.

  • Works in 4 steps: Call POST /v1/workflows/executions with… → Receive a execution_id in the response → Poll GET /v1/workflows/executions/{id}… → …
  • Replacing a face in a video with another face
  • SKILL.md covers Authentication, Default Workflow, Execute Face Swap and Check Status, plus 3 more sections
  • Calls curl; reaches api.heygen.com and resource.heygen.ai; needs HEYGEN_API_KEY

What it does

Faceswap is an agent skill from calesthio/OpenMontage. Swap faces in a video using AI via the HeyGen API. Use when: (1) Replacing a face in a video with another face, (2) Face swapping from a source image onto a target video, (3) Creating personalized videos by swapping in a person's face, (4) Working with HeyGen's /v1/workflows/executions endpoint for face swap processing.

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Media & Creative. It works with HeyGen. The repository describes itself as: World's first open-source, agentic video production system. 12 production pipelines, 100+ tools, 700+ agent skill and production-knowledge files. Turn your AI coding assistant… The licence is AGPL-3.0.

When your agent uses it

  • Replacing a face in a video with another face
  • Face swapping from a source image onto a target video
  • Creating personalized videos by swapping in a persons face
  • Working with HeyGens /v1/workflows/executions endpoint for face swap processing

Example prompts

  • “s face, (4) Working with HeyGen”
  • “/faceswap”

Requirements

  • Python 3
  • A credential in HEYGEN_API_KEY
  • Pre-approved tools (allowed-tools): mcp__heygen__*

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Call POST /v1/workflows/executions with workflow_type: "FaceswapNode", a source face image, and a target video
  2. Receive a execution_id in the response
  3. Poll GET /v1/workflows/executions/{id} every 10 seconds until status is completed
  4. Use the returned video_url from the output

What it can do on your machine

Read from SKILL.md and the folder at commit 9327439. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • mcp__heygen__*

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • curl

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • api.heygen.com
    • resource.heygen.ai

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • HEYGEN_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Faceswap loads about 1.8k tokens when it runs. Until then it costs about 83 tokens; SKILL.md has 271 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~83
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from calesthio/OpenMontage at commit 9327439, republished under its AGPL-3.0 licence (© calesthio). 271 words, ~1,813 tokens.

Download SKILL.mdSave it as .claude/skills/faceswap/SKILL.md (or your agent's skills folder).
name
faceswap
description
Swap faces in a video using AI via the HeyGen API. Use when: (1) Replacing a face in a video with another face, (2) Face swapping from a source image onto a target video, (3) Creating personalized videos by swapping in a person's face, (4) Working with HeyGen's /v1/workflows/executions endpoint for face swap processing.
allowed-tools
mcp__heygen__*

Face Swap (HeyGen API)

Swap a face from a source image into a target video using GPU-accelerated AI processing. The source image provides the face to swap in, and the target video receives the new face.

Authentication

All requests require the X-Api-Key header. Set the HEYGEN_API_KEY environment variable.

bash
curl -X POST "https://api.heygen.com/v1/workflows/executions" \
  -H "X-Api-Key: $HEYGEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"workflow_type": "FaceswapNode", "input": {"source_image_url": "https://example.com/face.jpg", "target_video_url": "https://example.com/video.mp4"}}'

Default Workflow

  1. Call POST /v1/workflows/executions with workflow_type: "FaceswapNode", a source face image, and a target video
  2. Receive a execution_id in the response
  3. Poll GET /v1/workflows/executions/{id} every 10 seconds until status is completed
  4. Use the returned video_url from the output

Execute Face Swap

Endpoint

POST https://api.heygen.com/v1/workflows/executions

Request Fields
FieldTypeReqDescription
workflow_typestringYMust be "FaceswapNode"
input.source_image_urlstringYURL of the face image to swap in
input.target_video_urlstringYURL of the video to apply the face swap to
curl
bash
curl -X POST "https://api.heygen.com/v1/workflows/executions" \
  -H "X-Api-Key: $HEYGEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "workflow_type": "FaceswapNode",
    "input": {
      "source_image_url": "https://example.com/face-photo.jpg",
      "target_video_url": "https://example.com/original-video.mp4"
    }
  }'
TypeScript
typescript
interface FaceswapInput {
  source_image_url: string;
  target_video_url: string;
}

interface ExecuteResponse {
  data: {
    execution_id: string;
    status: "submitted";
  };
}

async function faceswap(input: FaceswapInput): Promise<string> {
  const response = await fetch("https://api.heygen.com/v1/workflows/executions", {
    method: "POST",
    headers: {
      "X-Api-Key": process.env.HEYGEN_API_KEY!,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      workflow_type: "FaceswapNode",
      input,
    }),
  });

  const json: ExecuteResponse = await response.json();
  return json.data.execution_id;
}
Python
python
import requests
import os

def faceswap(source_image_url: str, target_video_url: str) -> str:
    payload = {
        "workflow_type": "FaceswapNode",
        "input": {
            "source_image_url": source_image_url,
            "target_video_url": target_video_url,
        },
    }

    response = requests.post(
        "https://api.heygen.com/v1/workflows/executions",
        headers={
            "X-Api-Key": os.environ["HEYGEN_API_KEY"],
            "Content-Type": "application/json",
        },
        json=payload,
    )

    data = response.json()
    return data["data"]["execution_id"]
Response Format
json
{
  "data": {
    "execution_id": "node-gw-f1s2w3p4",
    "status": "submitted"
  }
}

Check Status

Endpoint

GET https://api.heygen.com/v1/workflows/executions/{execution_id}

curl
bash
curl -X GET "https://api.heygen.com/v1/workflows/executions/node-gw-f1s2w3p4" \
  -H "X-Api-Key: $HEYGEN_API_KEY"
Response Format (Completed)
json
{
  "data": {
    "execution_id": "node-gw-f1s2w3p4",
    "status": "completed",
    "output": {
      "video_url": "https://resource.heygen.ai/faceswap/output.mp4"
    }
  }
}

Polling for Completion

typescript
async function faceswapAndWait(
  input: FaceswapInput,
  maxWaitMs = 600000,
  pollIntervalMs = 10000
): Promise<string> {
  const executionId = await faceswap(input);
  console.log(`Submitted face swap: ${executionId}`);

  const startTime = Date.now();
  while (Date.now() - startTime < maxWaitMs) {
    const response = await fetch(
      `https://api.heygen.com/v1/workflows/executions/${executionId}`,
      { headers: { "X-Api-Key": process.env.HEYGEN_API_KEY! } }
    );
    const { data } = await response.json();

    switch (data.status) {
      case "completed":
        return data.output.video_url;
      case "failed":
        throw new Error(data.error?.message || "Face swap failed");
      case "not_found":
        throw new Error("Workflow not found");
      default:
        await new Promise((r) => setTimeout(r, pollIntervalMs));
    }
  }

  throw new Error("Face swap timed out");
}

Usage Examples

Basic Face Swap
bash
curl -X POST "https://api.heygen.com/v1/workflows/executions" \
  -H "X-Api-Key: $HEYGEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "workflow_type": "FaceswapNode",
    "input": {
      "source_image_url": "https://example.com/headshot.jpg",
      "target_video_url": "https://example.com/presentation.mp4"
    }
  }'
Chain with Avatar Video

Generate an avatar video first, then swap in a custom face:

python
import time

# Step 1: Generate avatar video
avatar_execution_id = requests.post(
    "https://api.heygen.com/v1/workflows/executions",
    headers={"X-Api-Key": os.environ["HEYGEN_API_KEY"], "Content-Type": "application/json"},
    json={
        "workflow_type": "AvatarInferenceNode",
        "input": {
            "avatar": {"avatar_id": "Angela-inblackskirt-20220820"},
            "audio_list": [{"audio_url": "https://example.com/speech.mp3"}],
        },
    },
).json()["data"]["execution_id"]

# Step 2: Wait for avatar video to complete
while True:
    status = requests.get(
        f"https://api.heygen.com/v1/workflows/executions/{avatar_execution_id}",
        headers={"X-Api-Key": os.environ["HEYGEN_API_KEY"]},
    ).json()["data"]
    if status["status"] == "completed":
        avatar_video_url = status["output"]["video"]["video_url"]
        break
    time.sleep(10)

# Step 3: Swap in a custom face
faceswap_execution_id = faceswap(
    source_image_url="https://example.com/custom-face.jpg",
    target_video_url=avatar_video_url,
)

Best Practices

  1. Use a clear, front-facing face photo — the source image should show a single face with good lighting
  2. Face swap is GPU-intensive — expect 1-3 minutes processing time, poll every 10 seconds
  3. Source image quality matters — higher resolution face photos produce better results
  4. One face per source image — the source should contain exactly one face to swap in
  5. Works with any video — the target video can be an avatar video, a recording, or any video with visible faces
  6. Chain with other workflows — generate an avatar video first, then swap in a custom face for personalization

© calesthio, AGPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/faceswap of calesthio/OpenMontage.

Open the folder on GitHubat commit 9327439

Compare with similar skills

Faceswap next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Faceswap compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Faceswap this skillcalesthio/OpenMontage66k—~1.8kAutomated safety check: PassAGPL-3.0
Broll Shot Exporterduo1998-cell/erduo-broll-loop-engineering209—~504Automated safety check: PassMIT
Tiktok Launch Videocognyai/claude-code-marketing-skills104—~2.7kAutomated safety check: NotesNone
Od Defaultnexu-io/open-design100k—~919Automated safety check: PassApache-2.0
Threads To Reelsbam-bam-2/solo-skills367—~844Automated safety check: NotesMIT
Heygen Best Practicesdavila7/claude-code-templates32k—~629Automated safety check: PassMIT

Similar skills

  • Broll Shot Export

    erduo1998-cell/erduo-broll-loop-engineering

    Legacy compatibility export for requested windows from a verified pre-v1.0.1 Master.

    209 GitHub stars~504 tokensUpdated 18 days ago
    Media & CreativeAuto-check passed
  • Tiktok Launch Video

    cognyai/claude-code-marketing-skills

    Produce a 9:16 TikTok-native launch video for a product, feature, or campaign using HyperFrames.

    104 GitHub stars~2.7k tokensUpdated 3 mo ago
    Media & CreativeAuto-check: notes
  • Od Default

    nexu-io/open-design

    Hidden fallback scenario for free-form Home prompts. An agent skill from nexu-io/open-design.

    100k GitHub stars~919 tokensUpdated today
    Media & CreativeAuto-check passed
  • Threads To Reels

    bam-bam-2/solo-skills

    밤밤의 스레드 성과글을 소재로 아이폰 사진을 붙여 인스타 릴스를 만들 때 읽을 것. An agent skill from bam-bam-2/solo-skills.

    367 GitHub stars~844 tokensUpdated 24 days ago
    Media & CreativeAuto-check: notes
  • Heygen Best Practices

    davila7/claude-code-templates

    Best practices for HeyGen - AI avatar video creation API. An agent skill from davila7/claude-code-templates.

    32k GitHub stars~629 tokensUpdated today
    Media & CreativeAuto-check passed
  • Heygen

    Anil-matcha/awesome-muse-connectors

    HeyGen avatar and talking-head video: prompt-to-video agent, multi-scene avatar video, status polling, avatar and voice lists.

    1.3k GitHub stars~728 tokensUpdated 3 days ago
    Media & CreativeAuto-check passed

More from calesthio/OpenMontage

All 41 skills in this repo
  • Video Understand

    calesthio/OpenMontage

    Understand video content locally using ffmpeg frame extraction and Whisper transcription.

    66k GitHub stars~841 tokensUpdated 5 days ago
    Auto-check passed
  • Avatar Video

    calesthio/OpenMontage

    Create AI avatar videos with precise control over avatars, voices, scripts, scenes, and backgrounds using HeyGen's v2 API.

    66k GitHub stars~1.6k tokensUpdated 5 days ago
    Auto-check passed
  • D3 Viz

    calesthio/OpenMontage

    Creating interactive data visualisations using d3.js. An agent skill from calesthio/OpenMontage.

    66k GitHub starsUsed in 3 repos~5.4k tokens
    Auto-check passed
  • Create Video

    calesthio/OpenMontage

    Create videos from a text prompt using HeyGen's Video Agent.

    66k GitHub stars~1.3k tokensUpdated 5 days ago
    Auto-check passed
  • Threejs World Generation

    calesthio/OpenMontage

    Build deterministic, editable, free-viewpoint Three.js worlds from text or structured briefs.

    66k GitHub stars~2k tokensUpdated 5 days ago
    Auto-check passed
  • Video Edit

    calesthio/OpenMontage

    Edit videos locally using ffmpeg. An agent skill from calesthio/OpenMontage.

    66k GitHub stars~855 tokensUpdated 5 days ago
    Auto-check: notes

Works with

Questions about Faceswap

What does Faceswap do?

Swap faces in a video using AI via the HeyGen API. An agent skill from calesthio/OpenMontage. Faceswap is an agent skill from calesthio/OpenMontage. Swap faces in a video using AI via the HeyGen API.

When should I use Faceswap?

Faceswap fits situations like: replacing a face in a video with another face; face swapping from a source image onto a target video; creating personalized videos by swapping in a persons face; working with HeyGens /v1/workflows/executions endpoint for face swap processing.

How do I install Faceswap in Claude Code?

Run `npx skills add calesthio/OpenMontage --skill faceswap -a claude-code`. Or copy the skill folder (.agents/skills/faceswap in calesthio/OpenMontage) into .claude/skills/faceswap in your project. Claude Code loads it when a task matches its description.

How do I install Faceswap in Codex?

Run `npx skills add calesthio/OpenMontage --skill faceswap -a codex`. Or copy the skill folder (.agents/skills/faceswap in calesthio/OpenMontage) into .agents/skills/faceswap in your project. Codex loads it when a task matches its description.

Can I use Faceswap in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add calesthio/OpenMontage --skill faceswap -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/faceswap, .gemini/skills/faceswap, .github/skills/faceswap and .opencode/skills/faceswap in your project.

What does Faceswap need to run?

Going by SKILL.md and its folder, Faceswap needs the command-line tools its instructions call (curl) and credentials named HEYGEN_API_KEY. Our summary lists: Python 3; A credential in HEYGEN_API_KEY. Its frontmatter pre-approves these tools: mcp__heygen__*.

Does Faceswap access the network?

SKILL.md names 2 domains. In commands or code: api.heygen.com and resource.heygen.ai; the agent is likely to contact these when it follows the instructions. This is read from the text; nothing was executed.

Is Faceswap safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Faceswap use?

Faceswap is published under the AGPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Faceswap use?

About 1.8k tokens (SKILL.md is roughly 7.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Faceswap?

Skills that share tags, products or a category with Faceswap: Broll Shot Export (erduo1998-cell/erduo-broll-loop-engineering, 209 stars), Tiktok Launch Video (cognyai/claude-code-marketing-skills, 104 stars), Od Default (nexu-io/open-design, 100k stars) and Threads To Reels (bam-bam-2/solo-skills, 367 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Faceswap?

calesthio (a GitHub user) maintains it in calesthio/OpenMontage, which has 65,614 GitHub stars. The repository holds 41 skills in this directory. The repository was last updated on October 3, 2026.

Source: calesthio/OpenMontage on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.