Instructions to use hkblockchaintechnology/video-model-harness with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use hkblockchaintechnology/video-model-harness with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image, export_to_video # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("hkblockchaintechnology/video-model-harness", dtype=torch.bfloat16, device_map="cuda") pipe.to("cuda") prompt = "A man with short gray hair plays a red electric guitar." image = load_image( "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/guitar-man.png" ) output = pipe(image=image, prompt=prompt).frames[0] export_to_video(output, "output.mp4") - Notebooks
- Google Colab
- Kaggle
π¬ Video Model Harness
A registry-driven marimo notebook for running open-weight text-to-video diffusion models locally on your own GPU.
Pick a model, write a prompt, set a duration, press Generate video. One
generate_video function drives LTX-Video, Wan and CogVideoX alike: it inspects
each pipeline's __call__ signature and forwards only the arguments that
pipeline actually accepts, so adding a checkpoint to the registry is enough to
support it.
Models in the registry
| Key | Checkpoint | Pipeline | Download |
|---|---|---|---|
ltx-video-0.9.5 |
Lightricks/LTX-Video-0.9.5 |
LTXPipeline / LTXImageToVideoPipeline |
~25.7 GB |
wan2.2-ti2v-5b |
Wan-AI/Wan2.2-TI2V-5B-Diffusers |
WanPipeline / WanImageToVideoPipeline |
~34.2 GB |
wan2.1-t2v-1.3b |
Wan-AI/Wan2.1-T2V-1.3B-Diffusers |
WanPipeline |
~28.9 GB |
cogvideox-2b |
THUDM/CogVideoX-2b |
CogVideoXPipeline |
~13.8 GB |
Two rendering paths
- Short clips β up to one chunk of
8k+1frames renders in a single diffusion pass. - Long clips β anything longer is rendered as a chain of chunks where each chunk is image-to-video conditioned on the previous chunk's final frame, then stitched into one continuous take. Presets with no I2V class fall back to text-only chunks, which still goes long-form but cuts between chunks.
Nothing in the harness asks a single diffusion pass to cover every frame of a half-minute render; that is what keeps long output coherent.
The lesson builder
build_lesson_video renders a narrated, captioned instructional video end to
end from a declarative LESSON config:
- each segment is generated as its own clip (so one segment can be re-shot without re-rendering the whole lesson);
- every frame is upscaled to 1280Γ720 and composited with a lesson card drawn using real fonts β diffusion models cannot spell, so every word a learner reads is drawn with PIL, not generated;
- narration is synthesized with
edge-ttsand padded per segment to that segment's exact video length, which keeps the voice locked to the captions it belongs to; - frames and audio are muxed to H.264/AAC with ffmpeg.
Running it
pip install marimo
marimo edit video_model_harness.py
The notebook carries its own inline PEP 723 dependency block, so uv-aware
runners install it automatically:
accelerate>=1.15.0, diffusers==0.42.1, edge-tts==7.3.1, ftfy>=6.3.1,
huggingface-hub>=0.34.0,<2, imageio-ffmpeg>=0.8.0, numpy==2.5.4,
pillow==13.0.0, sentencepiece>=0.2.2, torch>=2.11,<2.12
Hardware. A CUDA GPU is required in practice β the presets are 13.8β34.2 GB
of weights. The notebook reports the detected device, VRAM, dtype and library
versions at the top so you know what you are actually rendering on. Weights are
downloaded on first use and cached by huggingface_hub; a pipeline instance is
reused for the rest of the session (load_seconds is 0.0 on a cache hit).
Outputs
Every run writes an .mp4 plus a JSON sidecar recording the exact settings β
model, prompt, negative prompt, frames, fps, resolution, steps, guidance, seed,
render seconds and peak VRAM β to outputs/video/. The notebook shows the most
recent clip with autoplay and a table of the last 15 runs.
Field notes
Learned the hard way while building the lesson renderer, and kept in the code as comments:
- The 2B model renders rooms well and people badly. Wide shots of a colourful classroom with the speaker small in frame measured ~13Γ sharper and ~18Γ more saturated than a soft-lit close-up of a person, which came out a blown-out, colourless "ghost". Keep prompts wide, well-exposed and colourful.
- Never ask for "soft light" or "shallow depth of field"; under-specified prompts drift pale and desaturated.
grade_framepulls only clearly out-of-range frames back into range β brightness down if mean luminance exceeds 205, saturation up if mean saturation is under 0.35.
License
Not specified β the author should add a LICENSE file and a license field to
this card before others reuse it.
- Downloads last month
- -