Picture to video
Make a clip that opens on a picture you give, or moves from one picture to another.
- Pick a model that takes your frames.
- Send the job with a first frame.
- Add a last frame for a transition.
- Wait and fetch the clip.
1. Pick a model that takes your frames
A model's supported_frame_images on the video models list names the frames it takes: first_frame, last_frame, or both. A model takes only the frames it lists. Which models take which, read 2026-09-29: Choose a video model.
| You have | Pick a model listing |
|---|---|
| one picture the clip opens on | first_frame |
| two pictures, the clip moving from one to the other | first_frame and last_frame |
2. Send the job with a first frame
frame_images carries the picture and where it goes. The sample opens a 5-second 720p clip in 16:9 on a picture of sand in golden light, on alibaba/wan-3.0, which takes a first frame. The prompt says what happens after that frame.
import json
import os
import urllib.request
API_KEY = os.environ["OPENDUNES_API_KEY"]
ADDRESS = "https://opendunes.com/v1/videos"
MODEL = "alibaba/wan-3.0"
FIRST_FRAME = "https://opendunes.com/hero-dunes.webp"
PROMPT = (
"The golden haze settles into sand dunes at dusk, wind lifting fine "
"sand off the crests, slow pan right"
)
request = urllib.request.Request(
ADDRESS,
data=json.dumps(
{
"model": MODEL,
"prompt": PROMPT,
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9",
"frame_images": [
{
"type": "image_url",
"image_url": {"url": FIRST_FRAME},
"frame_type": "first_frame",
},
],
}
).encode(),
headers={
"Authorization": "Bearer " + API_KEY,
"Content-Type": "application/json",
},
)
with urllib.request.urlopen(request) as response:
job = json.load(response)
print(job["id"], job["status"])In each frame_images entry | Holds |
|---|---|
type | image_url for a picture at an address, file for a picture you stored |
image_url.url | the picture's address: public HTTPS, answering with the picture itself |
file.file_id | the ID of a picture stored in Files and storage |
frame_type | first_frame or last_frame: where the picture goes |
The answer is 202, with the job's id and status pending. prompt may be left out when the picture carries the whole request. Every field: Clips.
A frame takes the picture only from a model that lists that frame. Check supported_frame_images before you send a last_frame: alibaba/wan-3.0 lists first_frame alone.
3. Add a last frame for a transition
With a first and a last frame, the model makes the motion between them. Send two entries to a model that lists both, such as bytedance/seedance-2.0-fast: the second can be a picture you stored, by its file_id. The body, with your two pictures in place of …:
{
"model": "bytedance/seedance-2.0-fast",
"prompt": "The shop's shutter rolls up on a morning in Oran",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9",
"frame_images": [
{
"type": "image_url",
"image_url": {"url": "https://…/shutter-down.jpg"},
"frame_type": "first_frame"
},
{
"type": "file",
"file": {"file_id": "file_…"},
"frame_type": "last_frame"
}
]
}At most two entries: one first frame, one last. A file_id that is not yours, has expired, or is not a picture gets a 422, and no job is made.
A frame fixes the picture exactly. To guide the look of a clip without fixing a frame, send pictures in input_references: Reference pictures. When both are sent, frame_images wins.
4. Wait and fetch the clip
Ask GET /v1/videos/{id} every ten seconds until the job ends, then fetch the clip from /v1/videos/{id}/content?index=0 with your API keyAPI keyThe key you create and send with every request that calls a model.More on API keys →. The whole loop, in four languages: Text to video. To have the end posted to you instead: Video webhooks.
The clip is charged in DADAThe Algerian dinar, the one currency the docs show.More on Balance and charges → once, when the job reports completed. On some models a clip from a picture has its own rate, and on others each picture sent in is charged: the model's page in Models lists what it charges for. A job that ends failed, cancelled or expired charges nothing.
Last modified on