NVIDIA published a tutorial on running Black Forest Labs' FLUX 3 Image Klein through TensorRT LLM VisualGen on Blackwell GPUs, with combined optimizations delivering up to 3.46x faster text-to-image (T2I) and 4.45x faster image-to-image (I2I) generation for the Base checkpoint at 2048x2048 on a single B200 compared with uncompiled BF16 inference. The model combines Qwen3-VL-4B-Instruct for text conditioning, a diffusion transformer (DiT) for refining image latents, and an autoencoder for decoding latents and encoding I2I reference inputs.
NVFP4 and fused GEMM kernels
VisualGen supports BFL's prequantized NVFP4 DiT checkpoints for both Base and distilled variants. On a Blackwell GPU, NVFP4 delivered up to 1.62x faster T2I and 1.58x faster I2I generation than BF16. The runtime uses FlashInfer's PrimsTS FP8/NVFP4 GEMM kernels, built with CUTLASS Primitives and Task Scheduling, which combine optimized matrix multiplications with fused epilogues including SwiGLU and QKV projections with query/key normalization and rotary position embeddings. At launch, the pinned PrimsTS kernels delivered 1.02 to 1.10x faster T2I generation on B200 than the autotuned TensorRT LLM NVFP4 GEMM implementation.
Denoising dominates the pipeline. In the reported 2048x2048 tests on one B200 with NVFP4, VANILLA attention, and torch.compile, T2I Base took 14.70 seconds total with denoising at 96.8 percent of that time, while the distilled model took 2.71 seconds with denoising at 84.0 percent. I2I runs were slower: 40.29 seconds for Base and 7.48 seconds for distilled, with denoising shares of 97.8 and 89.0 percent.
Quantized and sparse attention
Attention is a major bottleneck at high resolution. In the 2048x2048 NVFP4 T2I tests, VANILLA BF16 attention accounted for roughly 60 percent of DiT GPU kernel time for both Base and distilled Klein. VisualGen offers two quantized attention paths: cuDNN FP8 and VC-Attention FP8, a TensorRT LLM variant of the VC-Attention method. Compared with VANILLA BF16 attention, cuDNN FP8 gave 1.08x speedup for Base and 1.09x for the 16-step distilled model, with LPIPS scores of 0.072 and 0.161. VC-Attention FP8 with a repair budget of 0.005 gave 1.18x for Base and 1.16x for distilled, with LPIPS scores of 0.086 and 0.151. NVIDIA suggests VC-Attention FP8 for quantized attention at this resolution.
Sol-Attention sparse attention with tau set to 1.0 provided 1.24x faster denoising plus autoencoder decoding than compiled dense VANILLA with 16 initial dense steps, or 1.30x with 12. NVIDIA suggests 16 dense steps to prioritize fidelity or 12 to prioritize speed, noting that higher tau reduced output quality with little additional speedup.
Step caching and multi-GPU scaling
Cache-DiT reuses intermediate transformer outputs across denoising steps without retraining or modifying weights, controlled by a residual-difference threshold. At a threshold of 0.24, it nearly halved NVFP4 Base T2I latency at both tested resolutions: 1.97x at 1024x1024 and 1.94x at 2048x2048, with LPIPS scores of 0.038 and 0.033. The distilled model saw smaller gains of 1.26x and 1.20x.
For multi-GPU inference, VisualGen scales with classifier-free guidance (CFG) and Ulysses sequence parallelism. Base assigns positive and negative branches to separate GPU groups and partitions each branch's sequence with Ulysses; the distilled model runs without CFG and uses Ulysses alone. At 2048x2048, scaling from one to eight GPUs on an NVIDIA DGX B200 reduced median T2I latency from 14.90 to 3.00 seconds for Base and from 2.73 to 1.08 seconds for distilled, with denoising speedups of 6.01x and 4.44x.
Sources & references
NVIDIA: Speed Up Image Generation with FLUX 3 Image Klein on NVIDIA Blackwell GPUs ↗Source consulted: 2026-11-16



