Face Swap

alibaba/face-swap

Face Swap replaces the face in a target image with the face from a source image, producing a realistic face-swapped result.

Base price
$0.01USD / run
Execution
async
Model type
image
Input fields
3

Try the model

Playground

Open playground
Input

PNG, JPEG, WebP, or GIF · 20 MiB maximum

The target image whose face will be replaced (URL or Base64-encoded string). Maximum file size is 50 MB.

PNG, JPEG, WebP, or GIF · 20 MiB maximum

The image containing the face to use as the source (URL or Base64-encoded string). Maximum file size is 50 MB.
Random seed. Omit for an auto-generated seed.
OutputReady

Your output will appear here

Complete the inputs, then click Run.

Specifications

Pricing

Base price
$0.01 / run
Billing formula
0.013

Context & modalities

Input
Schema-defined
Output
image

Capabilities

Chat
Not supported
Vision
Not supported
Reasoning
Not supported
Structured output
Not supported
Function calling
Not supported
Audio input
Not supported

Access

Provider
Alibaba
Model ID
alibaba/face-swap
Execution
async
API
Unified Run API
Endpoint
/v1/run

API README

Face Swap

Face Swap replaces the face in a target image with the face from a source image. Precisely swaps facial features only — head shape and hairstyle are preserved. Priced at $0.013 per image.

Highlights

Face-only swap — Replaces the face while keeping the original head shape, hair, and body intact for a natural result.

Dual-image input — Provide a source face and a target image; the model handles seamless blending automatically.

High realism — Produces photorealistic results with consistent skin tone, lighting, and edge transitions.

Low cost — At $0.013 per image, suitable for high-volume portrait and creative workflows.

Pricing

MetricPrice
Per image$0.013

When to Use

✅ Good fit❌ Consider alternatives
Portrait retouching and casting previewsFull head replacement (use Head Swap)
Entertainment and creative contentStyle or background editing (use Qwen Image Edit Exp0622)
Product catalog face replacementVideo face swap
Gaming and avatar creationNew image generation from scratch (use Z-Image Exp0622)

Technical Specs

SpecValue
InputSource image (face) + target image (URL or Base64, max 50 MB each)
OutputFace-swapped image (PNG/JPEG)
Swapped regionFace only (head shape and hairstyle preserved)
ExecutionAsync (submit → poll for result)

Start building

Send your first request

OpenAI-compatible endpoint with unified authentication and usage tracking.

Production API
Unified Run API endpoint
https://api.sandbase.ai/v1/run
Model ID
alibaba/face-swap
# The quoted heredoc keeps Unicode and shell metacharacters unchanged.
result=$(curl --fail-with-body --silent \
  -X POST "https://api.sandbase.ai/v1/run" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @- <<'SANDBASE_JSON'
{
  "model": "alibaba/face-swap"
}
SANDBASE_JSON
)
run_id=$(printf '%s' "$result" | jq -r .id)
for attempt in $(seq 1 120); do
  status=$(printf '%s' "$result" | jq -r .status)
  case "$status" in completed|failed|timeout) break ;; esac
  sleep 2
  result=$(curl --fail-with-body --silent \
    -H "Authorization: Bearer $SANDBASE_API_KEY" \
    "https://api.sandbase.ai/v1/run/$run_id")
done
status=$(printf '%s' "$result" | jq -r .status)
[ "$status" = completed ] || { echo "Generation ended: $status" >&2; exit 1; }
printf '%s\n' "$result"

Choose your model

Compare models

All language models
ModelContextInput / 1MOutput / 1MReleased
Face SwapThis model
Alibaba
———Jun 22, 2026
Alibaba———Jul 21, 2026
Alibaba———Jul 21, 2026
Alibaba———Jul 21, 2026
Alibaba———Jun 22, 2026
Alibaba———Apr 1, 2026