mvdirector (CLI command mvd) is a command-line application and Python library. It takes a song, as a single track, DAW stems or a Suno export, plus lyrics and a style brief, and produces a lip-synced, narrative or visual music video, or a long-form continuous mix. SongFilm is built on top of it.
The shape of the system
The orchestrator runs locally and never renders an image or a frame of video itself. It sends jobs to ComfyUI over HTTP, calls a language model for text direction and vision judgments, and uses ffmpeg to slice audio and assemble the final cut. Everything it needs to resume work is written to the project folder.
mvdorchestratorPlanning, state, quality gates, assembly- ffmpeg / ffprobeAudio slicing, frame extraction, final mux
- Project folderanalysis.json · manifest.json · assets/
- Review UIReads and writes the same manifest
Runs your bound workflows with any image or video model. Reached over /prompt, /view and /upload.
Ollama, OpenAI-compatible, Claude, OpenAI or Gemini: direction, vision checks and prompt rewrites.
The orchestrator reaches each outside service through a small interface (LLMClient, FaceAnalyzer, MouthTracker, ComfyClient with an injectable transport). That is also how the tests swap them for fakes.
The language model is optional. With llm.enabled: false, planning falls back to deterministic rules and the vision checks and prompt rewrites switch off. ComfyUI is the only required remote dependency, and it can be on the same machine, on another computer on your network, or on a cloud GPU.
Four decisions that shape everything
- 1
State lives in two JSON files
analysis.jsonholds what was measured from the audio.manifest.jsonholds the visual bible, reference sheets, set plates, shot list and every generation attempt. Commands read them, do one job and write them back atomically. - 2
Timing comes from code, creative choices from the model
Cut points, shot lengths, shot types and frame counts are computed from the beat grid and the vocal stem. The model picks framing, sets, wardrobe and prompts; code enforces the rules it must not break.
- 3
Preflight assets are locked before generation
Character reference sheets (one per wardrobe state) and empty set plates are generated and locked first.
mvd stillsandmvd runrefuse to start while a locked asset the selected shots need is missing. - 4
Every generated asset passes a quality gate
Stills and clips are scored automatically. A still must pass before any GPU time is spent animating it. A person reviews only what the review mode selects.
Stage by stage
- 01
mvd analyzeMeasure the audio→ analysis.json - 02
mvd planShot list and visual bible→ manifest.json - 03
mvd reference · platesLock identity and places→ assets/reference · plates - 04
mvd stillsGated by QC→ assets/stills - 05
mvd videosOnly from passed stills→ assets/videos - 06
mvd reviewApprove, redo, add notes→ manifest.json - 07
mvd assembleFrame-exact final cut→ output/<title>.mp4
Each stage reads the state files, does one job and writes them back atomically. Any stage can be re-run.
| Stage | Command | Writes | Notes |
|---|---|---|---|
| Analyze | mvd analyze | analysis.json | Beats, bars, vocal windows, lyric timing. No network access. |
| Plan | mvd plan | manifest.json | Calls the LLM under a run lock. Will not overwrite an existing manifest without --overwrite. |
| Reference and plates | mvd reference …, mvd plates … | assets/reference, assets/plates | Generate candidates, then lock one. Locking records it in the manifest. |
| Stills | mvd stills | assets/stills | Singer stills are edits of the locked sheet; b-roll comes from text-to-image. |
| Videos | mvd videos | assets/videos | Only for stills that passed QC or were approved by a person. |
| Review | mvd review | manifest.json | Approve, redo the video, or redo the still and video. Notes become direction for the next attempt. |
| Assemble | mvd assemble | output/<title>.mp4 | Trims clips to frame-exact length and lays the original mix over them. |
Resumable by construction
- Manifest writes go to a temporary file in the same folder and are renamed over the target, so a crash never leaves a half-written file.
- State is saved after every attempt, so a run can be interrupted at any point and picked up again.
- One writer at a time. Planning and generation hold
.run.lock; if a local process died and left the lock behind, the stale PID is detected and the lock cleared. - Every attempt is kept on disk and recorded with its seed, prompt, parameters and QC report, so any result can be reproduced or audited.
- Both state files are versioned and have exported JSON Schemas; tests fail if the schemas or the filled-in examples drift from the models.
Frequently asked questions
- Can I pause or re-run a single stage without regenerating the whole music video?
- Yes. Every stage reads analysis.json and manifest.json, performs one job, and writes state back atomically. You can re-run a single shot or stage and assemble again without losing approved assets.
- Does SongFilm lock me into one video model?
- No. Both mvdirector and SongFilm separate pipeline orchestration from ComfyUI workflow graphs, so swapping image or video models only requires binding a new workflow file.
- What does the review UI edit?
- The review UI reads and writes the exact same manifest.json used by the CLI and assembly stage, so approvals, rejections, and director notes stay in sync with every shot.