Loading...
Loading...
AI Face Swap - Swap face in video, deepfake face replacement, face swap for portraits. Use from command line. Supports local video files, YouTube, Bilibili URLs, auto-download, real-time progress tracking.
npx skill4agent add verging-ai/agent-skills faceswap/faceswap --video <video file or URL> --face <face image or URL> [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 |
| Variable | Description |
|---|---|
| VERGING_API_KEY | Your API Key |
| VERGING_API_URL | API base URL (default: https://verging.ai/api/v1) |
| 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 |
AuthorizationAuthorization: ApiKey <your_api_key># ✅ Correct
Authorization: ApiKey vrg_sk_123456...
# ❌ Wrong (missing space)
Authorization: ApiKeyvrg_sk_123456...# 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$VERGING_API_KEYAuthorizationApiKey <key>Bearer <key>npx skills add lwmxiaobei/yt-dlp-skill --skill yt-dlpnpx skills add mapleshaw/yt-dlp-downloader-skill --skill yt-dlp-downloaderyt-dlpyt-dlpwhich yt-dlpyt-dlp "URL" -o /tmp/verging-faceswap/video.mp4npx skills add lwmxiaobei/yt-dlp-skill --skill yt-dlpffmpeg -i input.mp4 -ss <start> -to <end> -c copy output.mp4ffmpeg -i input.mp4 -ss <start> -to <end> -c:v libx264 -c:a aac output.mp4/api/v1/upload-videovideo_file_namejob_typepublic_urlpublic_url/api/v1/faceswap/create-jobswap_imagefile_nametarget_video_urluser_video_durationis_hd| Mode | Credits/sec |
|---|---|
| Normal | 1 credit/sec |
| HD | 3 credits/sec |
export VERGING_API_KEY="your_key"/tmp/verging-faceswap/