OpenJutsu Object Swap API

by ComfyUI

Change a jacket, hair, product or the whole background in a clip, motion and sound kept

comfyui/openjutsu-object-swap/video-edit
  • Up to 1080p
  • Object Swap

About OpenJutsu Object Swap

Change a jacket, hair, product or the whole background in a clip, motion and sound kept.

Call it with the model name comfyui/openjutsu-object-swap/video-edit on POST /jobs/createTask, from $0.105.

Introduction

Use the asynchronous video-edit endpoint with video_url and edit_target, plus prompt or reference_image_url. The change and background modes give edit_target opposite roles; the public input has no duration control.

How it works

Send the public input for openjutsu/object-swap/video-edit and save the task identifier. Poll its status to a terminal result; on success, obtain the edited video through the task’s result assets. Review that output before using it in your timeline.

Parameters

  • video_url: Required source video with no cuts, at most 15 seconds.
  • edit_target: Required short label matching the visible element, such as hair, jacket or car; separate multiple targets with commas. In background mode these are the elements to retain.
  • edit_mode: change (default) replaces the target; background retains it and replaces everything around it. For people kept on a new set, use people as the target.
  • prompt: Describe the replacement, or the new location in background mode. Supply this or reference_image_url at minimum; both may be used together.
  • reference_image_url: Optional visual reference for an outfit, hairstyle, product or location. A single-item image plus descriptive text is advisable; one whole-person reference did not reproduce the intended garment.
  • resolution: Select 480p, 540p, 768p (default) or 1080p. Rates rise with the tier; observed landscape outputs measured 864×480, 960×544, 1376×768 and 1920×1056.
  • seed: Optional whole number from 0 to 2147483647. A shared random source makes comparisons of one changed setting easier, without assuring frame-for-frame repetition.

Tips

Name the original item by its visible appearance; write the desired new appearance separately. An item-only reference with text is advisable. If an otherwise valid clip gets a generic failure, trim it to an exact whole-second length before retrying.

Limits

  • Supply a single uninterrupted shot no longer than 15 seconds. Multi-shot edits are not supported, so separate the take before submitting it.
  • The hair-colour test became platinum but retained the original curls and length despite asking for short hair; colour changes can be easier than reshaping.
  • One reference-only attempt using a whole person’s portrait missed the requested garment.
  • A source with 124 frames at 5.167 seconds repeatedly failed, while trimmed versions worked.

Request parameters

ParameterRequiredDescription
edit_modeNoChange it replaces the thing you named. Change the background keeps it and replaces everything around it. change · background · Default: change
edit_targetYesA word or two for the thing to change, as it looks in the clip: hair, jacket, car. In background mode, this is what stays.
promptNoDescribe what you want to make.
reference_image_urlNoThe picture whose face or look gets carried over.
resolutionNoChoose an available output size. 480p · 540p · 768p · 1080p · Default: 768p
seedNoUse the same seed and settings for more controlled comparisons. ≥ 0 · ≤ 2147483647
video_urlYesThe clip to work on.

Pricing

Prices are in USD. The API uses a separate USD balance. Website credits cannot be used or transferred to it, and API funds cannot be transferred to website credits. When a task is accepted, we reserve the maximum quoted amount from your API 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.

OptionUSD per second
resolution 480p$0.105
resolution 540p$0.119
resolution 768p$0.14
resolution 1080p$0.28

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.

API quick start

Call the OpenJutsu Object Swap API in three steps

  1. Create an API key. Sign in to PopNow and create a key in the API console. Keys start with sk-popnow-. API calls use your separate USD balance.
  2. Send the request. POST /jobs/createTask with model comfyui/openjutsu-object-swap/video-edit and an input object that follows the parameter table. The response returns a task ID straight away.
  3. 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": "comfyui/openjutsu-object-swap/video-edit",
  "input": {
    "prompt": "A slow aerial shot drifting over a misty pine forest at sunrise",
    "video_url": "https://media.popnow.ai/effects/flower-bloom-1abd6efb.mp4",
    "edit_target": "example",
    "edit_mode": "change",
    "resolution": "768p"
  }
}'

# 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.

OpenJutsu Object Swap API questions

How much does the OpenJutsu Object Swap API cost?

OpenJutsu Object Swap costs $0.105 per second. Prices by option: 480p $0.105 per second, 540p $0.119 per second, 768p $0.14 per second, 1080p $0.28 per second. The API uses a separate USD balance. When a task is accepted, we reserve the maximum quoted amount from your API 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 OpenJutsu Object Swap in the API?

Put comfyui/openjutsu-object-swap/video-edit for Object Swap in the model field of POST /jobs/createTask.

Do I need both text and an image?

At least one of prompt or reference_image_url is required. For reference-led wardrobe work, an isolated item plus a written description is the more useful starting point.

Will the output last exactly as long as my clip?

Not always: tested 5-second clips returned roughly 4.5 seconds, whereas an 8-second clip remained 8 seconds. Check duration before fitting the result into an edit.

What are the limits of the OpenJutsu Object Swap API?

Resolutions: 480p · 540p · 768p · 1080p; Prompt length (characters): 600; Largest upload: 90 MB; Longest input clip: 15 s. Requests outside these limits are rejected before anything is charged.

Can I try OpenJutsu Object Swap without writing code?

Run OpenJutsu Object Swap in the Playground with your API USD balance, without an API key. Each run appears in your developer history with its matching code.

More about OpenJutsu Object Swap