About Head Swap
Replace the whole head, hairstyle included.
Call it with the model name popnow/head-swap-v1/edit on POST /jobs/createTask, from $0.013.
Introduction
Head Swap replaces the entire head of the person in the target image with the head from a reference photo. Face, hairstyle, hair colour and skull silhouette all transfer; the target's body, wardrobe, pose, lighting and background stay as they were.
The request is two image URLs and an optional seed: image_url is the body being kept and reference_image_url supplies the head. There is no prompt, no mask and no strength control, and one image comes back per request.
Key features
Move a full character head into an existing plate
Head Swap changes more than facial identity: it is the right scope when the incoming character's hair, colour and head silhouette must travel with them. That makes it useful for character recasting, costume concepts and continuity treatments where the target hairstyle should not survive.
Treat the neck transition as the acceptance test
Choose source material with compatible camera angle, light direction and visible neck area. Review the hairline, ears, jaw, neck seam and shadow continuity at full size before accepting a result; these boundaries reveal whether the two assets truly belong together.
Use a controlled source pair
Start with a single clear subject in each image and avoid severe blur, occlusion or extreme profiles. When the target's own hair and silhouette are essential to the shot, choose Face Swap instead of forcing a full-head treatment.
Request parameters
| Parameter | Required | Description |
|---|---|---|
image_url | Yes | The picture to start from. |
reference_image_url | Yes | The picture whose face or look gets carried over. |
seed | No | Use the same seed and settings for more controlled comparisons. ≥ 0 · ≤ 2147483647 |
Pricing
Prices are in USD and charged to your PopNow balance. When a task is accepted, we reserve the maximum quoted amount from your PopNow balance. On completion, we charge for actual usage, never more than the hold, and release the remainder. If the task fails, the hold is released.
| Option | USD per image |
|---|---|
| Standard | $0.013 |
Send the same request body to POST /jobs/quote to see the estimated and maximum USD charge before running. A quote does not run the task or charge your balance.
Use cases
Replace the whole head, not just the face
Use this endpoint when the incoming person's hairstyle, hair colour and head silhouette have to arrive with them. Review the hairline, ears and neck seam at full size before accepting the result; if the target's own hair belongs to the shot, Face Swap is the narrower tool.
Costume and cosplay plates
Put a character's own head and hairstyle onto a body wearing the costume you generated. The maid uniform, the pose and the cafe set stay exactly as they were, so the outfit work you produced survives the pass.
Any scene, with a consented likeness
Move a head you are authorised to use onto frames you produced yourself, whatever they show. The endpoint treats the material no differently — the consent requirement in the limits below is what governs, and it is not a formality.
Prompt guide & pro tips
Confirm you hold the rights to both people
Both images depict a person, and you need authorisation for the head you are moving and for the frame you are moving it into. Keep the release alongside the job record before any integration work starts.
Match the angles, then send the pair
image_url is the body being kept; reference_image_url supplies the head. A general editor would need an instruction such as: "Head swap: replace the entire head of the person in the first image — face, hairstyle and hair colour — with the head from the second image, keeping the first image's body, maid outfit, pose, cafe background, lighting and colour grade unchanged. Match the neck seam, skin tone and lighting direction so the result reads as one photograph." — here there is no prompt field at all.
Check the result before iterating
The neck seam is the failure mode: a target whose neck is hidden by a high collar, a scarf or hair, or whose head is at a sharply different angle from the reference, produces a visible join. Match the lighting direction and skin tone between the two sources, and prefer similar head angles. Both images want one clearly visible, reasonably frontal, well-lit head of a decent size; group shots give the endpoint no way to know which person you meant. If the target's own hairstyle needs to stay, use Face Swap instead — no parameter here will keep it. There is no prompt, no mask and no strength control, so a wrong result is fixed with a different input pair.
API quick start
Call the Head Swap API in three steps
- Create an API key. Sign in to PopNow and create a key in the API console. Keys start with sk-popnow-. API calls are billed in USD from your PopNow balance.
- Send the request. POST /jobs/createTask with model popnow/head-swap-v1/edit and an input object that follows the parameter table. The response returns a task ID straight away.
- Get the result. Poll GET /jobs/recordInfo with the task ID, or pass a callBackUrl and we post the result to it. Download the output links when the task succeeds.
# 1. Create the task. Keep the Idempotency-Key if you retry after a network error.
export IDEMPOTENCY_KEY="$(uuidgen)"
curl -X POST https://api.popnow.ai/api/v1/jobs/createTask \
-H "Authorization: Bearer $POPNOW_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $IDEMPOTENCY_KEY" \
-d '{
"model": "popnow/head-swap-v1/edit",
"input": {
"image_url": "https://media.popnow.ai/influencer/examples/marco.webp",
"reference_image_url": "https://media.popnow.ai/influencer/examples/ava.webp"
}
}'
# 2. Copy data.taskId from the response, then poll until state is succeeded, failed, canceled or expired.
TASK_ID="TASK_ID_FROM_RESPONSE"
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=$TASK_ID" \
-H "Authorization: Bearer $POPNOW_API_KEY"Replace the prompt and any links with your own. The API tab has the response, polling and callback reference.
Head Swap API questions
How much does the Head Swap API cost?
Head Swap costs $0.013 per image. API usage is charged in USD to your PopNow balance. When a task is accepted, we reserve the maximum quoted amount from your PopNow balance. On completion, we charge for actual usage, never more than the hold, and release the remainder. If the task fails, the hold is released.
What is the model name for Head Swap in the API?
Put popnow/head-swap-v1/edit for Face Swap in the model field of POST /jobs/createTask.
What is the difference between Head Swap and Face Swap?
Head Swap replaces the whole head — face, hairstyle, hair colour and skull silhouette. Face Swap moves only the facial features and keeps the target's own hair. Choose by whether the hair should change.
Which image goes in image_url?
The one being changed — the body, wardrobe, pose and background you want to keep. reference_image_url supplies the head. Swapping them is a valid request with a completely different result and no error.
Is there a prompt or a mask?
No. The schema is image_url, reference_image_url and seed. Nothing is phrased, so the outcome depends only on the two images you chose.
Why is there a visible line at the neck?
That is the endpoint's main failure mode. It usually means the two sources have different lighting directions or skin tones, or that the target's neck is occluded by a collar, a scarf or hair.
Can it handle several people in one photo?
No. One head per image is the working assumption. Crop a group shot down to the subject before sending, or the result is unpredictable.
Can I try Head Swap without writing code?
Run Head Swap in the Playground without an API key, using the same PopNow balance as the website, shown in USD. Each run appears in your developer history with its matching code.