Skip to main content

hyperframes.compose

hyperframes.compose turns a plain-language description into a HyperFrames HTML/CSS/JS composition that hyperframes.render can turn into an MP4. It's the "describe it, the LLM writes it" half of video generation — the same split slides.outline provides for decks: the model does the creative work, the pack does the production-contract work.

Why this pack exists

hyperframes.render only renders an author-supplied composition. Writing that composition by hand means reproducing the HyperFrames contract exactly — a sized canvas, a root <div> with data-composition-id / data-width / data-height, and a paused GSAP timeline registered on window.__timelines["main"]. A dropped attribute makes the render fail. So callers ended up pasting raw HTML.

This pack closes that gap without trusting the model to get the boilerplate right. The model returns only three creative pieces — extra CSS, the visible class="clip" elements, and the GSAP timeline body — and the pack assembles the final document around the guaranteed scaffolding (canvas sized to the chosen aspect ratio, root data-*, the window.__timelines registration, an optional narration <audio>). The structural contract holds regardless of model quality.

Inputs

FieldTypeRequiredDefaultNotes
descriptionstringyesWhat the video should show/say.
modelstringyesGateway model id (provider/model; see helmdeck://models).
aspect_ratiostringno16:916:9, 9:16, or 1:1 — drives the exact canvas size (reuses hyperframes.render's preset matrix).
resolutionstringno1080p1080p or 4k — sets the canvas pixel dimensions.
duration_secondsnumberno8Video length (cap 720s). With audio_url, set this to the audio's length.
audio_urlstringnoA presigned audio URL (e.g. podcast.generate's audio_url). When set, the pack embeds an <audio> element so the rendered MP4 carries narration. Empty → a silent video.
stylestringnoFreeform visual style hint (e.g. "dark, minimal, bold type").
max_tokensnumbernoderivedCompletion-token budget (clamped to [2048, 8192]).

Outputs

FieldTypeNotes
composition_htmlstringThe assembled, render-ready composition. Pass to hyperframes.render's composition_html.
modelstringThe model used.
aspect_ratiostringEcho of the aspect ratio.
width / heightnumberThe canvas pixel dimensions.
duration_secondsnumberThe video length baked into the composition.
has_audiobooleanWhether a narration <audio> element was embedded.
duration_sourcestring"audio" when synced to an embedded track, else "timeline".

Async behavior

Asynchronous (Async: true) — one gateway LLM call; no session needed (it only calls the gateway, then hyperframes.render does the session-bound rendering).

Error codes

CodeTriggers
invalid_inputMissing description/model; unsupported aspect_ratio/resolution; the model returned an unparseable spec or no visible elements.
internalRegistered without a gateway dispatcher.
handler_failedGateway returned no choices.

See also