Python clip planner for a Short: split any length into model jobs

A short Python function splits a Short's length into equal whole-second jobs within each Sume video model's min and max, then prices them with Timeline.

5 min readSume
All posts

Hard-coding clip lengths breaks when a model changes. This planner takes a total length in seconds and a model, splits it into the fewest whole-second jobs that fit the model's maximum, spreads the remainder evenly, checks the model's minimum, and prices the result with the $0.10 per Timeline minute rule. It is plain Python with no network calls.

Shorts allow up to 3 minutes (YouTube Help, read 2026-10-09), so the largest total to feed it is 180.

The planner

Per-second rates are the 720p (768p for minimax-h3) values from the Sume price tool on 2026-10-09; refresh them from GET /v1/videos/models. Limits come from the Sume video docs: Wan 3.0 2 to 30 s, Seedance 2.5 4 to 30 s, MiniMax H3 5 to 15 s, Omni Flash 1.1 3 to 10 s.

import math

# model: (min s, max s, $/s) at 720p (768p for minimax-h3), 2026-10-09
MODELS = {"wan-3.0": (2, 30, 0.125), "seedance-2.5": (4, 30, 0.5778),
          "minimax-h3": (5, 15, 0.075), "gemini-omni-flash-1.1": (3, 10, 0.125)}

def plan(model, total):
    lo, hi, rate = MODELS[model]
    n = math.ceil(total / hi)
    base, extra = divmod(total, n)
    clips = [base + (1 if i < extra else 0) for i in range(n)]
    if min(clips) < lo:
        raise ValueError("clip below model minimum")
    fee = 0.10 * math.ceil(total / 60) if n > 1 else 0
    return clips, round(total * rate + fee, 2)

print(plan("wan-3.0", 100))
print(plan("gemini-omni-flash-1.1", 50))

Sample output

Rates for Seedance 2.5 vary with aspect ratio and resolution (token-priced), so treat its entry as the 9:16 720p value.

plan(model, total) results (computed by the function above, rates from the price tool, read 2026-10-09)
ModelTotal secondsJobsClip lengthsGeneration + Timeline
wan-3.0100425+25+25+25$12.70
gemini-omni-flash-1.150510+10+10+10+10$6.35
minimax-h3100715+15+14+14+14+14+14$7.70
seedance-2.560230+30$34.77

Where it stops

  • Equal splits are the cheapest rule to explain, not the best for storytelling; set the lengths by scene when you can.
  • A single-job plan skips the Timeline fee. Anything with two or more clips needs a render at $0.10 per minute, rounded up.
  • Totals use floats rounded to cents; the price tool reports exact values, so use it for invoices.
  • The function raises ValueError for lengths a model cannot reach, for example plan("seedance-2.5", 3), which is below its 4-second minimum.

Sources

Related posts

More in Models

All Models posts

Written by Sume