Video
Image to video
Animate your own photo: upload it, then use it as the first frame, the last frame or a reference image of a video.
This page uses NURETA_URL, NURETA_KEY and the wait_task helper from Get started.
Use a photo as the opening frame of a clip. This guide uses the balcony.jpg from Make an image, but any JPEG, PNG or WebP photo of adults works.
- Ask for an upload URL. Send the real type of the file (
image/jpeg,image/pngorimage/webp):
UP=$(curl -s -X POST "$NURETA_URL/api/v3/contents/uploads" \
-H "Authorization: Bearer $NURETA_KEY" \
-H "Content-Type: application/json" \
-d '{"fileName": "balcony.jpg", "contentType": "image/jpeg"}')- Upload the bytes with
PUT. Send exactly the returnedcontentType, and noAuthorizationheader:
curl -s -X PUT "$(printf '%s' "$UP" | jq -r .uploadUrl)" \
-H "Content-Type: $(printf '%s' "$UP" | jq -r .contentType)" --data-binary @balcony.jpg
ASSET=$(printf '%s' "$UP" | jq -r .assetUrl)- Create the video with the photo as
first_frame:
TASK_ID=$(curl -s -X POST "$NURETA_URL/api/v3/contents/generations/tasks" \
-H "Authorization: Bearer $NURETA_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "seedance2.0-fast", "resolution": "480p", "duration": 5,
"content": [
{"type": "text", "text": "She turns to the camera and smiles, the wind moves her hair"},
{"type": "image_url", "image_url": {"url": "'"$ASSET"'"}, "role": "first_frame"}
]}' | jq -r .id)
wait_task "$NURETA_URL/api/v3/contents/generations/tasks/$TASK_ID" | jq '{status, video: .content.video_url, error}'Other ways to use a photo:
"role": "last_frame": the clip ends on the photo. You can send a first and a last frame together.- No
role: a reference image. The same person or place appears in a new composition. Up to 9 images per task. Do not mix frames and reference images in one clip: a frame wins, and the reference images are not used. "role": "background"(on aseahorse-*model): the photo is the place, not a person.
Common errors
| You get | Why | Fix |
|---|---|---|
422 input_media_unreadable with error.frame: "first_frame" | The photo could not be read: a wrong link, a wrong Content-Type on the PUT, or not an image. | Upload the photo again with its real type. |
422 input_media_minor_rejected / input_media_moderation_rejected / input_media_religion_politics_rejected | The photo check refused the photo. error.media_index (for a reference image) or error.frame says which one. | Use another photo. Nothing was charged. |
422 input_media_too_large | The photo is over 40 MB or 100 megapixels. | Make it smaller (under 10 MB is best). |
403 MediaNotOwned | The URL is another account's upload or output. | Upload the file with your own key. |
410 media_expired | Your upload was deleted (72 hours after the upload if no delivered video uses it). | Upload it again. |
error.media_index counts from 0 over your image_url items without a frame role, your library_item items and your audio_url item, in the order you sent them. The text item and the frames do not count.