Models in Motion

Tools

Short scripts that cut, walk and stack your takes. Each one is one page of Python you can read, change, or give to a chat to turn into a new tool.

How they run

  1. Put the takes of one shot in a folder of their own (same shot, same size, different seeds).
  2. Copy RUN.bat from the kit's tools folder into it, and one or more scripts from tools\scripts.
  3. Double-click RUN.bat. Every .py in the folder runs. Each one writes its result into a subfolder named after it, with a .txt that says how it was made.
  4. INDEX opens in the browser: every take and every result with its name, grouped by folder. Click to play, F for full screen, arrows for the next one.

To change a script, open it in Notepad. The settings are at the top, in CAPITALS. Change a number, save, RUN again.

The scripts

ScriptWhat it does
pulse_cut.py The first take plays. On every hit of a rhythm, frames from another take jump in. The rhythm is a line of x and .: x..x..x. is the tresillo. Write your own.
crab_walk.py One take, three frames forward and one back. Nothing is blended or swapped; only the order is invented. Best on water, smoke, leaves.
breathing_cut.py Cuts get denser where the picture moves and rest where it is still. Written by a chat that saw only the text below, pulse_cut.py, and one sentence. It ran the first time.

Download all the tools (80 KB)

Make a new one with a chat

  1. Open Claude or ChatGPT. Paste the box below.
  2. Then paste a script: open it on GitHub (links above), copy all of it.
  3. Then write your idea, in your own words, in any language.
  4. Save the answer into your folder of takes as something.py. In Notepad choose Save as type: All files, or it becomes something.py.txt.
  5. Double-click RUN.bat.
  6. If it stops with an error, copy the black window into the chat and say "fix it". Save, RUN again. You are the loop.
I edit AI-generated video with small Python scripts. Here is one that works.
Write me a NEW script with the same shape and a different idea (below).

The shape (keep it exactly):
- One file. Only these libraries: Python's standard library, numpy, cv2
  (OpenCV), PIL. Nothing to install.
- The script sits in a folder of video takes: several .mp4 files of the same
  shot, same size, 24 fps, about 6 seconds. It reads them from its own folder:
  HERE = Path(__file__).parent, takes = sorted(HERE.glob("*.mp4")).
- It writes its results into a new subfolder named after the script
  (HERE / Path(__file__).stem), as .mp4 with cv2.VideoWriter.
- Next to every video it writes a .txt with the same name: the settings and
  what it did, so anyone can see how it was made.
- The settings go at the top, in CAPITALS, with a comment each, so I can
  change them without reading the code.
- It prints what it is doing. Short and readable: I am not a programmer, and
  I want to understand it by reading it.

My idea:

Ideas, if you need one to start

The older tools

The kit also has tools that read a recipe from a text file. Copy the .bat into a folder of takes and double-click. tools\TOOLS.txt explains each one.

ASPEROCuts between the takes on named rhythms (fib, tresillo, son, euclid 5 16 ...). Jagged.
VELVETThe opposite: averages the takes. Sharp where they agree, mist where they disagree.
CRABForward and back on one take, from a recipe.
MELTRedraws every frame with a small diffusion model, feeding the last frame back in. Drag ONE video onto it: a whole folder takes a minute per video. Close ComfyUI first.
INDEXEvery video in a folder, with its name, on one page. Double-click it in any folder.
VIEWThe study page: your text flowing around the videos.