namifusion

How to Use the 换脸 API: face swap integration guide (2026)

2 min · Updated 2026-07-11 · By the NamiFusion team

Learn how to call the 换脸 API on NamiFusion: parameters, pricing (from ≈$0.200) and runnable copy-paste code — try it in the playground first.

换脸 is a face swap model by NamiFusion: NamiFusion Faceswap v5 is a high-speed, cost-effective model designed for large-scale, real-time workflows, delivering lifelike results with automatic skin tone matching and professional quality. On NamiFusion you can try it in the playground (exact quote shown before you submit), then call it through one unified REST API — a typical run costs about $0.200.

TL;DR

· Task type: face swap, provided by NamiFusion

· Pricing: about $0.200 per typical run ($1 = 100 credits), pay-as-you-go

· Getting started: playground (exact quote before submit) → create an API key → one POST request

· Tunable parameters: 6 (see the table below)

· No platform watermark; commercial use allowed (per the Terms of Service)

What can you build with 换脸?

Film and short-drama post-production: replace faces for reshoots or multi-language localization.

Memes and entertainment: put yourself or friends into iconic scenes — built for social sharing.

Virtual personas and privacy: use a substitute face for streams and on-camera content.

Batch production: map multiple source faces onto the same footage to mass-produce personalized versions.

How do you call this API?

1. Sign up on NamiFusion and create a key on the API Keys page (free credits on signup).

2. Submit a task with the cURL example below, passing your key as a Bearer token.

3. Poll the task status with the returned task_uuid and read the output URLs when completed.

Submit a task
# 1) Submit — returns { "task_uuid": "..." }
curl -X POST "https://www.namifusion.com/api/v1/marketplace/run/namifusion/faceswap-v5" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "input": {
    "source_image": "https://segmind-resources.s3.amazonaws.com/input/d823dde1-aaae-4231-87b7-1d472bc71cef-faceswap-v5-input.png",
    "target_image": "https://segmind-inference-inputs.s3.amazonaws.com/48892b17-762c-4de5-b6d8-f99d8e139115-black-man-image.jpeg",
    "image_format": "jpeg",
    "quality": 95,
    "seed": 8005332
  }
}'

# 2) Poll until status is "completed", then read the output URLs
curl "https://www.namifusion.com/api/v1/marketplace/run/tasks/TASK_UUID" \
  -H "Authorization: Bearer YOUR_API_KEY"

What parameters does it take?

source_image (Source Image (Face)): optional

target_image (Target Image (Body/Scene)): optional

additional_prompt (Additional Prompt): optional

image_format (Output Format): optional, default "jpeg"

quality (Image Quality): optional, default 95

seed (Seed): optional, default 8005332

How do you write prompts for 换脸?

1. Subject first: lead with the actor and action, then add environment, lighting and style ("an astronaut sprinting through a neon street in the rain, cinematic, shallow depth of field").

2. Concrete nouns beat stacked adjectives: "85mm portrait lens, golden-hour backlight" works far better than "very beautiful, ultra high quality".

3. Change one variable per iteration: pin the seed to reproduce a result, tweak a single phrase at a time so you know what actually moved the output.

4. State negatives positively: instead of "no blur", ask for "sharp focus, crisp details".

How much does it cost?

Pay-per-use in credits. A typical run costs about $0.200 ($1 = 100 credits); the exact price varies with parameters like resolution or duration, and the playground shows the exact quote before you submit.

换脸

AI Image FaceSwap v5: Ultra-fast face and smart head swapping with built-in skin tone matching for high-volume, production-ready workflows.

NamiFusion Faceswap v5 is an image face swap API designed for speed and scale. It delivers v2-level inference speed with significantly improved output quality, featuring automatic smart head swapping, built-in skin tone matching, and creative prompt support — all at the lowest cost in the NamiFusion faceswap lineup.


Key Features

  • Ultra-Fast Inference: Matches Faceswap v2's speed while delivering substantially better visual quality.
  • Smart Head Swap: Automatically determines whether face-only or full-head blending produces the most natural result — no manual mode selection required.
  • Built-In Skin Tone Matching: Adapts skin tones automatically for natural, seamless results without manual correction.
  • Creative Prompt Support: Use additional_prompt to guide subtle attribute changes like "wearing a hat" or "smiling".
  • Reproducible Outputs: Seed-based generation ensures consistent results across runs, ideal for A/B testing and batch workflows.
  • Cost-Optimized: The most affordable faceswap option in the NamiFusion lineup without sacrificing professional-level quality.

Technical Specifications

ParameterDetails
Core input fieldssource_image, target_image, seed
Optional fieldsadditional_prompt, image_format, quality
Image format optionspng, jpeg, webp
Quality range10 – 100 (default: 95)
Seed default8005332
Average inference time~9.63s

Quick Start

API Endpoint

EndpointMethodDescription
/api/v1/marketplace/run/namifusion/faceswap-v5POSTSubmit a Faceswap v5 task (synchronous)

Faceswap v5 uses a synchronous response model — the result is returned directly in the response body, no polling required.

Request Parameter Overview

The core Faceswap v5 fields in the request body are as follows:

{
  "source_image": "string (URL)",
  "target_image": "string (URL)",
  "additional_prompt": "string",
  "image_format": "png | jpeg | webp",
  "quality": 95,
  "seed": 8005332
}

Authentication

Include your API Key in the request header:

X-API-Key: sk-your-api-key

Standard Call Flow

Faceswap v5 uses a synchronous workflow — the result image is returned directly:

  1. Call POST /api/v1/marketplace/run/namifusion/faceswap-v5 with your input parameters.
  2. The response contains the result image directly.
  3. No polling step is needed.

Submit the Task and Get the Result

curl -X POST "https://www.namifusion.com/api/v1/marketplace/run/namifusion/faceswap-v5" \
  -H "X-API-Key: sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "input": {
      "source_image": "https://example.com/source.jpg",
      "target_image": "https://example.com/target.jpg",
      "image_format": "png",
      "quality": 95,
      "seed": 8005332
    }
  }'

Example successful response:

{
  "status": "completed",
  "output": {
    "image_url": "https://cdn.namifusion.com/result/faceswap_v5_abc123.png"
  }
}

Example failed response:

{
  "status": "failed",
  "output": null,
  "error_message": "Face swap failed because no valid face was detected in source_image."
}

FAQ

Can I try it for free first?+

Signup gives you free credits, but they currently apply only to selected in-app face-swap features — this model is pay-as-you-go. The playground still lets you try it without code, with the exact quote shown before you submit.

Can I use the output commercially? Is there a watermark?+

Yes, outputs are yours to use commercially, and NamiFusion adds no platform watermark — subject to the Terms of Service and applicable law.

What is the content policy?+

NamiFusion is an unfiltered engine: no arbitrary restrictions and NSFW-friendly, but illegal content and non-consensual use of real people are prohibited — see the Terms of Service.

How long does a 换脸 task take?+

It depends on parameters — images usually take seconds, videos tens of seconds to minutes. The API returns a task_uuid for polling.

What are the resolution and duration limits?+

See the parameter table above — each model lists its available resolution and duration options there and in the playground.