Character Swap – Analyze
namifusion/character-swap/analyze
namifusion/character-swap/analyze. इमेज, वीडियो और चेहरा बदलने वाले मॉडल API देखें। किसी मॉडल को आजमाएं और एकीकृत REST API से जोड़ें।
पूरे पैरामीटर, आउटपुट स्कीमा और मौजूदा मूल्य
| AI मॉडल API मार्केटप्लेस | एक प्लेटफॉर्म, सब कुछ | सबसे लोकप्रिय | शर्तें | इमेज, वीडियो और चेहरा बदलने वाले मॉडल API देखें। किसी मॉडल को आजमाएं और एकीकृत REST API से जोड़ें। |
|---|---|---|---|---|
| resolutionResolution | select | 720p | 480p | 720p |
पूरे पैरामीटर, आउटपुट स्कीमा और मौजूदा मूल्य
| और जानें | एक प्लेटफॉर्म, सब कुछ | इमेज, वीडियो और चेहरा बदलने वाले मॉडल API देखें। किसी मॉडल को आजमाएं और एकीकृत REST API से जोड़ें। |
|---|---|---|
| objects | array | |
| video_info | object | |
| analysis_id | string | |
| detected_objects | number | |
| track_manifest_url | string |
API
इमेज, वीडियो और चेहरा बदलने वाले मॉडल API देखें। किसी मॉडल को आजमाएं और एकीकृत REST API से जोड़ें।
cURL
# 1) Submit — returns { "task_uuid": "..." }
curl -X POST "https://www.namifusion.com/api/v1/marketplace/run/namifusion/character-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/character-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/character-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);API दस्तावेज
Character Swap - Analyze
Detect and track every person in a video before assigning replacement character references.
Character Swap Analyze is the first stage of the two-step Character Swap workflow. It follows people across the input video and returns the obj_id values and track_manifest_url required by the Generate stage. This model does not replace anyone by itself. Keep the analysis result together with the original video and resolution so the next request uses a consistent set of inputs.
Key Features
- Person detection and tracking: Identifies people in the video and builds object tracks across frames.
- Selectable previews: Returns an
objectslist with each person'sobj_id, preview, mask, and coverage information. - Generate-ready manifest: Produces a
track_manifest_urlthat can be passed directly to Character Swap Generate. - Video metadata: Includes width, height, FPS, and frame count in
video_info. - 480p and 720p analysis: Lets you select the same resolution that will be used for generation.
Technical Specifications
| Item | Details |
|---|---|
| Workflow | Character 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/character-swap/generate |
Basic Workflow
- Send the video URL and selected resolution to
namifusion/character-swap/analyze. - Poll the task result endpoint until processing completes.
- Review the previews in
objectsand select theobj_idvalues to replace. - Pass the same
video_url, returnedtrack_manifest_url, and selected IDs to the Generate stage.
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 in which each person remains clearly visible. Heavy motion blur, long full occlusions, and very small subjects can reduce tracking quality. In Generate, use the same video, resolution, and manifest produced by this Analyze task; do not mix results from separate analyses.
संबंधित मॉडल
Head Swap – Generate
namifusion/head-swap/generate. इमेज, वीडियो और चेहरा बदलने वाले मॉडल API देखें। किसी मॉडल को आजमाएं और एकीकृत REST API से जोड़ें।
Head Swap – Analyze
namifusion/head-swap/analyze. इमेज, वीडियो और चेहरा बदलने वाले मॉडल API देखें। किसी मॉडल को आजमाएं और एकीकृत REST API से जोड़ें।
Character Swap – Generate
namifusion/character-swap/generate. इमेज, वीडियो और चेहरा बदलने वाले मॉडल API देखें। किसी मॉडल को आजमाएं और एकीकृत REST API से जोड़ें।