Views
No views yet
| Resolution | Steps | Hardware + Optimizations | Expected FPS |
|---|---|---|---|
| 1024×1024 | 4 | RTX 4090 stock | ~1 fps |
| 512×512 | 4 | RTX 4090 + torch.compile | ~2-5 fps |
| 256×256 | 4 | RTX 4090 + torch.compile | ~8-15 fps |
| 256×256 | 1 | RTX 4090 + torch.compile | ~10-20 fps |
| 256×256 | 4 | H100 + compile + FP8 | ~15-25 fps |
| 256×256 | 1 | H100 + TensorRT | ~20-30 fps |
1# Install dependencies
2pip install -r requirements.txt
3
4# Benchmark at 256x256 (fastest config)
5python flux_klein_30fps.py --benchmark --frames 30 --resolution 256 --steps 4
6
7# Try 1-step for maximum speed (lower quality)
8python flux_klein_30fps.py --benchmark --frames 30 --resolution 256 --steps 1
9
10# Single image at 512x512
11python flux_klein_30fps.py --resolution 512 --prompt "a cyberpunk street at night"
12
13# With FP8 quantization (H100 / Ada GPUs only)
14python flux_klein_30fps.py --quant fp8 --resolution 256 --benchmark --frames 101pipe.transformer = torch.compile(
2 pipe.transformer,
3 mode="max-autotune",
4 fullgraph=False,
5 dynamic=False,
6)1from diffusers.hooks import apply_layerwise_casting
2apply_layerwise_casting(
3 pipe.transformer,
4 storage_dtype=torch.float8_e4m3fn,
5 compute_dtype=torch.bfloat16,
6 skip_modules_classes=["LayerNorm", "GroupNorm", "RMSNorm"],
7)scaled_dot_product_attention. Install flash-attn for explicit backend.| Config | Min GPU | VRAM |
|---|---|---|
| 1024×1024, 4 steps | RTX 3090 / 4070 | 13GB |
| 512×512, 4 steps + compile | RTX 4090 / A100 | 10GB |
| 256×256, 4 steps + compile | RTX 4090 / A100 | 8GB |
| 256×256, FP8 | H100 / RTX 4090 Ada | 6GB |
torch_tensorrt.compile() after torch.compile warmup