API Endpoints
Character Swap Operations
- Create Character Swap - Create animated video from character image and source video
- Get Video Info Result - Retrieve character swap video results by ID
Getting Started
Basic Workflow
-
Create Character Swap Video:
- Prepare your character image URL (PNG or JPEG)
- Prepare your source video URL (MP4) with the motion to apply
- Optionally provide duration, resolution, mode, and prompt
- Call the Create Character Swap API with your resources
-
Check Results:
- Use the Get Video Info Result API to check the status of your video
- Download the result URL when the status is “Success” (video_status = 3)
Response Code Description
Please note that if the value of the response code is not equal to 1000, the request
has failed or encountered an error.
Pricing
Character Swap
Note: Credits are calculated based on video duration in 5-second increments. For example, a 12-second video at 720p resolution would cost 30 credits (12 seconds ÷ 5 seconds × 10 credits).
Video Status Codes
When checking results, thevideo_status field indicates the current state:
Best Practices
Image Requirements
- Quality: Use high-resolution images for better results
- Face Visibility: Ensure the character face is clearly visible and not obscured
- Lighting: Well-lit images produce better character swap results
- Angle: Frontal or slight angle faces work best
Video Requirements
- Format: MP4 format is required
- Quality: Use clear, high-quality source videos
- Duration: Maximum video duration is 120 seconds
- Motion: The source video should contain the motion you want to apply to the character
API Usage Tips
- Webhook: Use the
webhookUrlparameter to receive notifications when processing is complete - Prompt: Use the
promptparameter for generation guidance (max 500 characters) - Resolution: Choose appropriate resolution (480p or 720p) based on your needs - higher resolution may take longer to process
- Mode: Choose between “animate” (character animation) or “replace” (face replacement) based on your use case
- Result Cleanup: Save generated videos promptly as they expire after 7 days
Common Use Cases
Basic Character Animation
Create a character animation video by applying motion from a source video:Character Animation with Prompt
Use theprompt parameter for enhanced control over the animation:
Face Replacement Mode
Replace faces in a video with a character face:Notes
- Pro Plan Required: Character Swap feature requires Pro plan or higher subscription
- Video Duration: If not specified, the duration will be automatically detected from the source video. Maximum duration is 120 seconds
- Mode Options:
animate: Applies character animation to the image using the video’s motionreplace: Replaces faces in the video with the character from the image
- Webhook Callbacks: If a webhook URL is provided, you will receive a POST request when the task status changes to completed (3) or failed (4)