Re-generating and iterating

The intended way to make a video is a loop: write the script, run it, watch the result, change the script, run it again. The library makes that loop cheap by regenerating only what changed. This page is about steering it: getting a different result on purpose, changing one thing without touching the rest, and knowing what each change costs.

Why re-running is cheap

Every generated file is named after a hash of the inputs that produced it: the prompt, the style, the model, the references, the take. When a script runs, each stage computes those hashes, finds the files that already exist, and generates only the missing ones. Nothing is ever generated twice, and nothing is ever regenerated because something else changed.

Two consequences worth internalizing:

  • Undo is free. Change a prompt back and the old file is still there.
  • Order does not matter. Position in a list is not part of any hash. Reorder scenes, insert one in the middle, delete one: the others are untouched.

take: a different roll of the dice

Generation is random. The same prompt gives a different picture every time, and sometimes the third attempt is the one. take asks for another attempt at exactly the same inputs:

ImageAssetBuilder(prompt="...", take=2)

Each take is its own file, so going back to take=1 is instant. take exists on everything that generates:

OnRe-rolls
ImageAssetBuilderThe image.
VideoAssetBuilderThe keyframe and the clip.
.edit(..., take=2)Just that edit step.
ImageSceneBuilder / VideoSceneBuilderThe authored prompts for that one scene.
a ReferenceIts image, and therefore every image that mentions it.
create_voiceover / create_sttThe recording or transcript.

A scene's take and its asset's take are separate knobs: re-authoring a prompt and re-rolling an image are different decisions.

Editing instead of re-rolling

When an image is close, an edit is cheaper and more predictable than a new take:

ImageAssetBuilder(prompt="...").edit("make the sky stormier")

The edit is generated on top of the existing image, and cached on it, so the base is never regenerated. Delete the .edit() line to go back. See Image Generation.

name: labels that cost nothing

name labels the files in the assets folder so you can find them: thales-shore_3f9a1c2b7d4e_1.png rather than 3f9a1c2b7d4e_1.png. It is not part of the hash. Renaming something renames its files; it never regenerates them.

What a change costs

You wantChangeCost
A different picture for one sceneits directionone prompt-writing call, one image
Exactly this prompt, no writerImageSceneBuilder(prompt="...")one image
The same prompt, another attempttake=2 on the assetone image
Keep the image, fix one thing.edit("...")one edit
Undo an editdelete the .edit() linenothing
Re-author one scene's promptstake=2 on the sceneone prompt-writing call
A different look for a charactertake=2 on the referenceone reference plus every image mentioning it
Rename anythingname="..."nothing
Reorder, insert or delete scenesedit the listonly the new scenes
A different art style, model or sizeAssetsBuilder(direction=..., model=...)every image
Different narrationthe script textone recording; images unaffected
Timing, captions, music, look, motionthe VideoBuilder callsonly the render

Knowing what you have

After each stage builds, the project writes storyboard.json next to the assets. It lists every scene with its authored prompts, the voiceover with its length and voice, every reference, and every asset with its file, its prompt, its edits and whether it was generated or came from the cache. When you wonder what scene 4 currently is, or which file a picture came from, this is the file to read.

Forcing a regeneration

There is no "ignore the cache" switch, on purpose: it would make results depend on how the script was run rather than on what it says. To regenerate, change an input, bump take, or delete the file from the assets folder.

A working rhythm

  1. Get the structure right first with cheap settings: images only, "720p" clips, no edits. Watch the whole video.
  2. Fix the scenes that are wrong, one at a time: a direction change here, a take=2 there, an edit where a picture is nearly right.
  3. Only then turn on the expensive things: "1080p", clips with sound, the long clips.
  4. Keep the script. It is the video; the assets folder is just its cache.