Local AI Media Pipeline

Table of contents
- Local-First AI & Linux Integration
- Staged Pipeline Architecture & VRAM Conservation
- Hybrid Open-Source Post-Production
Local-First AI & Linux Integration
As part of our R&D work at Z-Ray Entertainment, we explore how modern generative models for image, video, and audio synthesis can be integrated locally, privately, and reproducibly into traditional open-source production workflows on Linux. If you experiment with local AI models yourself, you are probably familiar with the usual hurdles around memory usage and reproducibility.
Generative models are inherently non-deterministic: achieving a specific composition, coherent motion, or fitting audio arrangement typically requires multiple iterations. On commercial cloud platforms hosted in large-scale hyperscaler data centers, every trial consumes paid tokens or credits. This turns technical and creative iteration into a costly, unpredictable gamble where budgets can be exhausted before a satisfactory output is reached.
Added to this are broader, objective concerns regarding the centralization of compute in hyperscale AI data centers, their substantial resource footprint, and limited transparency into underlying models. Running the entire stack with a local-first approach on self-hosted Linux hardware removes per-generation token pricing altogether: experimentation is constrained only by local compute time, seeds and node graphs remain reproducible, and the workflow stays independent of external APIs.
Staged Pipeline Architecture & VRAM Conservation
Because modern open-weights models span everything from compact 4B editing checkpoints to 22B video transformers, they cannot all stay resident in memory at once. Our architecture separates synthesis into distinct stages so individual phases never compete for VRAM or system RAM:
Still Synthesis: KREA-2 & FLUX.2 [klein] 4B
As our base generator, we use a modified KREA-2 model (based on the 12B diffusion transformer paired with a Qwen3-VL text encoder, released with open weights in RAW and faster Turbo variants), orchestrated in InvokeAI. To steer characters in the right direction from the start and reduce manual cleanup later, we rely on Character Anchor Prompts for both portraits and full-body shots. Here, KREA-2 excels at handling sub-prompts enclosed in square brackets ([...]), allowing specific details to be anchored alongside surrounding prompt context without diluting the main prompt.
For targeted refinement and keeping faces consistent across scenes, we then switch to inpainting with FLUX.2 [klein] 4B (Black Forest Labs, Apache 2.0 license). Distilled down to roughly 4 inference steps, this compact 4B model unifies generation and native masked editing in a single architecture and excels at extracting details from a reference image, rather than hoping KREA-2 will happen to generate a "similar" character from the same prompt.
Video Synthesis: LTX 2.5 & MiniMax H3
For animated video sequences, we combine LTX 2.5 (Lightricks' 22B diffusion transformer for joint audio-visual and multishot generation) and MiniMax H3 (an omni-modal open-weights model with native 32 kHz stereo audio and dedicated fl2va and ref2va variants for text-, image-, and reference-to-video) in node-based ComfyUI workflows with dynamic VRAM offloading on local hardware.
We use LTX 2.5 specifically for faster iterations and simpler shots. However, when driven by text prompts alone, LTX 2.5 can be a bit too "creative" with camera movement (intent drift / overshooting): even shots intended to stay static can pick up subtle camera drift, or a gentle push-in can turn into a stronger zoom unless constrained with explicit target end-states, camera LoRAs, or motion-track controls.
For more demanding shots, consistent scene transitions, and longer sequences spanning multiple clips, we therefore rely on ComfyUI MiniMax H3 Context Loop: while this extensive loop can easily take up to 30 minutes for an 8-second clip on local hardware, it delivers noticeably better and more consistent results. Each scene runs one at a time through the same reusable sampling graph while carrying visual motion and audio continuity forward to the next clip. Accepted takes are saved as checkpoints to disk, allowing individual scenes to be reviewed, retried via a Review Gate, resumed after an interruption, and assembled or upscaled in a deferred pass.
For lip-sync, we extract the vocals and feed the precisely sliced audio track of the protagonist's voice directly into the Context Loop, rather than just putting the dialogue text into the prompt and "hoping" the model happens to match the pauses and stops of the audio track. This produces consistent lip movements aligned with actual emphasis, cadence, and pauses, saving manual re-timing and out-of-sync lip-sync fixes later in editing.
Audio Synthesis: ACE-Step 1.5
For local music and audio generation, we use ACE-Step 1.5, an open-source hybrid music foundation model (combining an LM planner with a latent diffusion transformer for 48 kHz stereo output) that runs comfortably on consumer hardware and supports text-to-music as well as repainting, stem separation, and multi-track layering.
By decoupling each stage, parameters, seeds, and node graphs remain cleanly reproducible per step, allowing individual sequences to be refined without re-running the entire chain.
Hybrid Open-Source Post-Production
Generative building blocks do not replace structured editing. All generated image, video, and audio assets flow into a traditional open-source post-production workflow on Linux: in Kdenlive, we handle pacing, non-linear editing, audio mixing, and color finishing. This bridges classic Linux media production with modern, locally hosted AI synthesis: transparent, maintainable, and fully under our own control.