Image to video pipeline.
Coming soon. Generate stills, pick one, animate it into a 5 s clip, and download it. In Python.

- Stack
- Python 3.10+, httpx
- Needs
- API key and credits
- Uses
image.generate,video.generate, estimate- Status
- Coming soon
Pick the still before you pay for the clip.
Coming soon: video generation isn't live yet, so this recipe can't run today. The still step works now.
A clip costs far more than a still. Generating a few cheap stills first, and animating only the one you like, keeps the expensive step to a single attempt.
The chosen still's asset id goes straight into the video job's start_frame slot, so nothing is downloaded and uploaded again between the two steps.
How it fits together.
The recipe in order, from the first request to the saved file.
Generate candidates
Three
image.generatesubmits with different seeds andaspect_ratio: "16:9". Each returns202with arequest_id.Wait and download
Poll each
status_urlwith backoff until it'scompleted. Every output is an asset with anid.Pick one
Look at the stills and choose. Keep the still at the clip's aspect ratio so nothing gets cropped.
Estimate the clip
POST /returns the credits, model and output size without running anything. The script checks your balance and asks before submitting.v1/ generation/ estimate Animate
Coming soon:
video.generatewithinputs: {"start_frame": [id]}will make a 5 second 480p clip onwan-2.2-i2v. Then download the MP4.
The core of it.
An excerpt from the recipe. It runs once every model it uses is live.
# 1. Three candidate stills, one per seedjobs = [ submit("image.generate", {"prompt": prompt, "aspect_ratio": "16:9", "resolution": "1k", "seed": seed}) for seed in [11, 22, 33]]stills = [wait(request_id)["outputs"][0]["id"] for request_id in jobs]# 2. Animate the one you picked; its asset id is the start framevideo = { "prompt": "slow push-in toward the lighthouse, waves breaking on the rocks", "inputs": {"start_frame": [stills[choice]]}, "aspect_ratio": "16:9", "resolution": "480p", "duration": 5,}# 3. Price it before spendingestimate = check(api.post("/generation/estimate", json={"capability": "video.generate", **video}))["data"]print(f"clip: {estimate['credits']} credits")clip = wait(submit("video.generate", video))download(clip["video"]["id"], out_dir / "clip.mp4")The helpers check, submit, wait and download are a few lines each in the full script, which also prints each still and asks which one to animate.
Stills to start from.
Z-Image Turbo stills at 16:9, the shape of the clip. The pipeline's job is to pick one and pass its asset id to video.generate.

Waves rolling onto a pastel beach at sunset, wide view, cinematic photography

Close-up of steam rising from a cup of coffee on a sunny windowsill, cinematic photography
Change one part.
The same pipeline, adjusted for what you already have.
| Change | How |
|---|---|
| Skip the picking | The Text to Clip workflow makes the still, the clip and a cover frame in one call. |
| One job for the stills | Send num_outputs: 3 in a single image.generate submit. The price per image is the same. |
| Use your own still | Upload it with POST /, or pass a public https:// URL or a data: URI as the start_frame. |
| No polling | Add webhook_url to the video submit and let a receiver pick up the clip. |
| Live progress | Stream status, progress and log lines from /. |
What a run costs.
Priced per output at the tier the recipe uses, with planned prices for steps that are coming soon.
$0.212a run, or 4.24 credits
| Step | Model | Tier | Count | Credits | USD |
|---|---|---|---|---|---|
| Candidate stills | 1k | 3 × 0.08 | 0.24 | $0.012 | |
| Clip | 480p (coming soon) | 1 × 4 | 4 | $0.20 | |
| Total | 4.24 | $0.212 |
Questions.
Why not go straight from text to video?
The planned video model, wan-2.2-i2v (coming soon), animates a start frame rather than generating from text alone. If you don't need to pick the frame yourself, the Text to Clip workflow does the still and the clip in one call.
What happens if the clip fails?
A job that ends failed, nsfw or canceled releases its credit hold, so you pay only for completed outputs. The script stops and prints the error; submit again only if the failure looks transient.
Can I get a longer or higher-resolution clip?
Not at launch. wan-2.2-i2v is coming soon and will make 5 second clips at 480p. GET /v1/generation/capabilities lists what each live model accepts.