Nodes/Hunyuan LoRA Loader Nodes/Hunyuan Video LoRA Loader - Edit Blocks
ComfyUI Node

Hunyuan Video LoRA Loader - Edit Blocks

Which blocks does your Hunyuan LoRA actually live in?

By PixelFunAI·Created 2 years ago·Updated 2 years ago· 3
Hunyuan Video LoRA Loader - Edit Blocks
  • model
  • model
lora_name
strength1.00
save_settingstrue
use_single_blocksfalse
double_blocks.0.true
double_blocks.1.true
double_blocks.2.true
double_blocks.3.true
double_blocks.4.true
double_blocks.5.true
double_blocks.6.true
double_blocks.7.true
double_blocks.8.true
double_blocks.9.true
double_blocks.10.true
double_blocks.11.true
double_blocks.12.true
double_blocks.13.true
double_blocks.14.true
double_blocks.15.true
double_blocks.16.true
double_blocks.17.true
double_blocks.18.true
double_blocks.19.true

Here's the situation that makes you want this node: you've got a Hunyuan Video LoRA that nukes your composition, or a style LoRA that also drags in a face you didn't ask for. A normal LoraLoader has one dial - strength - and strength fixes everything about nothing. HunyuanLoadAndEditLoraBlocks gives you the surgical version: 20 on/off toggles, one per double block, so you can pick apart which part of the model the LoRA is actually touching.

Hunyuan Video is a 13B diffusion transformer - an MMDiT with 20 double-stream blocks and 40 single-stream blocks. LoRAs trained on it patch those blocks, and different blocks carry different responsibilities: identity tends to live in some, motion and composition in others. Block-level control is a well-worn practice in the DiT world - the whole "block weights" school of LoRA fiddling - and this node brings that thinking to Hunyuan without you needing to know a single block's number off the top of your head. Just toggle, run, look.

How it works

The node builds a dict of block settings from its toggles, then filters the LoRA's tensors by key name: any tensor whose name contains an enabled block prefix (like double_blocks.7.) survives; everything from a disabled block gets dropped. The filtered tensors go into ComfyUI's normal load_lora_for_models. So it's not a strength multiplier per block - it's binary. Block on, block off.

The inputs that matter

The node surface is busy but only a few fields deserve your attention:

  • lora_name - pick from your models/loras folder.
  • strength - global strength, default 1.0, range -10 to 10. This is where you go down, not up.
  • double_blocks.0. through double_blocks.19. - the actual point. 20 booleans, all on by default. Flip one off, rerun, compare.
  • use_single_blocks - a single all-or-nothing switch for the 40 single blocks (default off). There's no per-block granularity here, which is the main thing you'll wish for.
  • save_settings - when true, writes your double-block choices to the pack's cache so the Load From Cache node can replay them later. Default true, and this is the node's real purpose: it's how you build that cache.

Output is a patched model, same as any loader.

The trap in the room

The node's change-detection signature (IS_CHANGED) only hashes the LoRA name, strength, and file mtime - not the block toggles. In practice that can mean flipping a toggle alone doesn't force a re-run because ComfyUI serves the cached result. If you toggle a block and nothing visibly changes, nudge the strength up by 0.01 and back - that changes the signature and forces a fresh execution. Annoying, but a two-second workaround.

Also worth knowing: only the double-block toggles get saved to cache. Single blocks are a live, per-load decision, so a workflow that "replays" your settings via cache will remember your double blocks but silently default your single blocks to off.

Installing it

cd ComfyUI/custom_nodes
git clone https://github.com/PixelFunAI/ComfyUI_PixelFun

Restart ComfyUI, or find "Hunyuan LoRA Loader Nodes" in ComfyUI Manager. No extra Python deps, no model downloads - the only dependency beyond ComfyUI itself is yaml, which you already have.

A note on expectations: block-toggling is fiddly by nature, and the results are rarely binary good/bad. You'll spend a few renders going down a rabbit hole of "was it block 11 or 12?". The one I'd actually reach for: when a Hunyuan LoRA is doing almost what you want, disable the low double blocks first - that's where the coarser structural signal tends to sit. And if you want per-single-block control, this node won't give it to you - you'd be writing a custom loader.

Categoryloaders/hunyuan

Inputs (25)

NameTypeDefaultDescription
modelMODEL
lora_nameCOMBO0 options:
strengthFLOAT1.00-10–10
save_settingsBOOLEANtrue
use_single_blocksBOOLEANfalse
double_blocks.0.BOOLEANtrue
double_blocks.1.BOOLEANtrue
double_blocks.2.BOOLEANtrue
double_blocks.3.BOOLEANtrue
double_blocks.4.BOOLEANtrue
double_blocks.5.BOOLEANtrue
double_blocks.6.BOOLEANtrue
double_blocks.7.BOOLEANtrue
double_blocks.8.BOOLEANtrue
double_blocks.9.BOOLEANtrue
double_blocks.10.BOOLEANtrue
double_blocks.11.BOOLEANtrue
double_blocks.12.BOOLEANtrue
double_blocks.13.BOOLEANtrue
double_blocks.14.BOOLEANtrue
double_blocks.15.BOOLEANtrue
double_blocks.16.BOOLEANtrue
double_blocks.17.BOOLEANtrue
double_blocks.18.BOOLEANtrue
double_blocks.19.BOOLEANtrue

Outputs (1)

NameTypeDescription
modelMODEL