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/faceswap-v5";
const data = {
"target_image": "toB64('https://segmind-resources.s3.amazonaws.com/input/d823dde1-aaae-4231-87b7-1d472bc71cef-faceswap-v5-input.png')",
"source_image": "toB64('https://segmind-inference-inputs.s3.amazonaws.com/48892b17-762c-4de5-b6d8-f99d8e139115-black-man-image.jpeg')",
"seed": 8005332,
"image_format": "png",
"quality": 95
};
(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);
}
})();Target image URL
Source image URL
Additional prompt for customization
Random seed for reproducibility
Output image format
Allowed values:
Output image quality
min : 10,
max : 100
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.
Edited by Segmind Team on January 20, 2026.
Segmind Faceswap v5 is the recent addition to the Segmind lineup of models, as the most cost-effective and fastest faceswap option. It matches the super-fast speed of Faceswap v2 while delivering exceptional visuals. It is tailored for tasks that require high-volume and real-time workflows, as it smoothly supports smart head swapping with built-in skin tone matching, to produce lifelike, fluid outcomes that require no extra adjustments.
Segmind Faceswap v5 is specifically fine-tuned for large-scale projects, making it perfect for developers, startups, and production environments prioritizing velocity, reliability, and low costs, all without sacrificing professional-level quality.
The target_image is where the face is replaced, while the source_image provides the identity. For best results:
Set quality to
95 for production and final assets
80-85 for ultra-fast testing and iteration
The seed parameter ensures reproducibility, an essential aspect for A/B testing, caching, and consistent batch outputs.
JPEG is recommended for speed and size efficiency, while PNG can be used when maximum detail is required.
How is Faceswap v5 different from Faceswap v4?
Faceswap v5 is significantly faster, cheaper, and smarter. It matches Faceswap v2's speed; it has built-in skin tone matching that ensures better skin-tone blending, and more reliable head swaps, without extra configuration.
Does v5 support both face and head swapping?
Yes, Faceswap v5 uses an intelligent head-swap system that automatically blends the face or full head; the transformation is based on the most natural result.
Is Faceswap v5 suitable for large-scale production?
Yes, Faceswap v5 is perfect for large-scale projects as it is designed for high-throughput pipelines, real-time use cases, and cost-sensitive deployments.
Can I control consistency across multiple runs?
To achieve consistent results across multiple generations, use the same seed, source image, and target image, as this will always produce identical results.
What makes Faceswap v5 the cheapest faceswap option?
Faceswap v5 utilizes a highly optimized architecture that reduces inference cost while ensuring premium quality, making it ideal for startups and scale-heavy applications.