English · Türkçe · Platform: Windows 10/11 (x64) · GPUs: AMD Radeon (Vulkan), NVIDIA GeForce GTX/RTX (CUDA & Vulkan), Intel Arc (Vulkan)
Status / Known Limitations (Beta): Physically verified on AMD Radeon RX 5600 XT (6 GB VRAM) + 32 GB RAM (Windows 11). NVIDIA CUDA setup uses backend-agnostic
ggmlflags andsd.cppCUDA paths, but is community-tested only; currently Windows 10/11 x64 only. Open a GitHub Issue withpy scripts/probe_hardware.pyoutput if you hit any issue.
Run flagship 22B Audio+Video diffusion (
LTX-2.3 Distilled v1.1· T2V, I2V, FLF2V + 48 kHz Stereo Audio), fast 5-secondWan 2.2 TI2V-5B Turbo, &Z-Image-Turboon ordinary 4–6 GB VRAM consumer GPUs (AMD Vulkan & NVIDIA CUDA) — featuring an English-first Local Web Studio & CLI, 2-stage native x2 spatial latent upscaling, 4.3×–11.6× faster tiled Video VAE, Audio-Preserving Cinema HD (1280×768 @ 32fps), and a Multi-Clip Timeline Editor (xfade+ stereoacrossfade).
All low-VRAM streaming optimizations use backend-agnostic ggml_backend_* / stable-diffusion.cpp pipelines so both AMD (Vulkan) and NVIDIA (CUDA & Vulkan) users can run high-end video models on 4–6 GB cards:
| System Tier (VRAM + System RAM) | Compatible GPUs (AMD & NVIDIA) | Best Models | Notes |
|---|---|---|---|
| 4–6 GB VRAM + 16 GB RAM (Entry / Low-End) | GTX 1650/1660, RTX 2060/3050, RX 5500/5600 XT, Intel Arc | Wan 2.2 TI2V-5B Turbo (7.92 GiB) + Z-Image-Turbo (6.24 GiB) |
Fast 5-second clips (~3–6 min) + 22s first frames with low RAM footprint. |
| 6 GB VRAM + 32 GB RAM (Verified Sweet Spot) | RX 5600 XT 6 GB (Physically Verified), RTX 2060/3060 Laptop | LTX-2.3 22B Audio+Video (24.09 GiB) + Wan 2.2 14B |
Full 22B Audio+Video with 2-stage x2 upscaler & Audio-Preserving Cinema HD (1280×768 @ 32fps). |
| 8 GB+ VRAM + 32 GB RAM (Mid-Range) | RTX 3060/4060/4070, RX 6600/7600+ | All models (LTX-2.3 22B + Wan 2.2 + Z-Image) |
Higher VRAM headroom removes --max-vram throttling for even faster steps. |
- English-First Web Studio, Terminal Dashboard, Wizard & Setup (
v0.7.0):web_ui.py(<html lang="en">),ui_console.py,generate.py,postprocess.py,download_models.py,picovid.cmd, andsetup.ps1now default cleanly to English (while still accepting bothy/nande/hinteractive confirmation keys). - Web Studio Security Shield & LTX-2.3 Speed/Quality Tuning (
v0.6.0):- Strict
Host/Origin/Content-Type/X-PicoVid-TokenCSRF protection, strictOUTPUTS_DIR+ media-extension allowlist (is_relative_to()), SVG/HTML upload XSS block, Zip-Slip guard inpostprocess.py, and full process-tree cancel (taskkill /F /T /PID). - Background
start_file_prewarmfor LTX-2.3 DiT during Gemma-3 prompt encoding,--flash-attn offon Vulkan,--compression-quality 100before Cinema HD, BT.709 H.264 color tags, and zero-copyos.replace()frame sequencing.
- Strict
- LTX-2.3 22B Distilled v1.1 (Default
--engine ltx23): Generates razor-sharp cinematic video AND synchronized 48 kHz Stereo Audio in 8 distilled steps (DISTILLED_SIGMA_VALUES) on a 6 GB AMD RX 5600 XT (Vulkan, 32 GB RAM) via prebuiltstable-diffusion.cpp(master-1133-52491bd, zero C++ compilation needed!). - Empirically Tuned 6 GB VRAM Pipeline (
~2.1×Faster + Higher Sharpness, Zero Deadlocks):--max-vram -1.4 --disable-prefetch: Eliminates6.15 GiBWDDM Shared VRAM spill (1.51×faster DiT) while avoiding multi-segment async-prefetch deadlocks on49f–81f.--vae-tile-size 384x384 --vae-tile-overlap 0.15: Cuts Video VAE decode by4.3×–11.6×(110.1s → 25.7son 17f;149.3s → 12.8son 25f) at41.31 dB PSNR.- Auto 2-Stage Native x2 Spatial Latent Upscaler (
ltx-2.3-spatial-upscaler-x2-1.1.safetensors): Runs 8 base steps at half-res (320×192→640×384, or384×224→768×448) + 3 refine steps (STAGE_2_DISTILLED_SIGMA_VALUES), delivering1.41×–2.0×additional speedup AND noticeably sharper, more coherent object anatomy!
- Audio-Preserving Cinema HD (
postprocess.py): 2× Vulkan Real-ESRGAN (1280×768) + 32 fps optical-flow/RIFE interpolation now automatically detects and preserves LTX-2.3's 48 kHz Stereo AAC soundtrack. - Multi-Clip Video Timeline & Transitions (
web_ui.py&postprocess.build_timeline_video): Queue clips in the Web Studio (http://127.0.0.1:7860), reorder them, pickxfadetransitions (dissolve,fadeblack,wipeleft,smoothleft,circleopen,cut) with synchronized stereoacrossfade, and render one unified MP4.
Config (LTX-2.3 22B Distilled 1.1 Q4_K_M + Gemma-3-12B) |
Output | DiT Time | Video VAE | Audio VAE | Total | Notes |
|---|---|---|---|---|---|---|
Baseline (--max-vram 0, 256×256 tile) |
640×384 × 17f |
959.5 s |
110.1 s |
4.0 s |
1190.7 s |
6.95 GiB Shared spill |
Optimized (--max-vram -1.4, 384×384 tile) |
640×384 × 17f |
636.5 s (1.51×) |
25.7 s (4.28×) |
4.0 s |
775.7 s (1.54×) |
41.31 dB PSNR |
Safe Single-Stage (--max-vram -1.4 --disable-prefetch) |
640×384 × 25f |
766.6 s |
12.8 s |
3.9 s |
880.9 s |
Zero deadlock |
Auto 2-Stage Native x2 Upscaler (320×192 → 640×384) |
640×384 × 25f |
542.8 s (288s + 255s) |
12.5 s |
4.0 s |
699.6 s |
Fastest + sharpest anatomy |
| Full 5-Second Clip + Audio-Preserving Cinema HD | 1280×768 × 81→160f @ 32fps |
— | — | 24.4 s |
— | Verified across 5×5s Showreel (22.45s xfade MP4) |
# One-click Windows setup (downloads prebuilt LTX-2.3 Vulkan binary + Cinema HD + models, no VS needed!)
.\setup.cmd
# Launch PicoVid v0.5.0 Web Studio (LTX-2.3 T2V/I2V/Studio + Multi-Clip Timeline Editor)
.\web-studio.cmd
# CLI: 5-second LTX-2.3 Audio+Video with Auto 2-Stage x2 Upscaler + Audio-Preserving Cinema HD (1280x768 @ 32fps)
py scripts/generate.py --engine ltx23 --mode t2v --cinema-hd -p "Two F-16 fighter jets flying over the illuminated Istanbul Bosphorus Bridge at dusk, roaring jet afterburners" -W 640 -H 384 -f 81 --fps 16 -o istanbul_f16_hd32.mp4
Generated locally on an AMD Radeon RX 5600 XT (6 GB VRAM, Vulkan, Windows 11) — 640×384, 33 frames (2.1s), 4 steps (wan2.2-t2v-rapid-aio-v10-Q4_K), real Wan 2.1 VAE, ~8.5 min end-to-end.
Frame 12 (17f, 4.5 min total) |
Frame 32 (33f, Q_CHUNK=2048) |
|---|---|
![]() |
![]() |
Stock leejet/stable-diffusion.cpp is an incredible C++ inference engine, but running a heavy 14B video model (Wan 2.2) on a 4–6 GB consumer GPU hits 5 immediate walls:
- WDDM Shared Memory Thrashing (2.75–4.03 GiB PCIe Spill): Un-evicted transformer blocks (
40 × 219 MB = 8.75 GB) silently spill over PCIe into System RAM, slowing compute down by ~3–10×. - Windows 2-Second TDR Crashes (
vk::Queue::submit: ErrorDeviceLost): At640×384, a single unsplit Wan block takes >6 seconds on RDNA 1 Vulkan Flash Attention, triggering an instant GPU driver reset onblocks.0. - Vulkan
maxMemoryAllocationSize = 2.0 GiBWall: Long clips (49f–81f) and Wan 2.1 VAE 3Dim2colbuffers exceed 2 GiB single-allocation limits. - Over-Strict
conv2d/conv3d directAuto-Probe: On RDNA 1 Vulkan, harmless0.0037FP16 accumulation rounding (non_finite = 0) fails the0.001probe tolerance, disabling direct 3D convolution and inflating Wan 2.1 VAE memory to 6.97–8.53 GB. - In-Process VAE OOM & Separate-Process Normalization Trap: Decoding inside the DiT process fragments VRAM, while saving raw DiT latents via
--taesdwithoutdit_to_vae_latentscauses cross-hatch artifacts in Wan 2.1 VAE.
PicoVid solves all five via 9 modular, default-OFF, 100% backend-agnostic (ggml_backend_*) patches that work across both Vulkan and CUDA.
Note: Idle desktop VRAM baseline on the test machine was 2,914 MiB Dedicated / 473 MiB Shared — net sd-cli deltas (Δ) are shown alongside total GPU usage.
| Resolution × Frames | Configuration | Self-Attn / Block (40 heads) | DiT 1-Step Time | Speedup | DiT Compute Buffer | Net Dedicated VRAM (Δ) |
Status |
|---|---|---|---|---|---|---|---|
480×320 × 17f |
Stock sd.cpp (--max-vram 3.8, FA on) |
— | 356.10 s |
1.00× |
345.2 MB |
+1,563 MiB (+2,281 Shared!) |
VAE OOM fallback |
480×320 × 17f |
P1 (mv=1.5, evict_on_end, FA on) |
— | 137.73 s |
2.59× |
345.2 MB |
+1,333 MiB |
OK |
480×320 × 17f |
localVid P1+P2 (HEAD_CHUNK=4, FA off) |
78.0 ms |
38.36 s |
9.28× |
381.6 MB |
+1,518 MiB |
OK |
640×384 × 17f |
Stock sd.cpp / P1 (FA on) |
(TDR reset) | CRASH (23 s) |
— | 547.3 MB |
— | ErrorDeviceLost |
640×384 × 17f |
P2 (HEAD_CHUNK=8, FA on) |
6,265.0 ms |
296.50 s |
1.00× |
375.0 MB |
+1,300 MiB |
TDR Fixed |
640×384 × 17f |
localVid P1+P2 (HEAD_CHUNK=4, FA off) |
168.0 ms (37.3×) |
56.60–58.70 s |
5.05× |
592.5 MB |
+1,187–1,507 MiB |
OK |
Frames (@16fps) |
Tokens (N) |
Profile | DiT (1 Step) | DiT Compute Buffer | Separate-Process Wan 2.1 VAE (conv_direct=on) |
Net DiT Dedicated (Δ) |
Status |
|---|---|---|---|---|---|---|---|
17f (1.1s) |
4,800 |
Fast (q=off, mv=1.5) |
56.60 s |
592.5 MB |
34.63 s (1,441 MB) |
+1,187 MiB |
OK |
33f (2.1s) |
8,640 |
Fast (q=2048, mv=2.0) |
114.51 s |
675.0 MB |
64.78 s (1,617 MB) |
+1,656 MiB |
OK |
49f (3.1s) |
12,480 |
Fast (q=1024, mv=2.5) |
195.97 s |
1,500.5 MB |
131.94 s (1,617–1,922 MB) |
+1,834 MiB |
OK |
81f (5.1s) |
20,160 |
Fit (QKV_SPLIT=1, CUT_HOST=32, q=1024, mv=2.5) |
728.03 s |
1,890.0 MB (< 2 GiB) |
230.16 s (1,617–1,922 MB) |
+2,110 MiB |
OK |
Pipeline (640×384) |
First Frame (T2I) | I2V vae_encode |
TE (CPU) | DiT (4 Steps) | Wan 2.1 VAE (conv_direct=on) |
Total End-to-End |
|---|---|---|---|---|---|---|
T2V — 17 frames (1.1s) (Rapid-AIO v10 Q4_K) |
— | — | 22.2 s |
209.4 s |
34.6 s |
~4.5 min |
T2V — 33 frames (2.1s) (Rapid-AIO v10 Q4_K) |
— | — | 13.4 s |
444.1 s |
64.8 s |
~8.7 min |
v0.2 Studio Mode (T2I → I2V 17f) (Z-Image-Turbo + Wan 2.2 I2V LightX2V MoE Q4_K_M, GPU-tiled vae_encode) |
21.9 s (832×480: 32.1 s) |
19.3 s (11.2× faster than 216s CPU) |
18.2 s |
234.5 s (2 High + 2 Low) |
35.7 s |
~5.6 min |
v0.3 Cinema HD (--cinema-hd, 640×384×17f → 1280×768 HD @ 32fps) |
21.9 s |
19.3 s |
18.2 s |
~195–210 s (Phase A: HEAD_CHUNK=8, clear() prefetch, NVMe pre-warm) |
35.7 s + 49.7 s (x4plus 2× HD + 32fps AOBMC) (or ~8 s w/ animevideov3) |
~5.5 min (1280×768 @ 32fps) |
v0.3 Fast 5-Second (--engine 5b, Wan 2.2 TI2V-5B Turbo, 640×384 × 81f @ 16→32fps = 5.0s!) |
(opt. 21.9 s) |
1.3 s (single-frame frozen I2V!) |
13.1 s |
74.2 s (18.5 s/step, 80.4% GPU eff.) |
167.8 s (Wan 2.2 VAE 224×224, 6 tiles) + 30.1 s (1280×768 @ 32fps) |
~4.8 min (1280×768 @ 32fps!) |
v0.3 Photoreal 5-Second (--engine 5b, native 832×480 × 81f @ 16→32fps, beta scheduler) |
(opt. 32.1 s) |
2.1 s |
13.4 s |
140.0 s (35.0 s/step) |
334.9 s (12 tiles → 8 tiles w/ 224×256!) + 11.3 s (32fps AOBMC) |
~8.4 min (832×480 @ 32fps, DSLR-sharp) |
v0.3 Fast 5-Second (--engine 5b, 640×384 × 121f @ 24fps native = 5.04s) |
(opt. 21.9 s) |
1.3 s |
15.6 s |
124.1 s (30.2 s/step, PeakDed 4,346 MiB) |
352.5 s (Wan 2.2 VAE 192×192) / 1.9 s (--fast-preview taew2_2) |
~2.4 min (TAEW) · ~7.9 min (Full VAE) |
832×480 × 33f Native 14B I2V (Phase A Shared=0) |
— | — | — | 232.7 s/step (was 613.2 s/step w/ 2.18 GiB Shared spill → 2.64× faster) |
— | ~15.5 min (down from ~45 min) |
Base: leejet/stable-diffusion.cpp @ 3b12781 · leejet/ggml @ eeda9ec
All patches are default OFF (enabled strictly via environment variables) and use backend-agnostic ggml_backend_* APIs:
| Patch | Env Flags | What It Solves |
|---|---|---|
00-diag-conv-probe.patch |
SD_PROBE_DIAG=1 |
Logs max_abs_diff & non_finite on probe mismatch |
01-p1-model-loader-sleep.patch |
SD_LOADER_FAST_POLL=1 |
Splits 200 ms loader polling sleep into 5 ms (-8s across 40 blocks) |
02-p1-evict-and-drop-queued.patch |
SD_EVICT_ON_END, SD_EVICT_PAST, SD_DROP_QUEUED |
Evicts finished block weights immediately to stop WDDM Shared spill |
03-p1-staging-pool-and-capacity-log.patch |
SD_STAGING_POOL_MB, SD_VRAM_MARGIN_MB, SD_CAPACITY_LOG |
Reuses device staging buffers across blocks (0.09–0.12s per 219 MB block) |
04-p2-seg-timing.patch |
SD_SEG_TIMING=1|2 |
Per-segment ms timing breakdown |
05-p2-wan-split-and-chunk.patch |
SD_WAN_SPLIT_BLOCK, SD_WAN_QKV_SPLIT, SD_WAN_ATTN_HEAD_CHUNK/CUT, SD_WAN_ATTN_Q_CHUNK, SD_WAN_CROSS_Q_CHUNK, SD_WAN_MLP_CHUNK_MB |
Disjoint sub-block graph cuts + head/Q/cross-attn/MLP chunking (eliminates 2s TDR, enables 37× faster normal attention & 81f under 2 GiB) |
06-p2-cut-cache-host.patch |
SD_CUT_CACHE_HOST_MB |
Disables bind_outputs for large cuts and parks them in Host RAM |
07-p3-conv-direct-tol.patch |
SD_CONV_DIRECT_TOL |
Relaxes FP16 rounding tolerance (0.005) so Vulkan conv2d/conv3d direct turns ON (1.8× faster VAE) |
08-p3-separate-process-vae.patch |
SD_VIDEO_LATENT_SAVE[_ONLY], SD_VIDEO_LATENT_LOAD, SD_VIDEO_LATENT_DIT_TO_VAE |
Bit-exact float32 latent handoff + optional dit_to_vae_latents normalization for clean two-process VAE decode |
# Automatically installs missing Git / Python / VS 2022 C++ Tools / CUDA or Vulkan SDK,
# clones & patches stable-diffusion.cpp, compiles sd-cli.exe, and downloads recommended models!
.\setup.cmd# Clone pinned base
git clone --depth 1 --recurse-submodules --shallow-submodules https://github.com/leejet/stable-diffusion.cpp.git third_party/stable-diffusion.cpp
git -C third_party/stable-diffusion.cpp checkout 3b12781
# Apply all 9 localVid patches
powershell -ExecutionPolicy Bypass -File scripts/apply_patches.ps1
# Build (Vulkan for AMD/Intel/NVIDIA, or -Backend cuda for NVIDIA CUDA)
powershell -ExecutionPolicy Bypass -File scripts/build.ps1 -Backend vulkan
# powershell -ExecutionPolicy Bypass -File scripts/build.ps1 -Backend cudaPrerequisites: Visual Studio 2022 (MSVC + CMake + Ninja), Python 3.10+ (py -m pip install -r requirements.txt), and Vulkan SDK (or CUDA Toolkit for -Backend cuda).
# Interactive hardware-aware wizard (reads GPU VRAM, System RAM & free disk and marks ★ Recommended)
py scripts/download_models.py
# Or direct profile download:
py scripts/download_models.py --profile t2v --with-taehv # Starter T2V (~12.6 GiB)
py scripts/download_models.py --profile studio # Studio T2I + I2V Q4_K_M (~27.9 GiB)
py scripts/download_models.py --profile studio-compact # Studio Compact Q3_K_M (~23.3 GiB)# Local Web Studio UI (zero extra deps — opens http://127.0.0.1:7860 with live VRAM bars, Studio T2I->I2V loop, gallery & +5s Extend)
.\web-studio.cmd
# or: .\picovid.cmd --web
# Interactive terminal wizard (5s/10s/15s presets, T2V / I2V / Studio Mode)
.\picovid.cmd
# Fast 5-Second Video (Wan 2.2 TI2V-5B Turbo: 81f @ 16->32fps = 5.0s, ~4.8 min!)
py scripts/generate.py --engine 5b --mode studio --cinema-hd -p "A cinematic wide shot of the Bosphorus at golden hour, historic ferry gliding across sparkling water, 35mm film" -W 640 -H 384 -f 81 --fps 16 -o bosphorus_5sec_hd32.mp4
# Continuous 10-Second Multi-Segment Video (--segments 2 + per-segment director prompts + Lab color anchoring)
py scripts/generate.py --engine 5b --mode studio --segments 2 -f 81 --fps 16 --cinema-hd --segment-prompts "Historic ferry gliding across the golden Bosphorus | Sweeping aerial pull-back over Istanbul skyline, seagulls soaring" -W 640 -H 384 -o bosphorus_10sec_32fps.mp4
# Extend ANY existing MP4 seamlessly from its last frame (+5s continuation)
py scripts/generate.py --engine 5b --extend-video bosphorus_5sec_hd32.mp4 -p "Camera rises smoothly into an aerial view at sunset" -W 640 -H 384 -f 81 --cinema-hd -o bosphorus_extended_10sec.mp4
# Studio Mode + Cinema HD (14B quality, 640x384 -> 1280x768 HD @ 32fps H.264 CRF 15 in ~5.5 min)
py scripts/generate.py --mode studio --cinema-hd -p "A cinematic wide shot of the Bosphorus at golden hour, historic ferry gliding across sparkling water, 35mm film" -W 640 -H 384 -f 17 -o bosphorus_hd32.mp4
# Standalone post-process (2x Vulkan Real-ESRGAN + 2x 32fps optical flow on any existing clip)
py scripts/postprocess.py -i bosphorus_studio.mp4 -o bosphorus_hd32.mp4 --upscale 2 --rife 2
# Direct Image-to-Video (Wan 2.2 I2V LightX2V MoE)
py scripts/generate.py --mode i2v -i my_image.png -p "Slow cinematic camera pan, gentle natural motion" -W 832 -H 480 -f 17 -o animated.mp4
# Text-to-Video (Wan 2.2 T2V Rapid-AIO v10)
py scripts/generate.py -p "A cinematic tracking shot of a vintage red sports car driving down a rain-slicked neon-lit city street at sunset" -W 640 -H 384 -f 33 -o output_33f.mp4
# Quick 5s live dashboard self-test / hardware dry-run
py scripts/generate.py --ui-demo
py scripts/generate.py --mode studio -p "test" -W 832 -H 480 -f 33 --dry-run| Hardware / Platform | Backend | Status | Notes |
|---|---|---|---|
| AMD Radeon RX 5600 XT (6 GB, RDNA 1), Windows 11, 32 GB RAM | Vulkan | Physically Verified | All benchmarks (17f–81f, 4-step MP4s, 9.28× speedup, 1.30–2.11 GiB net VRAM) measured on this GPU. |
| AMD / Intel 4–8 GB GPUs (Windows / Linux) | Vulkan | Architecture-Ready (Community Test Welcome) | Uses pure ggml-vulkan + probe_hardware.py heap budget detection. |
| NVIDIA 4–8 GB GPUs (GTX 1050 Ti / RTX 2060 / 3050 / 3060 / 4060) | CUDA | Architecture-Ready (Community Test Welcome) | All 9 patches use backend-agnostic ggml_backend_* APIs; generate.py auto-selects CUDA profiles (--simulate-profile cuda-4gb verified). |
Note: System RAM requirement is 16 GB for Wan 2.2 TI2V-5B / Z-Image-Turbo and 24–32 GB for LTX-2.3 22B + Gemma-3-12B or Wan 2.2 14B long clips.
- PicoVid source code, scripts, Web Studio, and patches are licensed under the Apache License, Version 2.0.
- Downloaded model weights & optional tools are NOT bundled in this repository and remain subject to their respective upstream licenses (listed per file in
configs/models_registry.json):Wan 2.2&Z-Image-Turbo&Qwen3-4B: Apache-2.0LTX-2.3 22B Distilled: LTX Community License (Lightricks)Gemma 3 12B: Gemma Terms of Use (Google)TAEHV&rife-ncnn-vulkan: MIT ·realesrgan-ncnn-vulkan: BSD-3-Clause
- Built on top of
leejet/stable-diffusion.cppandggml. - Memory optimization research inspired in part by
alexturkey/VideoTurko's low-VRAM patch methodology.






