Nodes/ComfyUI Flux Accelerator/🍭FluxAccelerator
ComfyUI Node

🍭FluxAccelerator

Make Flux feel fast on your 4090, without touching the weights

By discus0434·Created 2 years ago·Updated 2 years ago· 141
🍭FluxAccelerator
  • model
  • vae
  • MODEL
  • VAE
do_compiletrue
mmdit_skip_blocks3,12
dit_skip_blocks

Flux is great and it's slow. On a 4090, a 20-step 1024² image costs you the better part of nine seconds, and that's before the VAE decode. This node is a single box you drop between your model and your sampler that claims up to ~37% faster generation, no API, no key, no giant download. It stacks three tricks: a tiny approximate VAE, torchao quantization plus torch.compile(), and skipping a couple of the transformer blocks. Drop it in, hit queue, and suddenly that same image is ~5.7s.

The one thing the name overpromises: it never touches the diffusion weights. Nothing is merged, converted, or re-saved. It accelerates around the model.

How it works

Three independent speedups, all inside the one node:

  1. TAEF1 as your VAE. Flux's real VAE is a heavy transformer-based autoencoder, and decoding 1024² through it takes real seconds. TAEF1 (from madebyollin, the TAESD author) is a tiny autoencoder that decodes fast enough that the VAE stops being the bottleneck - at the cost of a small quality hit. The node doesn't load it for you; you wire it in as your VAE and the included download_taef1.sh script just drops taef1_encoder.pth and taef1_decoder.pth into models/vae_approx/ so the TAESD-style loader can find them.
  2. Quantization + compilation. It quantizes the VAE weights with torchao - float8 on Ada Lovelace and newer (RTX 40/50, H100), int8 elsewhere - then torch.compile()s both the diffusion model and the VAE in channels_last memory format. First run pays a 30–60 second compile cost; after that it's cached.
  3. Skipping DiT blocks. Flux has 19 "double" (MMDiT) blocks and 38 "single" blocks. The node attaches a custom forward that literally continues over the blocks you list.

Read the source and you'll notice the loop indices are exact: the default "3,12" skips double blocks 3 and 12, not "the last two." That's the whole speed trick - most of the MMDiT stack is redundant for a single sample.

The inputs that actually matter

Only five, and honestly only two you'll touch:

  • model and vae - your Flux model and your TAEF1 VAE.
  • mmdit_skip_blocks - comma-separated double-block indices to skip. Default "3,12". More skips = faster and uglier; this is your quality dial.
  • dit_skip_blocks - same idea for the 38 single blocks. Default empty, and leave it that way unless you're feeling brave.
  • do_compile - default true. Flip it off to skip the 30–60s first-run compile if you're just testing.

Outputs are patched MODEL and VAE. Wire MODEL into your sampler and VAE into VAEDecode - the rest of your graph stays exactly as it was. The custom forward even keeps ControlNet working.

How to install

Via ComfyUI Manager, search "Flux Accelerator." Or the manual way:

cd ComfyUI/custom_nodes
git clone https://github.com/discus0434/comfyui-flux-accelerator
cd comfyui-flux-accelerator
chmod +x scripts/download_taef1.sh && ./scripts/download_taef1.sh

Dependencies are torchao, triton, and xformers (requirements.txt). If they're missing you'll get an import error at startup; the README's install line is:

pip install -U torch torchvision torchao triton xformers --index-url https://download.pytorch.org/whl/cu124

Then restart ComfyUI. Note the launch flags in the README: --fast --highvram on a 4090, and drop --disable-cuda-malloc in if you're on an H100/L40.

Where people get burned

  • It's Linux-only. The author says so in the README, and there's no Windows build path. If you're on Windows, don't fight this one.
  • Under 24GB VRAM you'll see OOM noise. The README is blunt: when you change parameters you may hit frequent Out Of Memory errors - just ignore them and run again. Not exactly reassuring, but it's the documented behavior.
  • The compile-recompile loop. One-char bug in the shipped code: it sets self.compiled but checks self._compiled, so it re-wraps torch.compile on every queue run. torch.compile's cache makes the re-wrap cheap after the first one, so it's more a smell than a slowdown - but it's there.
  • Don't skip the TAEF1 part. The node will happily quantize and compile your full Flux VAE instead, and you'll get a fraction of the advertised speedup with none of the "quality tradeoff" to show for it.

The honest take: it's a genuinely clever speed hack with a real 30%-ish payoff on 40-series cards, buried under a rough, Linux-only, small-VRAM-hostile install. If that describes your rig, it's worth the five minutes. If not, the quality tax from TAEF1 and the skipped blocks means your default Flux workflow is probably fine as-is.

Categoryadvanced/model

Inputs (5)

NameTypeDefaultDescription
modelMODEL
vaeVAE
do_compileBOOLEANtrue
mmdit_skip_blocksSTRING3,12
dit_skip_blocksSTRING

Outputs (2)

NameTypeDescription
MODELMODEL
VAEVAE