Skip to main content

Overview

Character Replace substitutes a person in a video with the character from a reference image. Automatic selection can identify the subject, or you can provide a point on a frame to target a specific person. Use style.mode="replace" to recast the subject in the source scene, or "animate" to transfer the source performance onto the reference image’s character and composition. For a face-only change that retains the source body and clothing, use Face Swap Video. Read the endpoint parameters for model-dependent prompt direction and subject-selection constraints; neither replaces the required video and character image. Review the intended subject, likeness, action timing and scene continuity in the completed video.

How It Works

  1. Upload a video - Provide the scene containing the person to replace
  2. Upload a character image - Provide the replacement character reference
  3. Select the subject - Use automatic selection or provide a point and timestamp
  4. Choose the segment - Set start time, end time, and output resolution
  5. Create and download - Submit the job, poll until complete, then retrieve the output

Use Cases

  • Character-driven content - Place a recurring character into new footage
  • Creative remixes - Recast short clips using a reference image
  • Previsualization - Test casting or character concepts before production
  • Marketing variants - Adapt one scene with different characters
  • Social content - Produce short character transformations for posts

Best Practices

Choose a clear selection frame - If several people appear, target a frame where the intended subject is visible and unobstructed.
  • Use a clear reference image - Show the replacement character at useful resolution with good lighting
  • Match framing when possible - Similar angles and body visibility help the replacement fit the scene
  • Avoid heavy occlusion - Subjects hidden behind objects are harder to track consistently
  • Start with automatic selection - Add a point only when the API needs help identifying the subject
  • Test short segments - Validate subject tracking before processing a longer clip

Modes and resolution

Use style.mode="replace" to substitute the selected subject, or "animate" to transfer the source video’s motion to the reference character. Set model to select a model explicitly. The default model is wan-animate. Kling 4.0 requires a paid subscription. Duration limits for your plan still apply. Resolution must be supported by the model and your plan. If omitted, it defaults to the lowest resolution available on your plan for that model. end_seconds is required; start_seconds defaults to zero. The selected duration is end_seconds - start_seconds.

Subject selection and prompts

Subject selection defaults to auto. For manual selection, set style.selection_mode="point" and provide style.points. Coordinates are pixels in the source frame, and timestamps use the source video’s timeline.
  • Wan Animate: supports point selection in both modes.
  • Kling 3.0 and 4.0: automatically select the main person. Omit style.points; supplying points is rejected.
  • MiniMax H3: In replace mode, manual selection accepts 1 to 10 points. Each time_seconds must be at or after start_seconds and before end_seconds. In animate mode, selection_mode="point" returns 422.
For models that support manual selection, points are ignored when selection is auto or omitted. Kling 3.0, Kling 4.0, and MiniMax H3 support optional style.prompt instructions. In MiniMax H3 replace mode, the API applies the prompt only for automatic selection. Omit it for manual selection.

Code Example

Input files must be direct URLs or file_path values returned by the file upload API.
cURL

Pricing

Credits are charged for frames that render. The create response provides an estimate, and the completed job reports the final total in credits_charged. See model-specific credit rates for pricing by model and resolution.

API Reference

Character Replace API Reference

View all request fields, selection modes, limits, and response formats

AI Video Editor

Edit video content with natural-language prompts

Face Swap Video

Replace faces while preserving the original scene