DiT Block Lora Loader
Apply a LoRA to only the blocks you choose
- model
- blocks
- model
- rank
A normal LoRA loader applies the LoRA to the whole model. This one lets you apply it to only some of the model's transformer blocks. That's the whole pitch, and for the modern DiT models - Flux, SD3, Wan, Hunyuan, the diffusion-transformer generation - it's a genuinely useful knob. Block-level control is how people separate a LoRA's style contribution from its composition contribution, cut down on unwanted "bleed" where a character LoRA drags its training background along, or just debug which blocks are actually carrying an effect.
It's part of KJNodes, kijai's utility pack. Given how much of the community's Flux and Wan tooling runs through kijai's work, a block-targeting LoRA loader living here makes sense.
How it works
A diffusion transformer is a stack of blocks, and different blocks tend to specialize - roughly, some steer high-level structure and composition, others handle style and fine detail. A standard LoRA patches all of them at your chosen strength. This node lets you restrict the patch to a selected subset of blocks, so the LoRA only touches the part of the network you want it to. Leave the selection empty and it behaves like a normal loader (all blocks); narrow it down and you're doing surgery.
The inputs and outputs that matter
- model - the DiT model to patch.
- strength_model - LoRA strength, same as any loader.
- lora_name (optional) - pick the LoRA from your loras folder.
- opt_lora_path (optional) - point at a LoRA by path instead, for files outside the usual folder.
- blocks (optional) - a
SELECTEDDITBLOCKSinput that comes from a companion block-selector node; this is where the "which blocks" decision is made. No selection = all blocks.
Outputs are the patched model and rank, a string reporting the LoRA's rank so you can confirm what actually loaded.
Installing it
ComfyUI Manager → search KJNodes for ComfyUI → install → restart. Or cd ComfyUI/custom_nodes && git clone https://github.com/kijai/ComfyUI-KJNodes, then pip install -r ComfyUI-KJNodes/requirements.txt, and restart. LoRA files themselves you supply - this loads what's in your loras folder or a path you give it.
Where people get burned
- Empty
blocksisn't a bug. With no block selection it applies to everything, which is the sane starting point. Do that first, confirm the LoRA works, then start pruning blocks - jumping straight to a narrow selection makes it hard to tell whether a weak effect is the selection or the LoRA. - You need the block-selector node. The
blocksinput isn't something you type; it's fed by a companion node that lets you pick the DiT blocks. Without it you're limited to the all-blocks default. - It's model-family specific. This is for DiT-architecture models. Block targeting on a Flux model and a Wan model isn't the same set of blocks - a selection that isolates "style" on one won't map identically to another. Expect to re-find the useful blocks per model.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | The diffusion model the LoRA will be applied to. | |
| strength_model | FLOAT | 1.00-100–100 | How strongly to modify the diffusion model. This value can be negative. |
| lora_nameopt | COMBO | The name of the LoRA. | |
| opt_lora_pathopt | STRING | Absolute path of the LoRA. | |
| blocksopt | SELECTEDDITBLOCKS | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| model | MODEL | The modified diffusion model. |
| rank | STRING | possible rank of the LoRA. |