Nodes/comfyui-HannibalPack/Hannibal LoRA Loader
ComfyUI Node

Hannibal LoRA Loader

The LoRA loader that only touches the blocks you say — stacked Wan LoRAs stop fighting

By HannibalP·Created about a year ago·Updated about a year ago· 1
Hannibal LoRA Loader
  • model
  • model
lora_name
strength1.00
blocks_specdouble:0-19,single:0-39

Hannibal LoRA Loader exists to solve one specific, annoying problem: you stack a motion LoRA and a character LoRA on a Wan video model, and the face drifts, or the motion gets mushy, or both. Every normal LoRA loader patches every layer it can reach, so two LoRAs end up writing conflicting updates to the same weights. This one lets you tell each LoRA which transformer blocks it's allowed to touch - via a little string called blocks_spec. The author's README (French, and two sentences long, bless them) puts it as "improving the merge of motion LoRAs and physical resemblance when adding several LoRAs to a model." That's the whole pitch.

How it works

Modern MMDiT video and image transformers - Wan, HunyuanVideo, Flux, SD3 - aren't one big weight blob. They're split into double_blocks (the joint text+image attention layers) and single_blocks (the self-attention layers). A LoRA trained for these models has tensors keyed to each block, so nothing stops you from loading only the tensors for a subset of them. That's the whole mechanism here: the loader filters the LoRA's keys to the blocks you name, then hands the filtered tensor dict to ComfyUI's normal load_lora_for_models. Same patching math as the stock loader, just with a door slammed on part of the model.

The default spec is double:0-19,single:0-39, which is "every block," i.e. behave like a regular LoRA loader. The trick is shrinking it per-LoRA: give the motion LoRA the middle blocks, give the character LoRA the early double blocks where identity mostly lives, and they stop stepping on each other. It's the same instinct as kohya's block-wise weight tuning, but applied at load time instead of training time.

The inputs that matter

Four inputs, only two you'll actually think about:

  • model (MODEL) - wire in your loaded checkpoint/UNet, same as any LoRA loader.
  • lora_name - dropdown of everything in ComfyUI/models/loras/.
  • strength (default 1.0, range -10 to 10) - the usual LoRA strength. Negative values are allowed if you want to subtract a LoRA's effect; most people won't.
  • blocks_spec - the star of the show. Comma-separated type:start-end ranges, inclusive: double:0-6,single:0-19 applies only to double blocks 0–6 and single blocks 0–19. Formats outside type:start-end just raise a parse error, so no silent footguns there.

The one output is model, the patched model, which you wire into the sampler exactly like a normal LoRA loader's output. It caches the last-loaded LoRA file too, so scrubbing strength on a re-run doesn't re-read the file from disk.

There's a nice hidden bonus: it auto-detects and converts Musubi Tuner format LoRAs (the lora_unet_... keys musubi-tuner emits for Wan and HunyuanVideo) into what ComfyUI expects, alpha scaling included. So a Wan LoRA fresh off musubi loads without you needing a separate key-fixing pass.

Installing it

The README's instructions are "download, drop in custom_nodes/, restart" - the modern version of that is:

cd ComfyUI/custom_nodes
git clone https://github.com/HannibalP/comfyui-HannibalPack

Restart ComfyUI (or hit Refresh in the node menu), and search "Hannibal" in the node picker. No pip dependencies, no model downloads, nothing else to fetch - the whole pack is one Python file that leans on ComfyUI's own comfy.sd and comfy.utils. ComfyUI Manager should also find it if you search the pack title.

Where people get burned

  • The LoRA just doesn't apply. If you're running SDXL or SD 1.5, stop right there - those models have no double_blocks/single_blocks, so the filter drops everything and you get a silent no-op. This is an MMDiT-family tool (Wan, HunyuanVideo, Flux, SD3). Also check your spec didn't shrink the ranges down to nothing.
  • Wrong base model. Wan 2.1-trained LoRAs mostly carry to 2.2, but a Flux LoRA won't touch Wan - same rule as everywhere.
  • Qualitative, not quantitative. There's no preview and no "best spec" - you'll be dialing ranges by eye. Start from the full default, then restrict one LoRA at a time.
  • Video LoRAs and fp8 are grumpy together. Community consensus for Wan: LoRAs work badly on fp8-quantized weights; run GGUF or BF16 if a patched model glitches.

Honest caveat: this is a tiny, one-author pack with a minimal README and near-zero community footprint, so you're on your own for finding good block splits. But for the specific jam of stacking motion and likeness LoRAs on Wan, it's a genuinely useful dial that nothing in core ComfyUI gives you.

Categoryloaders/hannibal

Inputs (4)

NameTypeDefaultDescription
modelMODEL
lora_nameCOMBO0 options:
strengthFLOAT1.00-10–10
blocks_specSTRINGdouble:0-19,single:0-39

Outputs (1)

NameTypeDescription
modelMODEL