Vapoursynth CMNet2DiT
CMNet2DiT colorizes black-and-white video without a colored reference: a large image model (DiT) running in a separate server colorizes reference frames at scene changes, and the exemplar model CMNET2 spreads their colors over all frames. It is part of HAVC (Hybrid Automatic Video Colorizer).
Filtering → Vapoursynth → Color → Coloring

What it does
- Scene changes are detected in the clip.
- The frames at the scene changes are sent in pairs to the DiT server (a quantized Qwen Image Edit model) and colorized there.
- CMNET2 keeps these reference frames in a sliding memory and propagates their colors to all other frames.
- The original lightness is put back, so the detail of the source is kept.
The first reference frames are colorized while the script is opened, before the first frame is shown.
Requirements
- Windows with an NVIDIA graphics card (CUDA) and Hybrid's torch add-on (package vshavc).
- A running HAVCServerDiT at the given IP and port (installer or install script from its GitHub page; started with HAVC.vbs, HAVC-Server.cmd or start_server.cmd). It needs an NVIDIA RTX 30/40/50 card with CUDA 13 or newer, about 16 GB VRAM and 64 GB RAM, and downloads its models on first use. Hybrid does not start it; without it the script fails when it is opened ("RPC server not reachable").
Settings
| Control | Parameter | Range / values | Hybrid default | Meaning |
|---|---|---|---|---|
| Speed | render_speed | auto, fast, medium, slow, slower | auto | Working size: fast 384 px, medium 512 px, slow 640 px (long side), slower original size. auto uses fast when width/height is below 1.6 (including 4:3), otherwise medium. |
| Vivid | render_vivid | on/off | off | Slightly stronger colors (+3° hue, ×1.15 saturation). |
| Frames | max_memory_frames | 1 – 500 | 20 | Size of the reference memory (rounded down to an even number, at least 2). More frames give more consistent colors but need more DiT calls before the first frame. |
| SC thresh | sc_thresh | 0 – 1 | 0.035 | Scene change threshold; lower values detect more cuts (useful range 0.01–0.15). |
| SC SSIM thresh | sc_tht_ssim | 0 – 1 | 0.80 | Drops reference frames that are too similar to already chosen ones; 0 disables it. |
| SC min int | sc_min_int | 1 – 100 | 25 | Minimum number of frames between two detected cuts. |
| SC offset | sc_tht_offset | 1 – 25 | 2 | Compares frame n with frame n − offset; helps with dissolves. |
| SC min freq | sc_min_freq | 0 – 1500 | 0 | Forces a reference frame at least every n frames; 0 = off. |
| IP / Port | dit_engine_params host/port | – / 1 – 65535 | 127.0.0.1 / 8765 | Address of the DiT server. |
| Precision | dit_engine_params model_precision | fp4, int4 | fp4 | Model variant on the server: fp4 for RTX 50-series, int4 for RTX 30/40-series. |
| Retry threshold | retry_threshold | 0 – 1 | 0 | When the reference coverage of a frame falls below this value, a new reference is made and the frame is colorized again; 0 = off. Can cost 40–50 % speed; suggested 0.20–0.35. |
| Retry model | retry_model | HAVC, DiT fp4, DiT int4 | DiT fp4 | Model used for the retries. Retries always contact the server at 127.0.0.1:8765 and use the model it has loaded; if it cannot be reached, HAVC (DeOldify + DDColor) is used. |
Example
Default settings with the DiT server on the same computer:
# colorize using CMNet with external DiT (HAVC)
clip = havc.HAVC_cmnet2dit(clip, dit_engine_params={"host": "127.0.0.1", "port": 8765, "model_precision": "fp4"})How Hybrid calls it
- The filter accepts any format: it converts to 8-bit RGB internally and returns the input format (keeping a high bit-depth luma copy for 10-bit and more). Width and height are made even.
- The server address and precision are always written; the other settings only when they differ from the defaults, Retry model only with a Retry threshold above 0.
- Quotes, backslashes and blanks are removed from the IP field.
- CMNet2DiT also offers the common options (Masked, ApplyOnlyTo, Merge, OnRegion, Gimmick).
Background
HAVC (HAVC_cmnet2dit)
HAVC by Dan64 combines several colorization models for video. HAVC_cmnet2dit uses the DiT server as reference colorizer and CMNET2 (run in its own helper process) for the propagation. On the same machine the images are exchanged through shared memory, with a remote server as PNG. If fewer than two reference frames are found, the script fails at start; lower SC thresh or raise SC min freq then.
Sources
- vs-havc README and its HAVC_cmnet2dit documentation
- HAVCServerDiT (the DiT server)
- Hybrid's tooltips