Nodes/ComfyUI-HunyuanVideoWrapper/HunyuanVideo Lora Block Edit
ComfyUI Node Runs on cloud

HunyuanVideo Lora Block Edit

Applying a LoRA to only part of the model

By kijai·Created 2 years ago·Updated 12 months ago· 2,594
HunyuanVideo Lora Block Edit
    • blocks
    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
    single_blocks.0.true
    single_blocks.1.true
    single_blocks.2.true
    single_blocks.3.true
    single_blocks.4.true
    single_blocks.5.true
    single_blocks.6.true
    single_blocks.7.true
    single_blocks.8.true
    single_blocks.9.true
    single_blocks.10.true
    single_blocks.11.true
    single_blocks.12.true
    single_blocks.13.true
    single_blocks.14.true
    single_blocks.15.true
    single_blocks.16.true
    single_blocks.17.true
    single_blocks.18.true
    single_blocks.19.true
    single_blocks.20.true
    single_blocks.21.true
    single_blocks.22.true
    single_blocks.23.true
    single_blocks.24.true
    single_blocks.25.true
    single_blocks.26.true
    single_blocks.27.true
    single_blocks.28.true
    single_blocks.29.true
    single_blocks.30.true
    single_blocks.31.true
    single_blocks.32.true
    single_blocks.33.true
    single_blocks.34.true
    single_blocks.35.true
    single_blocks.36.true
    single_blocks.37.true
    single_blocks.38.true
    single_blocks.39.true

    This node is a big checkbox grid and nothing else - 60 boolean toggles, all on by default, one for each transformer block inside Hunyuan Video's DiT: 20 "double" blocks (double_blocks.0. through double_blocks.19., the early layers that process text and video jointly) and 40 "single" blocks (single_blocks.0. through single_blocks.39., the later layers that follow). It doesn't touch your prompt, your sampler, or your model directly - it produces a SELECTEDBLOCKS object that you wire into HyVideoLoraSelect's optional blocks input, and from there it decides which blocks that specific LoRA is actually allowed to modify.

    If you've used LoRA block-weight tools in the SD1.5/SDXL world (A1111's LoRA Block Weight extension, or similar ComfyUI nodes), this is the same idea transplanted to Hunyuan's architecture. The concept: a LoRA doesn't affect every layer of a model equally. Early layers tend to carry more of the coarse structure and composition; later layers carry finer detail and style. So a LoRA that's great at, say, a character's face but introduces an unwanted motion tic can sometimes be tamed by switching off the blocks responsible for the part you don't want, while leaving the ones responsible for the part you do want turned on.

    Practically: leave everything checked (the default) until you've already confirmed a LoRA behaves oddly with block editing off. This isn't a first-thing-you-try node - it's what you reach for after strength alone hasn't fixed the problem, and you have a specific hunch about where in the network the issue lives. Figuring out which blocks to disable is trial and error; there's no map that tells you "block 12 controls hand motion." Most people never touch this node at all, and that's fine - full LoRA application at a sensible strength covers the overwhelming majority of use cases.

    One quirk worth flagging so it doesn't confuse you: the node's single output is literally named blocks, but its tooltip in the pack describes it as "the modified diffusion model." It isn't a model - it's a selection mask that HyVideoLoraSelect applies when merging the LoRA into the model. Don't try to wire it anywhere except that one blocks input.

    Install is the same as every other node in this pack: ComfyUI Manager, search "HunyuanVideoWrapper," or git clone https://github.com/kijai/ComfyUI-HunyuanVideoWrapper into custom_nodes followed by pip install -r requirements.txt and a restart. This node specifically ships with the base install - no extra models or downloads needed, since it's pure logic sitting between two other wrapper nodes.

    If you're looking at this node and unsure whether you need it: you almost certainly don't, yet. Get your workflow running with a plain HyVideoLoraSelect at a reasonable strength first. Come back to block editing only when you've isolated a specific, repeatable problem that strength adjustment alone won't fix - bolting on 60 checkboxes of complexity before you've hit that wall is solving a problem you don't have yet.

    CategoryHunyuanVideoWrapper

    Inputs (60)

    NameTypeDefaultDescription
    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
    single_blocks.0.BOOLEANtrue
    single_blocks.1.BOOLEANtrue
    single_blocks.2.BOOLEANtrue
    single_blocks.3.BOOLEANtrue
    single_blocks.4.BOOLEANtrue
    single_blocks.5.BOOLEANtrue
    single_blocks.6.BOOLEANtrue
    single_blocks.7.BOOLEANtrue
    single_blocks.8.BOOLEANtrue
    single_blocks.9.BOOLEANtrue
    single_blocks.10.BOOLEANtrue
    single_blocks.11.BOOLEANtrue
    single_blocks.12.BOOLEANtrue
    single_blocks.13.BOOLEANtrue
    single_blocks.14.BOOLEANtrue
    single_blocks.15.BOOLEANtrue
    single_blocks.16.BOOLEANtrue
    single_blocks.17.BOOLEANtrue
    single_blocks.18.BOOLEANtrue
    single_blocks.19.BOOLEANtrue
    single_blocks.20.BOOLEANtrue
    single_blocks.21.BOOLEANtrue
    single_blocks.22.BOOLEANtrue
    single_blocks.23.BOOLEANtrue
    single_blocks.24.BOOLEANtrue
    single_blocks.25.BOOLEANtrue
    single_blocks.26.BOOLEANtrue
    single_blocks.27.BOOLEANtrue
    single_blocks.28.BOOLEANtrue
    single_blocks.29.BOOLEANtrue
    single_blocks.30.BOOLEANtrue
    single_blocks.31.BOOLEANtrue
    single_blocks.32.BOOLEANtrue
    single_blocks.33.BOOLEANtrue
    single_blocks.34.BOOLEANtrue
    single_blocks.35.BOOLEANtrue
    single_blocks.36.BOOLEANtrue
    single_blocks.37.BOOLEANtrue
    single_blocks.38.BOOLEANtrue
    single_blocks.39.BOOLEANtrue

    Outputs (1)

    NameTypeDescription
    blocksSELECTEDBLOCKSThe modified diffusion model.