> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gengen.farm/llms.txt
> Use this file to discover all available pages before exploring further.

# Genjutsu

Transform an existing video with `higgsfield-genjutsu`. Choose a mode:

| Function | `mode` | Reference images |
| - | - | - |
| [Motion Transfer](https://docs.gengen.farm/api-reference/higgsfield/genjutsu/motion-transfer.md) | `motion_transfer` | 1–8 images of the target character or subject |
| [Object Swap](https://docs.gengen.farm/api-reference/higgsfield/genjutsu/object-swap.md) | `object_swap` | 1–8 images of the replacement object |
| [Restyle](https://docs.gengen.farm/api-reference/higgsfield/genjutsu/restyle.md) | `restyle` | 0–5 optional character images, plus a current style ID |

All modes require one HTTPS source video of at least 4 seconds. Videos longer than 30 seconds use only their first 30 seconds. Output framing follows the processed source. Restyle output duration and FPS can vary with the style; do not send duration, aspect ratio, frame rate, audio generation, or output count controls.

Choose `480p`, `720p` (default), or `1080p`. Source videos are limited to 200 MiB and reference images to 64 MiB each. Use publicly reachable HTTPS URLs without embedded credentials. `asset://` and private-network URLs are unsupported. Motion Transfer and Object Swap URLs must be at most 2,083 characters. Object Swap also requires at least 409,600 pixels per source frame.

The optional `prompt` accepts up to 10,000 characters. Only `controls.resolution` and, for Restyle, `controls.presetId` are supported. Provider overrides are not supported.

## Create and retrieve

Use [Create task](https://docs.gengen.farm/api-reference/higgsfield/genjutsu/create-task.md), then poll [Retrieve task](https://docs.gengen.farm/api-reference/higgsfield/genjutsu/retrieve-task.md) with the returned `higgsfieldgenjutsu:` ID. Successful video URLs appear in `outputs.videos`. Polling never starts another generation. [Cancellation](https://docs.gengen.farm/api-reference/higgsfield/genjutsu/cancel-task.md) is best effort.

## Billing

See [live pricing](https://docs.gengen.farm/pricing.md) for the final USD rates, with separate rows for each function and resolution. A successful task is charged for `ceil(min(source video seconds, 30))` seconds. For example, 4.2 seconds bills as 5 seconds; a 42-second source bills as 30 seconds. The rate is fixed when the task is admitted. Balance is reserved before submission and settled after successful processing; failed or confirmed cancelled tasks are not charged. Repeated retrieval does not charge again.

Restyle preserves the source audio within the processed segment. Motion Transfer and Object Swap do not expose an audio-generation setting.

Use [Playground](https://gengen.farm/playground?model=higgsfield-genjutsu), [API Explorer](https://gengen.farm/api-explorer/demos/genjutsu), or AI Projects to select the same three modes. AI Projects requires a saved script and validated original media; the source video's processed duration determines the run duration.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.