Nodes/ComfyUI_FluxMod/FluxMod Prune Model Layers
ComfyUI Node

FluxMod Prune Model Layers

Manually pruning FluxMod's transformer layers

By lodestone-rock·Created 2 years ago·Updated about a year ago· 123
FluxMod Prune Model Layers
  • model
  • model
skip_mmdit_layers10
skip_dit_layers3, 4

The node's own description is refreshingly direct: "Prune model layers." This sits in the still-current half of ComfyUI_FluxMod (not the deprecated Chroma section) and does exactly what it says - you feed it a Flux MODEL and tell it, by index, which transformer blocks to skip entirely during the forward pass. Fewer blocks doing work means less compute per step, at the cost of changing - not just speeding up - what the model produces, since you're literally removing layers it was trained with.

Flux's DiT architecture runs two kinds of transformer block: MMDiT (double-stream) layers, where image and text tokens attend jointly, and single-stream DiT layers later in the stack. This node lets you skip either kind independently. It's the same general idea as skip-layer-guidance techniques used elsewhere in the ecosystem to trade fidelity for speed or to deliberately alter output character - except here it's a blunt, manual switch rather than an automatic guidance mechanism.

What it does

Two STRING inputs alongside your model. skip_mmdit_layers (default "10") and skip_dit_layers (default "3, 4") take comma-separated layer indices - the defaults skip MMDiT block 10 and DIT blocks 3 and 4 out of the box. Per the pack's README, setting skip_dit_layers to -1 disables skipping on that side entirely, which is the documented way to turn this node into a no-op for that half without removing it from your graph. Output is a model, same type as the input, ready to feed into your sampler like any other Flux MODEL.

How to install it

Via ComfyUI Manager: search "ComfyUI_FluxMod" in Custom Nodes Manager, install, restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/lodestone-rock/ComfyUI_FluxMod.git

Restart ComfyUI and refresh your browser. No model downloads specific to this node - it operates on whatever Flux/FluxMod model you've already loaded upstream.

Common issues & troubleshooting

Images look noticeably degraded or different in structure after adding this node. That's the expected trade-off, not a bug - you're removing trained layers from the forward pass, and Flux wasn't trained to run without them. If the change is too aggressive, skip fewer layers, or set skip_dit_layers to -1 and only prune skip_mmdit_layers, or vice versa, to isolate which side is doing the damage.

Not sure which layer indices are safe to skip. There's no universal answer here - it depends on what you're optimizing for and how much quality drift you can tolerate. Start from the defaults (10 for MMDiT, 3, 4 for DIT), change one number at a time, and compare against a fixed seed so you can actually tell what each change did - the same one-variable-at-a-time discipline that applies to any Flux troubleshooting.

Format errors on the layer-index fields. These are plain strings parsed as comma-separated integers - stray characters, missing commas, or non-numeric entries are the likely cause if the node errors out rather than silently doing nothing.

Wiring order relative to other FluxMod nodes. This node just transforms a MODEL, so it composes normally with the rest of the pack - load with FluxModDiffusionLoader, prune with this node, then sample with KSamplerMod if you're in a float8 quant mode.

Categoryadvanced/FluxMod

Inputs (3)

NameTypeDefaultDescription
modelMODEL
skip_mmdit_layersSTRING10
skip_dit_layersSTRING3, 4

Outputs (1)

NameTypeDescription
modelMODEL