Nodes/ComfyUI-WanActivationEditor/WanVideo Activation Editor
ComfyUI Node

WanVideo Activation Editor

Inject a second prompt into specific transformer blocks

By fblissjr·Created about a year ago·Updated about a year ago· 9
WanVideo Activation Editor
  • model
  • text_embeds
  • injection_embeds
  • model
  • text_embeds
injection_strength0.50
block_activations0000000000000000000000000000000000000000
enable_patchingtrue
log_leveloff
injection_modecontext

Here's the honest pitch: Wan treats every prompt the same, at every depth. The UMT5-XXL text encoder turns your words into 4096-dim embeddings, a projection layer bumps them to the transformer's 5120-dim space, and then every one of the model's 40 transformer blocks cross-attends to the whole thing. That means "a gray tabby cat" is whispering in the model's ear at block 3 the same way it does at block 37 - no hierarchy, no depth, no nuance.

This node is the rebellion against that. It takes a second prompt (the "injection" conditioning), and lets you swap it into the cross-attention context of specific blocks while the rest keep reading your main prompt. The author frames it as 40 control knobs, and honestly that's the right mental model. Style transfer, "cyberpunk forest" hybrids, and the slow, painful community project of mapping what each of Wan's 40 blocks actually does all start here.

How it works

Under the hood it's runtime patching, not a fork. The pack's activation_patch.py grabs the model inside ComfyUI's ModelPatcher, finds the 40 WanAttentionBlocks, and wraps their forward methods - no modifications to kijai's WanVideoWrapper required. During generation, at the blocks you've activated, the injection context replaces (or blends with) the main context. At strength 1.0 the context in those blocks is completely replaced; the author's own tests confirm that. It's a real effect, not a knob that does nothing.

There's a wrinkle worth knowing before you're disappointed: the text_embedding layer normalizes embeddings by content, so two very different prompts can measure only a few percent apart after projection even though injection is working fine. The node measures and logs this difference so you can tell "injection silently failed" apart from "injection worked, metrics just look flat."

Inputs that matter

You'll wire up a WanVideoTextEncode for your main prompt into text_embeds, and a second one into injection_embeds (optional - without it the node just passes through). Then:

  • block_activations - a 40-character string of 0s and 1s saying which blocks get the injection. You will not hand-type this. Build it with WanVideoBlockActivationBuilder.
  • injection_strength - 0.0 to 1.0, default 0.5. Start 0.3–0.5; only crank to 1.0 when you want a hard swap in the activated blocks.
  • injection_mode - context (cross-attention context, the proven path), hidden_states (experimental), or both. Leave it on context.
  • log_level - basic or verbose shows you the "Percent changed" metrics and active blocks; off by default.

Outputs are model and text_embeds, both pass through for the sampler. Just keep the chain flowing: editor → your KSampler.

Install

This pack ships with 20 nodes and needs kijai's wrapper first:

cd ComfyUI/custom_nodes
git clone https://github.com/kijai/ComfyUI-WanVideoWrapper
git clone https://github.com/fblissjr/ComfyUI-WanActivationEditor
cd ComfyUI-WanActivationEditor && pip install -r requirements.txt

Restart ComfyUI. requirements.txt is just torch, numpy, duckdb, and zstandard - nothing heavy, DuckDB is the only non-obvious one and it auto-installs. ComfyUI Manager works too: search "ComfyUI-WanActivationEditor". The WANVIDEOMODEL / WANVIDEOTEXTEMBEDS types this node consumes come from WanVideoWrapper, so if the node refuses to appear or errors, that's almost always the missing dependency.

Troubleshooting

  • No visible effect - the number one cause is prompts that are too similar. The node warns below ~30% difference; aim for >50%. Failing that, raise strength to 0.7–1.0.
  • FP8 quantized model makes effects vanish - quantization crushes embedding differences. That's what WanVideoEmbeddingAmplifier exists for.
  • "No blocks found" / patching errors - your WanVideoWrapper is stale. Update it; the patch code walks the model structure and that changes between wrapper versions.
  • Console is quiet - it's supposed to be. Set log_level on the node, or export WAN_ACTIVATION_DEBUG=1 (basic) / WAN_ACTIVATION_VERBOSE=1 (detailed) before starting ComfyUI.

One last reality check, because this is an experimental pack from a solo author (fblissjr, built for the Banodoco open-video community): it works, but "which block does what" is genuinely unknown. The README is refreshingly honest - the tool exists to find out, and you'll also make "some super bizarre and/or broken videos" on the way. Treat it as an experiment rig, not a reliable effect button.

CategoryWanVideoWrapper/Experimental

Inputs (8)

NameTypeDefaultDescription
modelWANVIDEOMODEL
text_embedsWANVIDEOTEXTEMBEDS
injection_strengthFLOAT0.500–1
block_activationsSTRING0000000000000000000000000000000000000000
enable_patchingBOOLEANtrue
log_levelCOMBOoff4 options: off, basic, verbose, trace
injection_modeCOMBOcontext3 options: context, hidden_states, both
injection_embedsoptWANVIDEOTEXTEMBEDS

Outputs (2)

NameTypeDescription
modelWANVIDEOMODEL
text_embedsWANVIDEOTEXTEMBEDS