33x Speedup with RTX 4070 | Generated by AI
Done! Here’s the full transformation:
🚀 Before vs After (RTX 4070)
| Stage | CPU (before) | GPU (now) | Speedup |
|---|---|---|---|
| Text encoding | 2.2s | 0.3s | 7× |
| Flux diffusion (4 steps) | ~487s | 12.8s | 38× |
| VAE decode | 37s | 2.7s | 13× |
| Total | 526s | ~16s | 33× |
What was done
- Rebuilt
sd_cppwith CUDA —cmake -DSD_CUDA=ONdetected your RTX 4070 (compute 8.9) - Stopped
llama-serverto free ~6 GB VRAM - 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
- T5XXL file
t5xxl_fp16.safetensorshas corrupt tensors (“data offsets out of bounds”). Without it, prompt adherence is degraded. Re-download from here to fix.
Usage
cd /mnt/data/zz/flux
./run.sh "your prompt here"
Output saved to outputs/flux_<timestamp>.png (~1.7 MB).
