33x Speedup with RTX 4070 | Generated by AI

Home 2026.07

Done! Here’s the full transformation:


🚀 Before vs After (RTX 4070)

Stage CPU (before) GPU (now) Speedup
Text encoding 2.2s 0.3s
Flux diffusion (4 steps) ~487s 12.8s 38×
VAE decode 37s 2.7s 13×
Total 526s ~16s 33×

What was done

  1. Rebuilt sd_cpp with CUDAcmake -DSD_CUDA=ON detected your RTX 4070 (compute 8.9)
  2. Stopped llama-server to free ~6 GB VRAM
  3. Key optimizations in run.sh:
    • --backend diffusion=cuda,clip=cpu,vae=cuda,t5xxl=cpu — Flux + VAE on GPU, text encoders on CPU
    • --vae-tiling — VAE compute buffer dropped from 6.6 GB → 416 MB with minimal speed loss
    • --max-vram 10 — leaves headroom for desktop apps

Issues found

Usage

cd /mnt/data/zz/flux
./run.sh "your prompt here"

Output saved to outputs/flux_<timestamp>.png (~1.7 MB).


Generated by AI. Curating and sharing still takes effort. If you find it useful, feel free to donate. WeChat: @lzwjavaWeChat QR · X: @lzwjava · Say hi 👋

Back Donate