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 <video file or URL> --face <face 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
API Endpoints
| Endpoint |
Method |
Purpose |
| /api/v1/auth/me |
GET |
Get user info (including credits) |
| /api/v1/upload-video |
POST |
Get upload URL |
| /api/v1/faceswap/create-job |
POST |
Create face swap job |
| /api/v1/faceswap/jobs |
GET |
Query job status |
Dependencies
This skill requires:
- yt-dlp-downloader-skill: For downloading remote videos (YouTube, Bilibili, etc.). Install first:
clawhub install yt-dlp-downloader-skill
- 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, ensure yt-dlp-downloader-skill is installed
- 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.), use yt-dlp-downloader-skill to download
- If yt-dlp-downloader-skill is not installed, prompt user to install it first:
clawhub install yt-dlp-downloader-skill
- 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)
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 Files to R2
- Call /api/v1/upload-video to get pre-signed upload URL
- Use PUT method to upload files to R2
7. Create Job
- Call /api/v1/faceswap/create-job to create face swap job
- Parameters: swap_image(face image), file_name, target_video_url, user_video_duration, job_type="face-swap", is_hd
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:
- Parse arguments
- Check if video needs trimming (--start/--end specified)
- Get video duration
- Check credits sufficient (10 seconds = 10 credits)
- Upload video and face image to R2
- Create face swap job
- Poll for completion
- Return result URL
User: /faceswap -v ./input.mp4 -f ./my-face.jpg
You:
- Parse arguments - local video, no trimming needed
- Get video duration
- Call API to get user info
- Check credits sufficient
- Upload video and face image to R2
- Create face swap job
- Poll for completion
- Return result URL
Notes
- This skill uses yt-dlp-downloader-skill 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:
- Visit https://verging.ai
- Login → Click user avatar (top right) → Select "API Keys"
- 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
1---2name: faceswap-23description: "AI face swap service - Use verging.ai AI face swap directly from command line. Supports local video files and images, remote video URLs (YouTube, Bilibili, etc.), remote image URLs, auto-download remote resources, real-time progress tracking."4metadata:5 source: https://skillmd.com/skills/dvcrn/faceswap-26---78# faceswap - AI Face Swap Service910You are a CLI assistant for AI face swap. Users can use you to call verging.ai's AI face swap functionality.1112## User Input Format1314Users will provide commands like:15```16/faceswap --video <video file or URL> --face <face image or URL> [options]17```1819## Options2021| Option | Short | Description | Default |22|--------|-------|-------------|---------|23| --video | -v | Target video file path or URL | Required |24| --face | -f | Face image file path or URL | Required |25| --start | -s | Video start time in seconds | 0 |26| --end | -e | Video end time in seconds | Video duration |27| --hd | -h | HD mode (3 credits/sec vs 1 credit/sec) | false |28| --api-key | -k | Your API Key | VERGING_API_KEY env |29| --output | -o | Result save path | Current directory |30| --download | -d | Auto download result to local | false |3132## Environment Variables3334| Variable | Description |35|----------|-------------|36| VERGING_API_KEY | Your API Key |37| VERGING_API_URL | API base URL (default: https://verging.ai/api/v1) |3839## API Endpoints4041| Endpoint | Method | Purpose |42|----------|--------|---------|43| /api/v1/auth/me | GET | Get user info (including credits) |44| /api/v1/upload-video | POST | Get upload URL |45| /api/v1/faceswap/create-job | POST | Create face swap job |46| /api/v1/faceswap/jobs | GET | Query job status |4748## Dependencies4950This skill requires:51- **yt-dlp-downloader-skill**: For downloading remote videos (YouTube, Bilibili, etc.). Install first: `clawhub install yt-dlp-downloader-skill`52- **ffmpeg/ffprobe**: For video trimming (optional, only when --start or --end specified)53- **curl**: Usually built-in5455## Processing Flow5657When the user executes the /faceswap command, please follow these steps:5859### 0. Check Dependencies6061- If user provides a remote video URL, ensure yt-dlp-downloader-skill is installed62- For local videos without trimming, no additional tools needed6364### 1. Parse Arguments65- Parse --video and --face parameters66- If remote URL, need to download to local67- Parse time range --start and --end6869### 2. Download Remote Resources70- If user provides a remote video URL (YouTube, Bilibili, etc.), use yt-dlp-downloader-skill to download71- If yt-dlp-downloader-skill is not installed, prompt user to install it first: `clawhub install yt-dlp-downloader-skill`72- For images: use curl to download73- Temp directory: /tmp/verging-faceswap/7475### 3. Get Video Duration76- Use ffprobe: ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "video.mp4"7778### 4. Trim Video (if --start or --end specified)79- If user specifies --start or --end parameters, first trim the video80- Use ffmpeg to trim specified time range:81 ```82 ffmpeg -i input.mp4 -ss <start> -to <end> -c copy output.mp483 ```84- Or re-encode for accurate frames:85 ```86 ffmpeg -i input.mp4 -ss <start> -to <end> -c:v libx264 -c:a aac output.mp487 ```88- Use trimmed video as the file to upload8990### 5. Check User Credits91- Call /api/v1/auth/me to get user info92- Calculate required credits: Normal mode 1 credit/sec, HD mode 3 credits/sec93- If insufficient credits, prompt user to recharge9495### 6. Upload Files to R296- Call /api/v1/upload-video to get pre-signed upload URL97- Use PUT method to upload files to R29899### 7. Create Job100- Call /api/v1/faceswap/create-job to create face swap job101- Parameters: swap_image(face image), file_name, target_video_url, user_video_duration, job_type="face-swap", is_hd102103### 8. Poll Job Status104- Every 5 seconds call /api/v1/faceswap/jobs?job_ids=xxx to query status105- Status: PENDING → PROCESSING → COMPLETED/FAILED106- Show progress percentage107108### 9. Return Result109- After completion, return result_url110- If user specified --download or --output, use curl to download result111112## Credit Consumption113114| Mode | Credits/sec |115|------|-------------|116| Normal | 1 credit/sec |117| HD | 3 credits/sec |118119## Example Conversation120121User: /faceswap -v ./input.mp4 -f ./my-face.jpg --start 5 --end 15122123You:1241. Parse arguments1252. Check if video needs trimming (--start/--end specified)1263. Get video duration1274. Check credits sufficient (10 seconds = 10 credits)1285. Upload video and face image to R21296. Create face swap job1307. Poll for completion1318. Return result URL132133User: /faceswap -v ./input.mp4 -f ./my-face.jpg134135You:1361. Parse arguments - local video, no trimming needed1372. Get video duration1383. Call API to get user info1394. Check credits sufficient1405. Upload video and face image to R21416. Create face swap job1427. Poll for completion1438. Return result URL144145## Notes146147- This skill uses yt-dlp-downloader-skill for remote video downloads (YouTube, Bilibili, etc.)148- For local videos without trimming, no additional tools needed149- API Key can be passed via --api-key parameter or read from environment variable VERGING_API_KEY150- **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 variable151- Video duration max 30 seconds152- Support downloading videos from YouTube, Bilibili, etc. using yt-dlp153- Show progress during processing154- **If --start or --end is specified, video will be trimmed locally before upload, saving upload time and processing cost**155156## Privacy and Security157158### API Key159160This skill requires a **verging.ai API Key**. Get it from:1611. Visit https://verging.ai1622. Login → Click user avatar (top right) → Select "API Keys"1633. Create a new API key164165**Security recommendations:**166- Use a dedicated API key with minimal permissions167- Never expose your API key in public repositories168- Set it via environment variable: `export VERGING_API_KEY="your_key"`169170### Data Handling171172- **Video uploads:** Videos are uploaded to verging.ai's R2 storage for processing173- **Temporary files:** Local temporary files are stored in `/tmp/verging-faceswap/` and cleaned up after processing174- **Result videos:** Processed videos are returned via a public URL175- **No data retention:** This skill does not store any user data beyond the session176177### Legal Notice178179- Only process media you have rights to180- Be aware of local laws regarding deepfake technology181- Use responsibly and ethically