Split a 31 or 61 second video into valid Sume jobs: Python by model
A 31 or 61 second video cannot be 30 s plus 1 s on Wan 3.0 or Seedance 2.5, since the last job is under the minimum. Split evenly with this Python script.

Split the length evenly across the fewest jobs the model's maximum allows. A 31-second video is 16 plus 15 seconds on Wan 3.0 or Seedance 2.5, not 30 plus 1, because the 1-second job is under the minimum (2 seconds on Wan, 4 on Seedance 2.5). The script below does this for any total and refuses lengths that cannot be split.
Why the last job breaks
Platform limits push you to odd lengths. YouTube says a Short can run up to three minutes, and Google lists a 60-second feed window for Shorts ads, so a 61-second file is a real case. Every Sume video model has a minimum as well as a maximum. Wan 3.0 takes 2 to 30 seconds, Seedance 2.5 takes 4 to 30, Seedance 2.0 takes 4 to 15, and Omni Flash 1.1 takes 3 to 10. A greedy split (30, 30, 1) ends on a job that the model refuses.
The script
It takes the smallest job count, ceil(total / max), then spreads the remainder one second at a time so the parts differ by at most one second.
import math
LIMITS = {"wan-3.0": (2, 30), "seedance-2.5": (4, 30),
"seedance-2": (4, 15), "gemini-omni-flash-1.1": (3, 10)}
def split(total, model):
lo, hi = LIMITS[model]
n = math.ceil(total / hi)
base, extra = divmod(total, n)
parts = [base + 1] * extra + [base] * (n - extra)
if min(parts) < lo:
raise ValueError(f"{total} s cannot be split for {model}")
return parts
for model in LIMITS:
for total in (31, 61, 91):
print(model, total, split(total, model))
try:
split(1, "wan-3.0")
except ValueError as e:
print("refused:", e)Output for the four models
| Model | 31 s | 61 s |
|---|---|---|
| Wan 3.0 | 16, 15 | 21, 20, 20 |
| Seedance 2.5 | 16, 15 | 21, 20, 20 |
| Seedance 2.0 | 11, 10, 10 | 13, 12, 12, 12, 12 |
| Omni Flash 1.1 | 8, 8, 8, 7 | 9, 9, 9, 9, 9, 8, 8 |
What the splits cost
At 720p, Wan 3.0 lists $0.10 per second and Sume bills the list times 1.25, rounded up to the cent per job. The 16 and 15 second jobs cost $2.00 and $1.88, so 31 seconds is $3.88. The 61-second split of 21, 20 and 20 seconds costs $2.63, $2.50 and $2.50, which is $7.63.
On Seedance 2.5 at 720p in 9:16, the 16 and 15 second jobs cost $9.25 and $8.67, and the 31 seconds total $17.92. Timeline then joins the parts for $0.10 per started output minute, so a 31-second file adds $0.10 and a 61-second file adds $0.20.
A longer case: 91 seconds
The same function handles 91 seconds. Wan 3.0 and Seedance 2.5 need four jobs of 23, 23, 23 and 22 seconds. Seedance 2.0 needs seven jobs of 13 seconds, and Omni needs ten jobs: one of 10 seconds and nine of 9. The 91-second total is still inside the three-minute Shorts limit that YouTube states, but it is past the 60 seconds Google says display in the Shorts ad feed.
The job count matters more than the price when you hand the parts to a person for review. Four clips are four sets of cut points to approve, and ten are ten.
Limits of an even split
- Cut points land at equal intervals, not at scene changes. If the script has beats, split at the beats and check each part against the model's range.
- Continuity across parts needs an end frame or a reference. Wan 3.0 and Seedance accept image and end-frame inputs in the catalog.
- Re-read
GET /v1/videos/modelsbefore a run. The limits in the script are the values read on 2026-10-07.
Sources
Related posts
More in Developers
- Spot-check burned-in captions with video frames at STT word times
Check captions on a rendered video by pulling stills at word midpoints from a Sume STT result with POST /v1/video-frames, then compare text to speech.
- SQLite: add a sume_job_id column to rows that used sora-2 snapshots
OpenAI removed the Videos API and every sora-2 snapshot on Sept 24, 2026. A migration that tags old rows, then re-renders each once through Sume.
- SQLite ledger for Sume bulk queues: SKU to run id and what to retry
Record each bulk queue item by index in SQLite, keep the SKU you sent, and query the SKUs that failed or were canceled and never completed in a later queue.
- Start a Sume render from a serverless function: submit, save, 202
A function must not wait for a video. Submit with mode webhook and a stable Idempotency-Key, save the status URL, return 202, and let the signed webhook finish.
Written by Sume