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):
- SD 1.5 512×512 cold: 6.57s with TeaCache (9.61s exact) vs 13.88s ComfyUI vs 25.27s A1111
- SDXL 1.0 Base 1024×1024 cold: 45.52s with TeaCache vs 68.73s ComfyUI vs OOM on A1111
- Idle VRAM after unload: 4 MiB vs 3,146 MiB on ComfyUI
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.
More from Infra
- PyNNDescent 0.8 and RINND 0.5 top VIBE benchmark: fastest search at 95% recall on all 11 datasets — leland_mcinnes · 2026-12-07
- Congress probes Nvidia's undisclosed Megaspeed sales — disclosure could expose China chip export violations — GaryMarcus · 2026-12-07
- Future major outages will be blamed on AI hackers but caused by PQC upgrades, predicts mattjay — whurley · 2026-12-07
- 3-bit beats 4-bit on 4 of 6 tasks: Qwen4-35B-A3B quant tests reveal non-linear MoE degradation — SmokeAI · 2026-12-07
- Gemini preview API now preserves prompt cache when instructions or tools change mid-session — petrusenko_max · 2026-12-07
- Blender 5.3 renders in a browser tab on local GPU via WebGPU — tobowers · 2026-12-07