Nodes/LoRA-Safe TorchCompile/TorchCompileModel_LoRASafe
ComfyUI Node

TorchCompileModel_LoRASafe

A ComfyUI node in model/optimisation 🛠️ with 11 inputs and 1 output.

By xmarre·Created about a year ago·Updated 4 months ago· 12
TorchCompileModel_LoRASafe
  • model
  • MODEL
backend
mode
fullgraphfalse
dynamicfalse
disable_cudagraphstrue
compile_transformer_onlyfalse
debug_torch_logsfalse
skip_dynamic_cudagraphstrue
allow_flux_inferred_targetsfalse
fallback_to_full_model_if_no_targetsfalse
Categorymodel/optimisation 🛠️

Inputs (11)

NameTypeDefaultDescription
modelMODEL
backendCOMBO3 options: inductor, cudagraphs, nvfuser
modeCOMBO3 options: default, reduce-overhead, max-autotune
fullgraphBOOLEANfalse
dynamicBOOLEANfalse
disable_cudagraphsBOOLEANtrueTrue -> pass torch.compile options {'triton.cudagraphs': False} for inductor backend. Useful to avoid cudaMallocAsync/cudagraph issues in some environments.
compile_transformer_onlyBOOLEANfalseTrue -> compile discovered transformer targets only. Flux models compile leaf submodules inside double_blocks/single_blocks; SD-style models often compile transformer_blocks/blocks.
debug_torch_logsBOOLEANfalseEnable PyTorch compile/cudagraph debug logs via torch._logging.set_logs (ignored if TORCH_LOGS env var is already set).
skip_dynamic_cudagraphsBOOLEANtrueFor cudagraph-capable runs, skip cudagraphing functions with dynamic-shape inputs. Recommended for Flux.
allow_flux_inferred_targetsBOOLEANfalseFalse (recommended) -> Flux compile targets are strict and limited to qkv/proj/linear1/linear2 leaves only. True -> also allow inferred Flux target names for compatibility.
fallback_to_full_model_if_no_targetsBOOLEANfalseIf transformer-only target discovery finds nothing, fall back to compiling diffusion_model. False keeps execution uncompiled instead of widening target scope.

Outputs (1)

NameTypeDescription
MODELMODEL