Skip to main content

Image-to-video

Send one image and a text prompt that describes the motion. The image becomes the first frame of the clip. The response contains the generated video clip. The request is synchronous. There is no task to poll. On LTX, a clip is 1 to 8 seconds long, at 1080p or 720p, with an optional soundtrack. On Cosmos 3 Super, a clip is 1 to 7.875 seconds long, at about 480p, with no sound.

Models

Both LTX models also serve Text-to-video. Cosmos 3 Super has its own endpoint and request: see Cosmos 3 Super. Its text-to-image model, nunchux-cosmos-3-super-t2i, can make the first frame. See Choosing a model.

Endpoint

The path /v1/videos/animations is an alias. It gives the same result and the same billing. This endpoint and the Request, Response and Example sections below are for LTX. Cosmos 3 Super takes its image on a different endpoint. See Cosmos 3 Super.

Request

Every request must include your API key and a JSON content type. See Authentication.
string
required
Your API key.
string
required
Must be application/json.
string
required
The model that generates the clip.Options: nunchux-ltx-2.5-video, nunchux-ltx-2.3-video
string
required
A text description of the motion. Describe what moves, the camera movement and the light. Do not describe again what the image already shows.
array
required
The input image. Send one message with one image_url part. The model accepts one image.You can also send the image as a top-level image_url string.When you send a data URI, Nunchux keeps a copy of the image so that it appears in your request history for 7 days.
integer
default:1920
Output width in pixels. Send it together with height. The size selects the tier, 1080p or 720p. 1080p costs more per second.Options: 1920 (1080p), 1280 (720p)
integer
default:1080
Output height in pixels. Send it together with width.Options: 1080 (1080p), 720 (720p)
number
default:6
The clip length in seconds. Range: 1 to 8. The model renders at 24 frames per second, so the length of the clip can differ from your value by a fraction of a second. The response gives the length of the clip.
object
Model options.
integer
The random seed. When you do not send a seed, the model selects one and returns it in the response. The same seed with the same parameters gives the same result.
boolean
default:true
Whether Nunchux’s content filter checks this request. Only accounts approved to turn moderation off may send false. Others get a 403. See Content moderation.
integer
default:1
The number of clips to generate. Only 1 is supported.
string
default:"b64_json"
The format of the returned clip.Options: b64_json, urlIn url format, Nunchux keeps the generated clip for 7 days, so that it appears in your request history. Then Nunchux deletes it. In b64_json format, Nunchux also tries to keep a copy for your request history, but it skips the copy when the service is busy. Save the clip from the response if you need to keep it.
Unsupported fieldsLTX does not accept steps, guidance_scale, negative_prompt or num_frames. A request that contains one of them returns a 400.
A minimal request body:

Response

The response is JSON. The data array contains one MP4 clip, as base64 data or as a URL.
integer
required
The Unix timestamp of the generation.
string
required
The model that generated the clip.
string
required
Always radical_speed. This field does not show the LTX tier. The width and height of the clip show it.
integer
required
The seed of the clip. Send it again to get the same result.
array
required
The generated clip.
A base64 clip is large. A 6 second 1080p clip can be more than 10 MB of base64 data. Use response_format: "url" when you do not need the data in the response.

Example

This example reads a local JPEG file and sends it as a data URI. A clip takes some time to render. Set the timeout of your HTTP client to 120 seconds.

Tips

  • Write the motion, not the image. Say what moves, how the camera moves, and how the light changes.
  • Use an image with the framing that you want in the clip. The clip keeps the framing of the image.
  • When extra.audio is true, describe the sound in the prompt.
  • Start at 1080p and 6 seconds. Use 720p for faster and lower-cost previews.
  • On Cosmos 3 Super, describe only the motion: which object moves, and what stays still. Use a first frame with the aspect ratio of the clip.
  • Keep the seed when you like a result. Then change one parameter at a time.

Cosmos 3 Super

Cosmos 3 Super animates one image into a silent clip of 1 to 7.875 seconds, at about 480p and 24 frames per second. It renders in 4 steps. Send the image as a first_frame reference to this endpoint: POST https://api.nunchux.com/v1/videos/generations The older path /v1/video/generations gives the same result and the same billing, but it is deprecated. The request takes the headers, prompt, seed, content_moderation and response_format fields described in Request above, and these fields:
string
required
Must be nunchux-cosmos-3-super-i2v.
array
required
The input image. Send one item with the role first_frame. The image becomes the first frame of the clip. Use an image with the same aspect ratio as the clip.
integer
default:832
Output width in pixels. Send it together with height. Range: 480 to 848, in steps of 16. width times height must be at most 409,600 pixels. For example: 832x480, 480x832 or 640x640.
integer
default:480
Output height in pixels. Send it together with width. Range: 480 to 848, in steps of 16, within the same 409,600-pixel limit.
number
default:7.875
The clip length in seconds. Range: 1 to 7.875. The model renders at 24 frames per second, so the length of the clip can differ from your value by a fraction of a second: a 2 second clip is 49 frames, about 2.04 seconds. The response gives the length of the clip.
string
default:"radical_speed"
Cosmos 3 Super has radical_speed only. radical_value returns a 400.
Unsupported fieldsCosmos 3 Super does not accept steps, frame_rate, guidance_scale, negative_prompt or extra.audio. A request that contains one of them returns a 400.
The response has the shape described in Response above. data[0] is an MP4 clip, and tier is radical_speed.
cURL

Errors and limits

A clip is billed per second of output video. On LTX, the rate depends on the tier: 1080p costs more per second than 720p. Cosmos 3 Super has the Radical Speed tier only. See the pricing page for current rates. Nunchux charges only for a successful clip. A request that fails is never billed. Every request counts toward the requests-per-minute cap of your plan. A request also holds one simultaneous-jobs slot until the response returns. See Rate limits. For authentication and credit errors, see Error codes.