Validate Wan 3.0 reference limits in Python before submitting

wan-3.0 takes 10 images, 5 videos (15 s total, 16 fps minimum) and 5 audios (15 s total). A short Python check catches an over-limit manifest early.

5 min readSume
All posts

Check an asset manifest against wan-3.0's reference limits on your side before you submit. Sume's catalog entry for wan-3.0 lists at most 10 reference images, at most 5 reference videos with 15 seconds in total and at least 16 fps, and at most 5 reference audios with 15 seconds in total. A short function that applies those caps saves a round trip and a confusing error on a long pipeline.

Wan 3.0 reference limits in the Sume catalog (read 2026-10-07)
Reference typeLimit for wan-3.0
Images10
Videos5, 15 s total, 16 fps minimum
Audios5, 15 s total

The check

This script has no network calls, so you can run it as is. It reports every problem rather than the first one.

LIMITS = {"images": 10, "videos": 5, "audios": 5}
MAX_VIDEO_SECONDS = 15
MAX_AUDIO_SECONDS = 15


def check_manifest(m):
    problems = []
    for key, cap in LIMITS.items():
        if len(m.get(key, [])) > cap:
            problems.append(f"{key}: {len(m[key])} sent, wan-3.0 allows {cap}")
    if sum(v["seconds"] for v in m.get("videos", [])) > MAX_VIDEO_SECONDS:
        problems.append("reference videos exceed 15 s in total")
    if any(v["fps"] < 16 for v in m.get("videos", [])):
        problems.append("a reference video is under 16 fps")
    if sum(a["seconds"] for a in m.get("audios", [])) > MAX_AUDIO_SECONDS:
        problems.append("reference audio exceeds 15 s in total")
    return problems


manifest = {
    "images": ["a.png"] * 11,
    "videos": [{"url": "v.mp4", "seconds": 9, "fps": 24},
               {"url": "w.mp4", "seconds": 8, "fps": 12}],
    "audios": [],
}
for p in check_manifest(manifest):
    print(p)

Rules the script leaves out

  • On the Video Router's generate endpoint, reference audio is rejected unless a reference image or video is sent with it.
  • The same endpoint rejects first/end frame fields together with reference_*_urls. On /v1/videos, if frame_images and input_references are both sent, frame_images controls the mode.
  • Alibaba's page describes up to 100 MB and 50 pages for documents; that limit is not part of Sume's request shape, because Sume lists no document input.
  • The Morphic page says Wan 3.0 accepts up to 20 references; the Sume per-type caps add up to 20, but check the response from GET /v1/videos/models rather than a vendor page.

Reading limits from the catalog instead

The constants at the top of the script come from the catalog entry for wan-3.0 and from nothing else, so a catalog update can leave them out of date. Sume documents GET /v1/videos/models as the place to read supported resolutions, durations and reference types, and the documented example response lists reference types such as image_url, video_url and audio_url, not the per-type counts shown above. Keep them as constants with a comment that says where you got them, and re-check them when the model changes.

A second check worth adding is duration. wan-3.0 accepts 2 to 30 seconds, so a request for 31 seconds fails, and a request for 1 second fails too. Resolution is one of 480p, 720p and 1080p. A three-line check for those saves a failed submit.

Testing the function

Feed it three manifests: one at the limits exactly, one with eleven images, and one with a 12 fps reference clip. The first must return an empty list and the others must each return one message. If you also run it in CI against the manifests your job builder produces, a template change that adds an eleventh image fails a test instead of a production job.

Where to enforce it

Run the check where you build the job, before you submit and before you attach an Idempotency-Key, so a rejected manifest does not leave a key that looks like a real job. Keep the numbers in one constant so that a catalog change is a one-line edit. The cost of a mistake is small on a draft, but a batch of 50 jobs that all fail validation costs time and API quota to diagnose.

Sources

Related posts

More in Developers

All Developers posts

Written by Sume