Nodes/KJNodes for ComfyUI/DiT Block Lora Loader
ComfyUI Node Runs on cloud

DiT Block Lora Loader

Apply a LoRA to only the blocks you choose

By kijai·Created 3 years ago·Updated about 12 hours ago· 2,930
DiT Block Lora Loader
  • model
  • blocks
  • model
  • rank
strength_model1.00
lora_name
opt_lora_path

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 SELECTEDDITBLOCKS input 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 blocks isn'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 blocks input 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.
CategoryKJNodes/lora

Inputs (5)

NameTypeDefaultDescription
modelMODELThe diffusion model the LoRA will be applied to.
strength_modelFLOAT1.00-100–100How strongly to modify the diffusion model. This value can be negative.
lora_nameoptCOMBOThe name of the LoRA.
opt_lora_pathoptSTRINGAbsolute path of the LoRA.
blocksoptSELECTEDDITBLOCKS

Outputs (2)

NameTypeDescription
modelMODELThe modified diffusion model.
rankSTRINGpossible rank of the LoRA.