Character Swap – Generate

namifusion/character-swap/generate

namifusion/character-swap/generate. Durchsuche APIs für Bild-, Video- und Gesichtstauschmodelle. Teste jedes Modell und integriere es über eine einheitliche REST-API.

Vollständige Parameter, Ausgabeschema und aktuelle Preise

Marktplatz für KI-Modell-APIsEine Plattform für allesAm beliebtestenBedingungenDurchsuche APIs für Bild-, Video- und Gesichtstauschmodelle. Teste jedes Modell und integriere es über eine einheitliche REST-API.
track_manifest_url *Track manifest URLtext——
mappings *Character mappingsarray<object>——
↳obj_id *Character obj_idnumber——
↳img_urls *Reference imagesimage_upload—1–3 items
resolutionResolutionselect720p480p | 720p
seedSeednumber——

Vollständige Parameter, Ausgabeschema und aktuelle Preise

Mehr erfahrenEine Plattform für allesDurchsuche APIs für Bild-, Video- und Gesichtstauschmodelle. Teste jedes Modell und integriere es über eine einheitliche REST-API.
videosarray

API

Durchsuche APIs für Bild-, Video- und Gesichtstauschmodelle. Teste jedes Modell und integriere es über eine einheitliche REST-API.

cURL
# 1) Submit — returns { "task_uuid": "..." }
curl -X POST "https://www.namifusion.com/api/v1/marketplace/run/namifusion/character-swap/generate" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "input": {
    "track_manifest_url": "ANALYZE_OUTPUT.track_manifest_url",
    "mappings": [
      {
        "obj_id": 0,
        "img_urls": [
          "https://assets-public.namifusion.com/marketplace/images/2026-06-12/638e1ee18ac7.jpeg"
        ]
      }
    ],
    "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/generate",
    headers=HEADERS,
    json={
        "input": {
            "track_manifest_url": "ANALYZE_OUTPUT.track_manifest_url",
            "mappings": [
                {
                    "obj_id": 0,
                    "img_urls": [
                        "https://assets-public.namifusion.com/marketplace/images/2026-06-12/638e1ee18ac7.jpeg"
                    ]
                }
            ],
            "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 7200s server-side.
deadline = time.time() + 7260
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/generate", {
  method: "POST",
  headers: { ...HEADERS, "Content-Type": "application/json" },
  body: JSON.stringify({
    "input": {
      "track_manifest_url": "ANALYZE_OUTPUT.track_manifest_url",
      "mappings": [
        {
          "obj_id": 0,
          "img_urls": [
            "https://assets-public.namifusion.com/marketplace/images/2026-06-12/638e1ee18ac7.jpeg"
          ]
        }
      ],
      "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 7200s server-side.
const deadline = Date.now() + 7260 * 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-Dokumentation

Character Swap - Generate

Replace selected people in an analyzed video with reference characters while preserving the original audio.

Character Swap Generate is the second stage of the two-step workflow. It uses the track_manifest_url and obj_id values returned by Analyze, then assigns one to three reference images to each selected person through mappings. The video_url must identify the same video used for analysis, and the resolution must match across both stages.

Key Features

  • Per-person replacement: Select each target explicitly with the obj_id returned by Analyze.
  • Multiple-character mappings: Add multiple entries to mappings to configure several people independently.
  • One to three reference images: Provide multiple appearance references per person to cover useful angles and details.
  • Original audio preservation: Keeps the input video's audio track in the generated result.
  • 480p and 720p output: Choose the output tier that fits the intended quality and existing pricing band.

Technical Specifications

ItemDetails
WorkflowCharacter Swap step 2
Required inputsvideo_url, track_manifest_url, mappings
mappings formatArray of {obj_id, img_urls} objects
Reference images1-3 URLs per person
Resolution480p, 720p (default)
Maximum video length30 seconds
Optional inputseed
OutputVideo URL with the original audio preserved

Basic Workflow

  1. Process the source video with Character Swap Analyze.
  2. Select the target obj_id values from the returned objects list.
  3. Pair each ID with its reference image URLs in mappings.
  4. Submit the same video and Analyze manifest, then poll until generation completes.

Pricing

The existing Marketplace rates are 40 credits per 5-second unit at 480p and 75 credits per 5-second unit at 720p. Videos are limited to 30 seconds. This documentation update does not change pricing.

Best Practices

For each person, use sharp reference images with a clear view of the character and, when possible, include slightly different angles. The obj_id, video, and manifest must all come from the same Analyze result. Do not change resolution between stages or reuse a manifest created for another video.