Nodes/ComfyUI-OpenVINO/TorchCompileVAEOpenVINO
ComfyUI Node

TorchCompileVAEOpenVINO

Your VAE is the hidden bottleneck — compile it too

By openvino-dev-samples·Created about a year ago·Updated 6 months ago· 45
TorchCompileVAEOpenVINO
  • vae
  • VAE
device
compile_encodertrue
compile_decodertrue
remove_compilefalse

Here's a thing people miss when they first try to speed up ComfyUI on Intel hardware: the diffusion model is only half the workload. The VAE - the part that turns latents into pixels on the way out - runs as its own model in ComfyUI, separate from the sampler. If you've compiled the UNet with TorchCompileDiffusionOpenVINO but left the VAE alone, that encode/decode is still crawling in plain PyTorch while the expensive part zooms. TorchCompileVAEOpenVINO is the sibling node that fixes that, and on weak Intel iGPUs the VAE can be a surprisingly big chunk of your wall-clock time - sometimes the visible speedup you feel comes more from this node than from the diffusion one.

Like its sibling, this is not a model converter. No .xml export, no downloads. It's a torch.compile(backend="openvino") wrapper, applied to the VAE's encoder and decoder instead of the diffusion model.

How it works

The node grabs the VAE's first_stage encode/decode methods, wraps them in torch.compile with the OpenVINO backend, and points that at the Intel device you choose. It's smart about TAESD too: if your VAE has a TAESD encoder/decoder attached, it compiles those instead of the full VAE - TAESD is already a tiny preview-decoder, so compiling it is cheap and fast.

The nice engineering bit is that it keeps the original encode/decode methods around. That's what powers the remove_compile toggle - flip it, and the VAE is restored to stock without a reload. Toggle on, toggle off, all live.

The inputs that matter

Five inputs, but you'll touch a handful of them:

  • vae (VAE) - wire in the VAE output from your loader.
  • device (COMBO) - OpenVINO's detected devices: CPU, GPU, and on Core Ultra machines, NPU. If your box has an iGPU, pick GPU.
  • compile_encoder / compile_decoder (BOOLEAN, both default true) - compile each half independently. Leave both on; turn one off only if it errors.
  • remove_compile (BOOLEAN, default false) - the author's tooltip is blunt: "Remove VAE compilation." Set it true to undo and the node just passes your VAE through.

Output is a single VAE, and it slots back where your VAE loader's output went - swap it in line, don't stack it in front of the loader. The full setup is both OpenVINO nodes in series: Load Checkpoint → TorchCompileDiffusionOpenVINO → KSampler, and Load VAE → TorchCompileVAEOpenVINO → the VAE input of your Decode node.

Installing it

Same pack as the diffusion node - you get both at once. ComfyUI Manager (search "ComfyUI-OpenVINO") or:

cd ComfyUI/custom_nodes
git clone https://github.com/openvino-dev-samples/comfyui_openvino
cd comfyui_openvino
pip install -r requirements.txt

The dependency that bites is the torch==2.10.0 pin plus openvino>=2026.0.0. Installing this pack can change the torch version your ComfyUI runs, so check after installing - and on the portable build, re-run the requirements install with python_embeded as the README instructs. The author also recommends launching ComfyUI with --cpu --use-pytorch-cross-attention so ComfyUI's own path stays on CPU and out of the OpenVINO backend's way.

Where people get burned

  • The first decode is a compile, not a hang. Like the diffusion node, the first inference warms up; expect a pause, then normal speed.
  • Turn off remove_compile after using it. It defaults to false, so if you ever flip it to undo the compile, flip it back - otherwise you've silently disabled the node and the VAE is back in slow torch.
  • Windows JIT compile failures. Higher resolutions can trip PyTorch's inductor, which needs MSVC (cl.exe). Install the Visual Studio "Desktop development with C++" workload and call vcvars64.bat before ComfyUI. A space in your Windows username (torchinductor_John Doe) also breaks the compiler - override USERNAME or point TEMP at a space-free path.
  • NPU is not a speed win. Community testing on a Core Ultra 7 155H put OpenVINO-on-NPU at about half the throughput of the integrated Arc GPU. It's a power-efficiency option, not a fast one.

Is it worth a node slot? If you've already gone through the trouble of the OpenVINO diffusion node, this is the other half of the win - leaving the VAE uncompiled is leaving free speed on the table.

CategoryOpenVINO

Inputs (5)

NameTypeDefaultDescription
vaeVAE
deviceCOMBO1 options: CPU
compile_encoderBOOLEANtrue
compile_decoderBOOLEANtrue
remove_compileBOOLEANfalseRemove VAE compilation

Outputs (1)

NameTypeDescription
VAEVAE