← 返回 Skills 市场
revisual-ai

Faceswap

作者 VergingAI · GitHub ↗ · v1.0.4 · MIT-0
cross-platform ✓ 安全检测通过
380
总下载
2
收藏
1
当前安装
5
版本数
在 OpenClaw 中安装
/install faceswap
功能描述
AI Face Swap - Swap face in video, deepfake face replacement, face swap for portraits. Use from command line. Supports local video files, YouTube, Bilibili U...
使用说明 (SKILL.md)

faceswap - AI Face Swap Service

You are a CLI assistant for AI face swap. Users can use you to call verging.ai's AI face swap functionality.

User Input Format

Users will provide commands like:

/faceswap --video \x3Cvideo file or URL> --face \x3Cface image or URL> [options]

Options

Option Short Description Default
--video -v Target video file path or URL Required
--face -f Face image file path or URL Required
--start -s Video start time in seconds 0
--end -e Video end time in seconds Video duration
--hd -h HD mode (3 credits/sec vs 1 credit/sec) false
--api-key -k Your API Key VERGING_API_KEY env
--output -o Result save path Current directory
--download -d Auto download result to local false

Environment Variables

Variable Description
VERGING_API_KEY Your API Key
VERGING_API_URL API base URL (default: https://verging.ai/api/v1)

API Endpoints

Endpoint Method Format Purpose
/api/v1/auth/me GET - Get user info (including credits)
/api/v1/upload-video POST Form Data Get R2 presigned upload URL
/api/v1/faceswap/create-job POST Form Data Create face swap job
/api/v1/faceswap/jobs GET - Query job status

Authentication

All API requests require authentication via the Authorization header:

Authorization: ApiKey \x3Cyour_api_key>

⚠️ Important: There is a space between "ApiKey" and your key!

Example:

# ✅ Correct
Authorization: ApiKey vrg_sk_123456...

# ❌ Wrong (missing space)
Authorization: ApiKeyvrg_sk_123456...

You can get your API key from https://verging.ai (Login → Click avatar → API Keys).

Authentication Examples

# Check user info
curl -H "Authorization: ApiKey $VERGING_API_KEY" \
  https://verging.ai/api/v1/auth/me

# Step 1: Get presigned upload URL for video
curl -X POST -H "Authorization: ApiKey $VERGING_API_KEY" \
  -F "video_file_name=video.mp4" \
  -F "job_type=face-swap" \
  https://verging.ai/api/v1/upload-video

# The response contains:
# {
#   "result": {
#     "url": "https://...r2.cloudflarestorage.com/...mp4?X-Amz-...",
#     "public_url": "https://img.panpan8.com/face-swap/2026-03-11/xxx.mp4"
#   }
# }

# Step 2: Upload video file to the presigned URL
curl -X PUT -T /path/to/video.mp4 \
  "https://...presigned-url-from-step-1..."

# Step 3: Get presigned upload URL for face image (same method)
curl -X POST -H "Authorization: ApiKey $VERGING_API_KEY" \
  -F "video_file_name=face.jpg" \
  -F "job_type=face-swap" \
  https://verging.ai/api/v1/upload-video

# Step 4: Upload face image to presigned URL
curl -X PUT -T /path/to/face.jpg \
  "https://...presigned-url..."

# Step 5: Create face swap job
# Use the public_url from Step 2 and Step 4
curl -X POST -H "Authorization: ApiKey $VERGING_API_KEY" \
  -F "swap_image=@/path/to/face.jpg" \
  -F "file_name=face.jpg" \
  -F "target_video_url=https://img.panpan8.com/face-swap/2026-03-11/xxx.mp4" \
  -F "user_video_duration=10" \
  -F "is_hd=false" \
  https://verging.ai/api/v1/faceswap/create-job

# Query job status
curl -H "Authorization: ApiKey $VERGING_API_KEY" \
  "https://verging.ai/api/v1/faceswap/jobs?job_ids=123"

# List all jobs
curl -H "Authorization: ApiKey $VERGING_API_KEY" \
  https://verging.ai/api/v1/faceswap/jobs

Important:

  • Replace $VERGING_API_KEY with your actual API key or set it as an environment variable
  • The Authorization header uses format: ApiKey \x3Ckey> (not Bearer \x3Ckey>)

Dependencies

This skill requires:

  • Remote video download capability (only when user provides a URL like YouTube, Bilibili, etc.):
    • Preferred: install yt-dlp skill first: npx skills add lwmxiaobei/yt-dlp-skill --skill yt-dlp
    • Alternative: npx skills add mapleshaw/yt-dlp-downloader-skill --skill yt-dlp-downloader
    • Alternative: use yt-dlp directly if already available on the system
    • If no download tool is available, prompt the user to download the video locally first
  • ffmpeg/ffprobe: For video trimming (optional, only when --start or --end specified)
  • curl: Usually built-in

Processing Flow

When the user executes the /faceswap command, please follow these steps:

0. Check Dependencies

  • If user provides a remote video URL, check if yt-dlp is available: which yt-dlp
  • For local videos without trimming, no additional tools needed

1. Parse Arguments

  • Parse --video and --face parameters
  • If remote URL, need to download to local
  • Parse time range --start and --end

2. Download Remote Resources

  • If user provides a remote video URL (YouTube, Bilibili, etc.):
    • Try yt-dlp "URL" -o /tmp/verging-faceswap/video.mp4
    • If yt-dlp is not available, suggest installing the yt-dlp skill: npx skills add lwmxiaobei/yt-dlp-skill --skill yt-dlp
    • If installation is not possible, ask the user to download the video locally first
  • For images: use curl to download
  • Temp directory: /tmp/verging-faceswap/

3. Get Video Duration

  • Use ffprobe: ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "video.mp4"

4. Trim Video (if --start or --end specified)

  • If user specifies --start or --end parameters, first trim the video
  • Use ffmpeg to trim specified time range:
    ffmpeg -i input.mp4 -ss \x3Cstart> -to \x3Cend> -c copy output.mp4
    
  • Or re-encode for accurate frames:
    ffmpeg -i input.mp4 -ss \x3Cstart> -to \x3Cend> -c:v libx264 -c:a aac output.mp4
    
  • Use trimmed video as the file to upload

5. Check User Credits

  • Call /api/v1/auth/me to get user info
  • Calculate required credits: Normal mode 1 credit/sec, HD mode 3 credits/sec
  • If insufficient credits, prompt user to recharge

6. Upload Video to R2

  • Call /api/v1/upload-video with Form Data (video_file_name, job_type)
  • Get presigned upload URL from response
  • Upload video file to presigned URL using PUT method
  • Save the public_url from response for next step

7. Upload Face Image to R2

  • Same as step 6, but use the face image file
  • Save the public_url

8. Create Job

  • Call /api/v1/faceswap/create-job with Form Data:
    • swap_image: Face image file (will be re-uploaded to R2)
    • file_name: Original file name
    • target_video_url: The video public URL from step 6
    • user_video_duration: Video duration in seconds
    • is_hd: true/false

8. Poll Job Status

  • Every 5 seconds call /api/v1/faceswap/jobs?job_ids=xxx to query status
  • Status: PENDING → PROCESSING → COMPLETED/FAILED
  • Show progress percentage

9. Return Result

  • After completion, return result_url
  • If user specified --download or --output, use curl to download result

Credit Consumption

Mode Credits/sec
Normal 1 credit/sec
HD 3 credits/sec

Example Conversation

User: /faceswap -v ./input.mp4 -f ./my-face.jpg --start 5 --end 15

You:

  1. Parse arguments
  2. Check if video needs trimming (--start/--end specified)
  3. Get video duration
  4. Check credits sufficient (10 seconds = 10 credits)
  5. Upload video and face image to R2
  6. Create face swap job
  7. Poll for completion
  8. Return result URL

User: /faceswap -v ./input.mp4 -f ./my-face.jpg

You:

  1. Parse arguments - local video, no trimming needed
  2. Get video duration
  3. Call API to get user info
  4. Check credits sufficient
  5. Upload video and face image to R2
  6. Create face swap job
  7. Poll for completion
  8. Return result URL

Notes

  • This skill uses yt-dlp for remote video downloads (YouTube, Bilibili, etc.)
  • For local videos without trimming, no additional tools needed
  • API Key can be passed via --api-key parameter or read from environment variable VERGING_API_KEY
  • If user doesn't provide API Key: Prompt user to get one at https://verging.ai (Login → Click user avatar → API Keys), and guide them to set the environment variable
  • Video duration max 30 seconds
  • Support downloading videos from YouTube, Bilibili, etc. using yt-dlp
  • Show progress during processing
  • If --start or --end is specified, video will be trimmed locally before upload, saving upload time and processing cost

Privacy and Security

API Key

This skill requires a verging.ai API Key. Get it from:

  1. Visit https://verging.ai
  2. Login → Click user avatar (top right) → Select "API Keys"
  3. Create a new API key

Security recommendations:

  • Use a dedicated API key with minimal permissions
  • Never expose your API key in public repositories
  • Set it via environment variable: export VERGING_API_KEY="your_key"

Data Handling

  • Video uploads: Videos are uploaded to verging.ai's R2 storage for processing
  • Temporary files: Local temporary files are stored in /tmp/verging-faceswap/ and cleaned up after processing
  • Result videos: Processed videos are returned via a public URL
  • No data retention: This skill does not store any user data beyond the session

Legal Notice

  • Only process media you have rights to
  • Be aware of local laws regarding deepfake technology
  • Use responsibly and ethically
安全使用建议
This skill appears to do what it says: it downloads remote videos (when requested), optionally trims them, uploads video and face images to verging.ai via presigned URLs, and creates a face-swap job using your VERGING_API_KEY. Before installing or using it, consider: 1) Privacy: uploading videos and face images to a cloud service can expose sensitive content — the sample response shows a public_url on a different domain (img.panpan8.com), so check verging.ai’s privacy/retention rules and whether results are publicly accessible. 2) Billing: face-swap jobs consume credits (HD costs more) — confirm cost and quota on your account. 3) API key safety: treat VERGING_API_KEY like a secret, and revoke it if you suspect misuse. 4) Legal/ethical: ensure you have rights to reuse source videos and faces. 5) Dependencies: the skill relies on external binaries (yt-dlp, ffmpeg); installing community skills via npx will fetch code from npm — only run those install commands if you trust the source.
功能分析
Type: OpenClaw Skill Name: faceswap Version: 1.0.4 The faceswap skill is a legitimate integration for the verging.ai AI face-swap service. It provides instructions for an AI agent to handle media processing using standard tools like ffmpeg, ffprobe, and yt-dlp, and facilitates uploading files to the service's API and Cloudflare R2 storage. All requested permissions (network, filesystem, external_commands) and data transfers are strictly aligned with the stated purpose of performing video face swaps.
能力评估
Purpose & Capability
Name/description match what the skill requires: yt-dlp for remote downloads, ffmpeg/ffprobe for trimming, and curl plus VERGING_API_KEY to call verging.ai. Declared permissions (network, filesystem, external_commands) are expected for this functionality.
Instruction Scope
Instructions are narrowly focused on downloading (yt-dlp/curl), trimming (ffmpeg/ffprobe), uploading to presigned URLs, and polling verging.ai job endpoints. Two points to note: the example API response includes a public_url on img.panpan8.com (a domain different from verging.ai), which implies uploaded media may be hosted publicly or on a third-party CDN; and temp files are written to /tmp/verging-faceswap. There are no instructions to read unrelated system files or additional environment variables.
Install Mechanism
This is instruction-only (no install spec), which is low risk. The skill suggests installing other community skills (yt-dlp) via npx if needed; those are external actions the user would perform, not automatic installs by this skill.
Credentials
The only required credential is VERGING_API_KEY (primaryEnv) and an optional VERGING_API_URL override — these directly match the described API usage. No unrelated secrets or system credentials are requested.
Persistence & Privilege
always:false (no forced inclusion). The skill's required permissions (network, filesystem, external commands) are necessary for operation, but combined with an API key they allow the agent to perform remote uploads and start jobs. This is expected for a remote faceswap service; users should be aware the agent can initiate network activity using their API key when invoked.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install faceswap
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /faceswap 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.4
- Added metadata file (_meta.json). - Updated dependency list: now prefers yt-dlp and provides alternative installers for remote video downloads. - Clarified remote video handling: recommends yt-dlp or related skills and fallback instructions if unavailable. - Improved skill description and user guidance for downloading and handling remote resources. - No breaking changes to options or workflow.
v1.0.3
- Clarified API authentication details, including correct header format and example commands. - Improved documentation on file upload steps, showing use of presigned URLs for both video and face image. - Expanded API endpoint descriptions, now specifying input formats and improved sequence explanation. - Added more usage examples with detailed step-by-step curl commands. - No functional changes to the skill itself; documentation updates only.
v1.0.2
- Switched from on-demand installation to explicit dependency requirements, listing tools in metadata and README for clarity. - Added openclaw.json with structured metadata for dependencies (yt-dlp-downloader-skill, ffmpeg, ffprobe, curl) and required VERGING_API_KEY environment variable. - Removed legacy config files (clawhub.json, description.txt) in favor of openclaw.json metadata. - Improved privacy, security, and legal guidance in documentation. - Clarified user instructions regarding obtaining and setting API keys, and using dependency skills. - Minor adjustments to processing flow documentation and example usage.
v1.0.1
- Improved dependency handling: Dependencies (yt-dlp, ffmpeg) are now installed only when actually needed, rather than pre-checking and auto-installing at startup. - yt-dlp is installed only for remote video URLs; ffmpeg/ffprobe are installed only if video trimming (--start/--end) is required. - Startup flow is optimized for faster and more resource-efficient operation, with less unnecessary installation. - Added clear guidance for API key input if missing. - Updated example conversations and notes to reflect the on-demand installation approach.
v1.0.0
Initial release of faceswap – command-line AI face swap tool. - Supports face swapping on local and remote videos/images (YouTube, Bilibili, URLs). - Automatic download and management of dependencies (ffmpeg, ffprobe). - Handles video trimming based on user-provided start/end times before processing. - Real-time job progress tracking and credit usage calculation. - Flexible output options, auto-download support, and environment variable configuration. - Provides seamless integration with verging.ai’s API for job management and file handling.
元数据
Slug faceswap
版本 1.0.4
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 5
常见问题

Faceswap 是什么?

AI Face Swap - Swap face in video, deepfake face replacement, face swap for portraits. Use from command line. Supports local video files, YouTube, Bilibili U... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 380 次。

如何安装 Faceswap?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install faceswap」即可一键安装,无需额外配置。

Faceswap 是免费的吗?

是的,Faceswap 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Faceswap 支持哪些平台?

Faceswap 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Faceswap?

由 VergingAI(@revisual-ai)开发并维护,当前版本 v1.0.4。

💬 留言讨论