Stop Writing One Video Prompt: Shot-Chaining LTX-2.5 With a JSON Film File
How dacorvo/video-generation chains LTX-2.5 shots via a JSON film schema on top of diffusers' LTX2ConditionPipeline: from/to frame math, pose-to-pose ordering, validator rules, and Trainium3 caveats.

A single paragraph prompt will not hold a character, a prop, or a mountain across a cut. Adjectives are a request; the model has no memory of the shot before. To keep a subject consistent across cuts, dacorvo/video-generation wraps LTX-2.5 and diffusers in a ~160-line Python film layer driven by a JSON film file where each shot starts from another shot's last frames (from) or ends on a later shot's first frames (to).[1][3]
Neither LTX-2.5 nor diffusers reads this JSON natively. Underneath, the script translates from and to into LTX2ConditionPipeline calls using LTX2VideoCondition(frames=..., index=...) (generate.py:519-525).[3] This page gives you the film schema, the frame arithmetic, the validator rules that will reject a malformed file, the pose-to-pose build order, and a copyable three-shot file — plus the limits the demo authors ran into.
Prerequisites:
The demo ran on an AWS trn3.48xlarge (64 NeuronCores) with 82 GB of gated LTX-2.5 weights in its working directory; CUDA execution and local GPU VRAM requirements are not tested in the cited sources.[1][3] The film file itself is plain JSON, so you can write and validate the schema before loading any model.
The failure you are working around
As the Trainium3 write-up puts it, prompts alone do not keep a subject from one shot to the next, so shots have to start or end on frames of other shots.[1] If you anchor the subject's pixels at the boundary between shots, continuity becomes a conditioning problem rather than a wording problem.
The dacorvo/video-generation film format handles boundary conditioning with two keys:[1][3]
| Key | Points at | What it holds |
|---|---|---|
from | The last frame(s) of an earlier shot | The subject's look across a cut (frames: 1) |
from | The last 25 frames (1 s at 24 fps) of an earlier shot | The subject's look and its motion (frames: 25) |
from | An image file ({"image": "..."}) or the last frames of a 24 fps video ({"video": "...", "frames": 25}) | External starting frame or footage (image start was not tried in a full film in the blog)[1][3] |
to | The first frame(s) of a later shot | Keyframes so the current shot leads into that later shot |
A shot can use both from and to, along with optional seed, trim, and caption keys.[3]
The shot object
Each entry in the JSON array has a name and a prompt, plus optional seed, from, to, caption, and trim.[3] Shots reference each other by name rather than numeric index, which keeps unrelated references intact when you insert or delete shots — but array order still matters: generate.py rejects any from that points to a later shot (position < i) and any to that points to an earlier shot (i < position), exiting with an error.[3]
{
"name": "wedge",
"prompt": "Style: cinematic, realistic, warm tungsten light, shallow depth of field. ...",
"seed": 4,
"to": { "shot": "lift", "frames": 9 }
}
External media uses the same from key, with paths resolved relative to the JSON file:[3]
{ "name": "start_img", "prompt": "...", "from": { "image": "frame.png" } }
{ "name": "start_vid", "prompt": "...", "from": { "video": "start.mp4", "frames": 25 } }
The prompt is not a tag list. The blog notes that LTX-2.5 does better with long, detailed prompts, and the demo prompts follow a consistent single-paragraph structure: style and lens, subject and action, camera movement, lighting, and sound.[1]
seed belongs in the file because you will shoot multiple takes. Keeping the chosen seed per shot lets you reproduce the film later.[1][3]
Frame counts are not arbitrary
Every frames count in from or to must be one more than a multiple of 8 (frames % 8 == 1), because the video VAE encodes the frames after the first in groups of 8.[3] So 1, 9, 17, and 25 are legal; 10 and 24 fail validation. For to, the validator also caps frames at num_frames - 8 (generate.py:684).[3]
The frame count decides what carries across a cut:
- 1 frame — the earlier shot's last frame. Returns to the same subject's appearance after a cut.
- 25 frames — one second at 24 fps. Continues motion as well as appearance.
- 9 frames — the first 9 frames of a later shot, passed as target keyframes (
to) so the current shot bridges into it.
A single frame cannot convey speed. When starting from real footage via from: {"video": ...}, generate.py enforces exact 24 fps (rate != FPS exits with an error) so the conditioned frames do not show the model a distorted motion speed.[1][3]
Pose-to-pose ordering
Animation has two build orders, and the script supports both:[1][3]
Straight ahead generates each shot from the one before it. The authors built the fox film this way.[1]
Pose to pose builds the payoff shot first and hangs surrounding shots off its boundary frames. Earlier shots end on its first frames (to); later shots start from its last frames (from). generate.py topologically sorts the shot graph (generation_order) so every referenced shot renders before the shots that depend on it.[1][3]
The authors used pose-to-pose ordering for the seal film, starting from iceberg:[1]
iceberg— the payoff: the iceberg rolls over and drenches the seal. Generated first.nap— the seal asleep on the floe, ending on the first 9 frames oficeberg(to) so the seal, floe, and iceberg match going into the payoff.shake— starts from the last 25 frames oficeberg(from), shakes off the water, and flops onto the floe.dream— the sleeping seal on warm sand, generated on its own and joined by a cut.
The payoff is the only shot you have to nail before the neighbors exist. Once its seed works, surrounding shots inherit its pixels.
A complete film file
Here is an illustrative three-shot film in the dacorvo/video-generation schema, ordered narratively so wedge (0 < 1) points forward to lift and shelf (1 < 2) points back to lift. generate.py renders lift first, then wedge and shelf:[3]
[
{
"name": "wedge",
"prompt": "Style: cinematic, realistic, warm tungsten light, shallow depth of field. A potter in a canvas apron kneads a grey lump of clay on a wooden board beside the wheel, pressing the heel of each hand into it, folding and turning it. The camera sits at table height and pushes in slowly. Sound: clay thumping on wood, the wheel idling, distant rain on a window.",
"seed": 4,
"to": { "shot": "lift", "frames": 9 }
},
{
"name": "lift",
"prompt": "Style: cinematic, realistic, warm tungsten light, shallow depth of field. Close on a potter's hands at a spinning wheel as they draw a tall stoneware vase up out of wet clay; the wheel slows, the hands steady the rim, water runs down the clay. The camera holds a tight three-quarter angle. Sound: the wheel's low hum, wet clay squelching, a quiet studio room tone.",
"seed": 17
},
{
"name": "shelf",
"prompt": "Style: cinematic, realistic, warm tungsten light, shallow depth of field. The potter carries the finished vase across the studio and sets it on a drying shelf, then steps back; dust drifts in the window light. The camera tracks behind the shoulder and settles as the vase lands. Sound: footsteps on concrete, the shelf creaking, rain steady outside.",
"from": { "shot": "lift", "frames": 25 }
}
]
Two optional keys control pacing and overlays: trim cuts a shot to a start–end window in seconds (all shots otherwise render at the same length), and caption draws centered white text with a black outline from start to end in seconds.[3] Both values must fall within 0 to num_frames / 24:
{
"name": "goat",
"prompt": "Style: cinematic, realistic. A mountain goat picks its way along a narrow ledge, stops, and stares down the lens. Sound: wind over rock.",
"seed": 8,
"trim": { "start": 4.5, "end": 8.0 },
"caption": { "text": "SOLD", "start": 4.7, "end": 6.2 }
}
The authors' goat film uses both keys — two trimmed shots and a caption over its payoff.[1]
Running the file
The generation work is done by diffusers, not the film wrapper. dacorvo/video-generation's requirements.txt pins diffusers==0.43.0, which already includes the LTX-2.5 pipelines:[3]
pip install diffusers==0.43.0
Three diffusers pipelines share the weights:[1][3]
LTX2Pipeline— generates standalone shots from text prompts.LTX2ConditionPipeline— generates shots conditioned on boundary frames viaLTX2VideoCondition(frames=start, index=0)andLTX2VideoCondition(frames=end, index=keyframe_index(num_frames, len(end))).LTX2LatentUpsamplePipeline— upscales latents ×2 between the two stages of the distilled recipe.
Inside dacorvo/video-generation, generate.py orchestrates those pipelines, slices handoff frames, trims, draws captions, evens out quiet audio, and assembles the full clip:[3]
./setup.sh /data/video-gen-demo
./run.sh generate.py --two-stage film.json
./run.sh generate.py --two-stage film.json --seed 11 # default seed for shots without one
./run.sh generate.py --cpu film.json # reference output to compare against
--two-stage runs the distilled recipe: 8 steps at 1024×512 (DISTILLED_SIGMA_VALUES), the ×2 latent upsampler, then 3 steps at 2048×1024 (STAGE_2_DISTILLED_SIGMA_VALUES) (generate.py:527-545).[3] Each run writes one clip per shot plus a -full clip of the shots in order, named after the file, size, and shot.[3]
What the chaining does not fix
The film layer solves cross-shot visual continuity. It does not solve the underlying model's limits:
- Twenty seconds per shot. That is the model's ceiling, so longer sequences require more shots, not longer ones.[1]
- Sound does not carry across shots. Each shot generates its own audio. The script raises quiet backgrounds toward a common level and leaves loud sounds alone, without cross-shot audio continuity.[1][3]
- Details still drift, so shoot several takes. The authors' goat came out with funny horns in three takes out of four; they made four takes per new shot and kept the best
seed.[1] - Moving locations inside a single shot breaks continuity. In an early fox test, asking one shot to take the fox from the forest to the lake caused the model to cross-dissolve to a different fox.[1] Keep each shot in one location and use cuts to change scenes.
- One frame cannot imply speed. When motion matters, condition on 25 frames or a 24 fps video rather than a still.[1][3]
The timing numbers require context: the "22 to 23 seconds for a 10-second 2048×1024 clip with sound" figure was measured by the Hugging Face authors on Trainium3 hardware (trn3.48xlarge, 32 of 64 NeuronCores) provided through an AWS partnership, after the models were loaded.[1] Model loading takes about 3 minutes and the first clip about 80 seconds, so 22–23 seconds is a steady-state number for a warm service — not a local GPU benchmark.[1]
Reproducibility is stronger than usual: re-running the same code with the same film file and seeds reproduces the film byte for byte.[1]
What I verified
I did not run LTX-2.5 — no Trainium3 or suitable GPU here, and the model weights and card at Lightricks/LTX-2.5-Diffusers are gated (401 without HF auth). What I verified directly against dacorvo/video-generation (generate.py, README.md, requirements.txt) and the Hugging Face blog post:[1][3]
- Parsed all JSON blocks in this guide, checked
frames % 8 == 1, verifiedfrom/toarray-order rules (position < iforfrom,i < positionforto), and verifiedtrim/captionbounds againstgenerate.py:640-719. - Confirmed
diffusers==0.43.0inrequirements.txt,LTX2VideoConditionusage atgenerate.py:519-525, exact-24-fps video validation atgenerate.py:659, and CLI flags inREADME.md. - Example provenance: The three-shot potter film is an illustrative example written to the
dacorvo/video-generationschema (nocaptionkey used). Thegoatsnippet uses the README'strimrange (4.5–8.0) with an illustrative"SOLD"caption (the README example uses"GOOOAAAATTT"). The seal, fox, and goat outcomes come from the blog.[1] Generated video quality is unverified here.
For related mechanics, see the Multimodal Prompting guide for text-plus-image fundamentals, Gemini Video Processing for frame-sampling models, Prompt Chaining for text-side chaining, and the multimodal hub.
Sources
[1] https://huggingface.co/blog/video-trainium3 — Taking Trainium3 to the Track: Generating Videos with LTX-2.5
[2] https://huggingface.co/Lightricks/LTX-2.5-Diffusers — Lightricks/LTX-2.5-Diffusers (gated model card)
[3] https://github.com/dacorvo/video-generation — dacorvo/video-generation (README.md, generate.py, requirements.txt)
Related Articles & Guides
Stop Uploading the Whole PDF: Gemini File-Slicing Controls
Use Gemini's file slicing controls to upload a document once, then request exact page ranges, worksheet cells, and video windows from inside function responses. Includes parameter tables, a runnable skim-then-zoom example, and the token numbers Google's own pages disagree on.
Qwen Domain Applications: Multimodal, Coding & Vision
Explore domain-specific prompt engineering guides for Qwen models. Master native multimodal vision, document OCR, chart analysis, and video understanding.
Qwen Multimodal Prompting: Vision, Documents & Video
Master vision-native prompt engineering for Qwen3.8-Max and Qwen3.8-27B. Learn patterns for document OCR, chart analysis, UI-to-code, and video extraction.