Head Swap
alibaba/head-swapHead 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
PNG, JPEG, WebP, or GIF · 20 MiB maximum
PNG, JPEG, WebP, or GIF · 20 MiB maximum
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
| Metric | Price |
|---|---|
| Per image | $0.013 |
When to Use
| ✅ Good fit | ❌ Consider alternatives |
|---|---|
| Full identity transfer across images | Face-only swap preserving original hairstyle (use Face Swap) |
| Casting previews and lookbooks | Style or background editing (use Qwen Image Edit Exp0622) |
| Character design and creative compositing | Video head swap |
| E-commerce model replacement | New image generation from scratch (use Z-Image Exp0622) |
Technical Specs
| Spec | Value |
|---|---|
| Input | Source image (head) + target image (URL or Base64, max 50 MB each) |
| Output | Head-swapped image (PNG/JPEG) |
| Swapped region | Full head (face, head shape, and hairstyle) |
| Execution | Async (submit → poll for result) |
Start building
Send your first request
OpenAI-compatible endpoint with unified authentication and usage tracking.
# 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
| Model | Context | Input / 1M | Output / 1M | Released |
|---|---|---|---|---|
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 |
