Head Swap

alibaba/head-swap

Head Swap replaces the head in a target image with the head from a source image, producing a realistic head-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 head 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 head 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/head-swap
Execution
async
API
Unified Run API
Endpoint
/v1/run

API README

Head Swap

Head Swap replaces the entire head in a target image with the head from a source image — including face, head shape, and hairstyle. Priced at $0.013 per image.

Highlights

Full head replacement — Replaces the face, head shape, and hairstyle together for a complete identity transfer.

Dual-image input — Provide a source head and a target image; automatic seamless blending is applied.

Realistic compositing — Maintains consistent lighting, skin tone, and perspective with the target body.

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

Pricing

MetricPrice
Per image$0.013

When to Use

✅ Good fit❌ Consider alternatives
Full identity transfer across imagesFace-only swap preserving original hairstyle (use Face Swap)
Casting previews and lookbooksStyle or background editing (use Qwen Image Edit Exp0622)
Character design and creative compositingVideo head swap
E-commerce model replacementNew image generation from scratch (use Z-Image Exp0622)

Technical Specs

SpecValue
InputSource image (head) + target image (URL or Base64, max 50 MB each)
OutputHead-swapped image (PNG/JPEG)
Swapped regionFull head (face, head shape, and hairstyle)
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/head-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/head-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
Head 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