Head Swap – Analyze
namifusion/head-swap/analyze
namifusion/head-swap/analyze. Explora API de modelos de imagen, vídeo y cambio de rostro. Prueba cualquier modelo e intégralo mediante una API REST unificada.
Modelos relacionados
Referencia completa de parámetros, esquema de salida y precios actuales
| Mercado de API de modelos de IA | Una plataforma para todo | Más popular | Condiciones | Explora API de modelos de imagen, vídeo y cambio de rostro. Prueba cualquier modelo e intégralo mediante una API REST unificada. |
|---|---|---|---|---|
| resolutionResolution | select | 720p | 480p | 720p |
Referencia completa de parámetros, esquema de salida y precios actuales
| Más información | Una plataforma para todo | Explora API de modelos de imagen, vídeo y cambio de rostro. Prueba cualquier modelo e intégralo mediante una API REST unificada. |
|---|---|---|
| objects | array | |
| video_info | object | |
| analysis_id | string | |
| detected_objects | number | |
| track_manifest_url | string |
API
Explora API de modelos de imagen, vídeo y cambio de rostro. Prueba cualquier modelo e intégralo mediante una API REST unificada.
cURL
# 1) Submit — returns { "task_uuid": "..." }
curl -X POST "https://www.namifusion.com/api/v1/marketplace/run/namifusion/head-swap/analyze" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"resolution": "720p"
}
}'
# 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"Python
import time, requests
API_KEY = "YOUR_API_KEY"
HEADERS = {"Authorization": f"Bearer {API_KEY}"}
# 1) Submit
resp = requests.post(
"https://www.namifusion.com/api/v1/marketplace/run/namifusion/head-swap/analyze",
headers=HEADERS,
json={
"input": {
"resolution": "720p"
}
},
)
resp.raise_for_status() # 401/402/429/5xx stop here instead of polling a bad task
task = resp.json()
# 2) Poll until a terminal state (completed / failed / cancelled).
# This model is allowed up to 1800s server-side.
deadline = time.time() + 1860
while task.get("status") not in ("completed", "failed", "cancelled"):
if time.time() > deadline:
raise TimeoutError(f"still {task.get('status')} — keep the task_uuid and poll later")
time.sleep(3)
poll = requests.get(f"https://www.namifusion.com/api/v1/marketplace/run/tasks/{task['task_uuid']}", headers=HEADERS)
poll.raise_for_status()
task = poll.json()
print(task["status"], task.get("output"))JavaScript
const API_KEY = "YOUR_API_KEY";
const HEADERS = { Authorization: `Bearer ${API_KEY}` };
// 1) Submit
const resp = await fetch("https://www.namifusion.com/api/v1/marketplace/run/namifusion/head-swap/analyze", {
method: "POST",
headers: { ...HEADERS, "Content-Type": "application/json" },
body: JSON.stringify({
"input": {
"resolution": "720p"
}
}),
});
if (!resp.ok) throw new Error(`submit failed: ${resp.status} ${await resp.text()}`);
let task = await resp.json();
// 2) Poll until a terminal state (completed / failed / cancelled).
// This model is allowed up to 1800s server-side.
const deadline = Date.now() + 1860 * 1000;
while (!["completed", "failed", "cancelled"].includes(task.status)) {
if (Date.now() > deadline) throw new Error(`still ${task.status} — keep the task_uuid and poll later`);
await new Promise((r) => setTimeout(r, 3000));
const poll = await fetch(`https://www.namifusion.com/api/v1/marketplace/run/tasks/${task.task_uuid}`, { headers: HEADERS });
if (!poll.ok) throw new Error(`poll failed: ${poll.status}`);
task = await poll.json();
}
console.log(task.status, task.output);Documentación de API
Head Swap - Analyze
Detect and track heads in a video as the first stage of the Head Swap workflow.
Head Swap Analyze follows visible heads across the input video and creates the obj_id values and track_manifest_url required by the Generate stage. The result also includes previews and video metadata for review. This model does not produce the final swapped video, so keep the original video, resolution, and analysis output together as one workflow unit.
Key Features
- Head detection and tracking: Identifies targets and builds tracking data across video frames.
- Target selection previews: Returns each head's
obj_id, preview, mask, and coverage inobjects. - Generate-ready tracking data: Produces a
track_manifest_urlfor Head Swap Generate. - Video metadata: Includes width, height, FPS, and frame count in
video_info. - 480p and 720p analysis: Tracks targets at the same resolution used for generation.
Technical Specifications
| Item | Details |
|---|---|
| Workflow | Head Swap step 1 |
| Required input | video_url |
| Maximum video length | 30 seconds |
| Resolution | 480p, 720p (default) |
| Main outputs | objects, track_manifest_url, video_info |
| Next model | namifusion/head-swap/generate |
Basic Workflow
- Send the video URL and selected resolution to
namifusion/head-swap/analyze. - Poll the task result endpoint until analysis completes.
- Review the previews in
objectsand select the headobj_idvalues to replace. - Pass the same video, returned manifest, and selected IDs to Head Swap Generate.
Pricing
The existing Marketplace rate is 10 credits per analysis request. This documentation update does not change pricing.
Best Practices
Use a video no longer than 30 seconds with heads large enough to inspect clearly. Heavy blur, long occlusions, and frequent movement outside the frame make tracking less reliable. Always use the same video and resolution in Generate, and never combine a track_manifest_url from a different Analyze task.
Modelos relacionados
Head Swap – Generate
namifusion/head-swap/generate. Explora API de modelos de imagen, vídeo y cambio de rostro. Prueba cualquier modelo e intégralo mediante una API REST unificada.
Character Swap – Generate
namifusion/character-swap/generate. Explora API de modelos de imagen, vídeo y cambio de rostro. Prueba cualquier modelo e intégralo mediante una API REST unificada.
Character Swap – Analyze
namifusion/character-swap/analyze. Explora API de modelos de imagen, vídeo y cambio de rostro. Prueba cualquier modelo e intégralo mediante una API REST unificada.