POST
javascript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 const axios = require('axios'); const fs = require('fs'); const path = require('path'); async function toB64(imgPath) { const data = fs.readFileSync(path.resolve(imgPath)); return Buffer.from(data).toString('base64'); } const api_key = "YOUR API-KEY"; const url = "https://api.segmind.com/v1/video-faceswap-by-facefusion-labs"; const data = { "source_image": "toB64('https://segmind-resources.s3.amazonaws.com/input/8d67068b-dc76-4069-b231-acdbb644ab54-ai-video-swap-ip2.png')", "target_video": "https://segmind-resources.s3.amazonaws.com/input/1f234efe-9867-475f-8ef2-81eef026fb50-7eb8f231-ace8-4dbe-bb6a-43ae13d1a89e.mp4", "model_name": "hyperswap_1a", "face_detector_score": 0.5, "target_face_index": 0 }; (async function() { try { const response = await axios.post(url, data, { headers: { 'x-api-key': api_key } }); console.log(response.data); } catch (error) { console.error('Error:', error.response.data); } })();
RESPONSE
image/jpeg
HTTP Response Codes
200 - OKImage Generated
401 - UnauthorizedUser authentication failed
404 - Not FoundThe requested URL does not exist
405 - Method Not AllowedThe requested HTTP method is not allowed
406 - Not AcceptableNot enough credits
500 - Server ErrorServer had some issue with processing

Attributes


source_imageimage *

Image URL to swap onto video face. Use high-quality images.


target_videostr *

Target video URL for face swapping. HD videos yield best results.


model_nameenum:str ( default: hyperswap_1a )

Model variant for face swap. hyperswap_1a for general use.

Allowed values:


face_detector_scorefloat ( default: 0.5 )

Minimum confidence for face detection. Recommended: 0.4.

min : 0,

max : 1


target_face_indexint ( default: 1 )

Face index to swap in target video. 0 for first face.

min : 0,

max : 10

To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.

Hyperswap: Face-Swap (Image-to-Video) Model

What is Hyperswap?

Hyperswap by FaceFusion Labs is a generative AI face swapping model built for fast, accurate, natural-looking identity transfer. You provide a source image (the identity) and a target video (the performance), and Hyperswap replaces the face in the video while preserving key on-set signals like lighting, head pose, angle, skin tone continuity, and facial expressions.

It’s designed for developer workflows: simple API integration, configurable model variants, and practical controls for detection robustness and edge blending. If you’re searching for “AI face swap API,” “image to video face swap,” or “high quality face replacement,” Hyperswap is optimized for those production-oriented needs—especially when inputs are clean and high resolution.

Key Features

  • Image-to-video face swapping: swap a single identity image onto faces across video frames.
  • Natural identity transfer: maintains expressions and scene lighting for realistic composites.
  • Three quality/speed variants:
    • hyperswap_1a: fastest, great default for general use
    • hyperswap_1b: balanced quality and robustness
    • hyperswap_1c: highest quality for premium output
  • Tunable blending with face_mask_blur for cleaner edges and fewer cutout artifacts.
  • Configurable face detection strictness via face_detector_score for challenging angles.

Best Use Cases

  • Entertainment & content creation: short-form videos, VFX previsualization, dubbing-style edits.
  • Marketing & creative automation: rapid personalization of creatives (with proper consent).
  • Virtual production: identity transfer for prototyping scenes and reshoots.
  • Post-production pipelines: batch processing, tooling, and internal review workflows.

Prompt Tips and Output Quality

Hyperswap is parameter-driven (not prompt-based). For best results:

  • Use a high-resolution, well-lit source face with minimal occlusion (no heavy sunglasses, hands, or extreme blur).
  • Choose HD target videos; stable lighting and sharper frames improve temporal consistency.
  • Start with model_name=hyperswap_1a, then move to 1b/1c when quality matters.
  • Tune edge realism:
    • Increase face_mask_blur (default 0.3) for smoother blends in realistic footage.
    • Lower blur if details look “mushy” around jawline or hairline.
  • Tune detection reliability:
    • Use face_detector_score=0.4 (recommended) for varied angles.
    • Increase it if the model swaps the wrong face; decrease slightly if faces aren’t detected.

FAQs

Is Hyperswap open-source?
Hyperswap is provided as an API model; licensing and source availability depend on FaceFusion Labs’ release terms.

What’s the difference between hyperswap_1a, 1b, and 1c?
1a prioritizes speed, 1b balances speed and quality, and 1c targets maximum realism.

How do I get the most realistic face swap output?
Use a sharp source image, an HD target video, hyperswap_1c, and adjust face_mask_blur for clean edges.

What parameters should I tweak first?
Start with model_name, then refine face_mask_blur. Use face_detector_score when detection is unreliable.

Why is the face swap failing or inconsistent?
Common causes: low-resolution inputs, heavy occlusions, extreme side profiles, motion blur, or too-high face_detector_score preventing detections.