PyramidFlow Torch Compile Settings
Free speed if your torch cooperates
- torch_compile_args
PyramidFlow Torch Compile Settings is a configuration node - it produces no latents and no images. What it makes is a settings bundle you can hand to the model loader so that, while loading, the transformer gets torch.compiled for speed. Think of it as the "build optimized binaries" flag for your diffusion model. Done right it shaves a meaningful chunk off sampling time on supported GPUs. Done wrong it fails to load entirely and you spend an hour figuring out why.
The node's own description is the honest one: "when connected to the model loader, torch.compile of the selected layers is attempted. Requires Triton and torch 2.5.0 is recommended." Two things to hear in that sentence. First, Triton must be installed or none of this works. Second, Kijai wrote "recommended," not "required" - torch 2.5.0 is where the setup he tested against lives.
The inputs that matter
backend-inductor(default) orcudagraphs. Inductor is the safe general-purpose choice.cudagraphsalone is usually worse; leave it.mode-default,max-autotune,max-autotune-no-cudagraphs,reduce-overhead.max-autotuneis the aggressive speed setting with longer compile times and more VRAM during compilation. Start withdefault.compile_whole_model- if you flip this on, it overrides the block toggles below and compiles everything as one graph. This is the point where most people's PyTorch versions give up, because the full model is a big, dynamic graph.single_blocks/double_blocks/embedders/compile_rest- the surgical alternative: compile just the transformer blocks, the embedders, and/or the projection layers. Defaults have all of them on, which is a decent middle ground. Turn blocks off one at a time to narrow down a failure.fullgraph-falseby default. Enabling it demands the whole graph be capturable in one go, which is stricter and more brittle. Leave it off unless you know what you're doing.dynamo_cache_size_limit- a passthrough totorch._dynamo.config.cache_size_limit. Default 64 is fine; raise it only if you see cache-limit warnings.
The output
torch_compile_args (PYRAMIDFLOW_COMPILEARGS) goes into the optional compile_args socket on PyramidFlow Transformer Loader (or the VAE loader). No other node consumes it.
One subtlety worth knowing: the loader compiles with dynamic=True deliberately, because the pyramid's multi-stage generation changes tensor shapes between stages. That's why whole-model compile is fragile here - the graph isn't static.
The honest advice
For a beginner this node is optional, full stop. The default settings give you the speed-up without much ceremony, and if the first run throws a Triton or graph-capture error, the move is: turn compile_whole_model off, or pull the node off the loader entirely and run un-compiled. "Free speed" isn't free when it costs you an hour of debugging. Also amusing: like the Text Encode node, this one's category reads MochiWrapper - leftover labels from Kijai's other packs. Search "PyramidFlow Torch Compile Settings" and ignore the folder it lands in.
Install
Ships with the pack: ComfyUI Manager → "PyramidFlow Wrapper", or git clone https://github.com/kijai/ComfyUI-PyramidFlowWrapper into custom_nodes and restart. No model files of its own. The only real dependency is Triton being importable in your ComfyUI environment - check with python -c "import triton" in the venv your ComfyUI uses before blaming the node.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| backend | COMBO | inductor | 2 options: inductor, cudagraphs |
| fullgraph | BOOLEAN | false | Enable full graph mode |
| mode | COMBO | default | 4 options: default, max-autotune, max-autotune-no-cudagraphs, reduce-overhead |
| compile_whole_model | BOOLEAN | false | Compile the whole model, overrides other block settings |
| single_blocks | BOOLEAN | true | Compile single_blocks |
| double_blocks | BOOLEAN | true | Compile transformer blocks |
| embedders | BOOLEAN | true | Compile embedders |
| compile_rest | BOOLEAN | true | Compile the rest of the model (proj and norm out) |
| dynamo_cache_size_limit | INT | 640–1024 | torch._dynamo.config.cache_size_limit |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| torch_compile_args | PYRAMIDFLOW_COMPILEARGS | — |