From-scratch 33MB C++/CUDA SDXL engine runs 1024×1024 on a 4GB GPU where A1111 OOMs

checkthisout1123 · reddit · 2026-12-07

Tired of A1111 OOMing on a 4GB RTX 3050 with a 6.94GB SDXL 1.0 checkpoint, a Redditor wrote BetterDiffusion from scratch: pure C++20 + CUDA, no Python/PyTorch/cuBLAS/cuDNN, with GGUF/Safetensors loaders, tokenizers, PNG encoder, and web UI compiled into one 33MB binary (MIT, repo).

RTX 3050 4GB Laptop benchmarks (20 steps, CFG 7.0, Euler):

The trick is a 3-stage pipeline: encode prompt to host RAM, wipe 100% of VRAM, UNet/DiT denoising, then 512×512 overlapping tiled VAE decode under 600MB peak.

Original post →

More from Infra

Infra channel →