WAN Diff-Aid Sparse Patch
WAN video that finally lets the text get a word in
- model
- model
- summary
Text-to-video is where prompts go to get half-ignored. WAN 2.1 and 2.2 are the open video base almost everything runs on, and they follow the same pattern as image models: your prompt's influence dilutes as the context tensor passes through the transformer, and every block treats it the same way. This node is the WAN port of the Diff-Aid idea - modulate the text conditioning selectively at a few blocks instead of cranking one global knob. It shares a pack with the better-known Flux and SDXL siblings, and it's the most experimental of the three.
Read that last sentence carefully, because the author does. The Diff-Aid paper (arXiv:2602.13585) evaluates FLUX and SD 3.5 text-to-image, and explicitly lists video as future work. So this node is not paper-validated, and nobody claims it is. It's a best-effort architectural port of the same principle: context' = context + context × α, applied at selected WAN blocks.
How it works
WAN models don't expose Flux-style double_blocks / single_blocks. They expose one flat blocks list, and ComfyUI's native WAN path already uses patches_replace["dit"][("double_block", i)] replacement hooks inside its block loop. This node rides exactly that convention: it installs replacement patches on the selected WAN blocks and modulates the context tensor before each one receives it.
The one WAN-specific wrinkle is image conditioning. In image-to-video / TI2V workflows the context tensor has an image-prefix region that represents the start frame, not your prompt. preserve_image_context_prefix (default True) detects that prefix at runtime and modulates only the remaining text tokens, leaving the frame conditioning alone. That's the difference between "nudge the prompt" and "warp your start frame", so leave it on.
The inputs that matter
block_preset-paper_sparse_flux_remapped(default) takes the paper's FLUX sparse list1,15,36,41,48and remaps it onto whatever WAN block count you loaded: a 30-block WAN maps to1,8,19,22,25, a 40-block one to1,11,25,29,34. Or pickcustom_block_indicesand type your own intoblock_indices.strength- default 0.35. This is not the place for heroics; moderate strength first, verify motion/detail stability, then creep up.preserve_image_context_prefixandcond_only- both default on, both the safe choice.sigma_start/sigma_end- same normalized window as the Flux node; try0.55/1.0if you only want the early, structure-setting phase.
Outputs: a patched MODEL and a summary STRING listing exactly which blocks got mapped and whether the image prefix was preserved.
Install
Same as the rest of the pack - no pip deps, no model files, nothing extra to download. ComfyUI Manager has it as ComfyUI-DiffAid-Patches, or:
cd ComfyUI/custom_nodes
git clone https://github.com/xmarre/ComfyUI-DiffAid-Patches
Restart ComfyUI. It needs a current build with DiT patch-replacement hooks.
Where people get burned
Scope, mostly. This node targets native ComfyUI WAN model objects that expose the single blocks list - it will not work through Kijai/WanVideoWrapper internals unless they happen to expose the same native path. If another WAN patcher also installs block replacement hooks, order can matter, though the node preserves an already-installed patch for the same block and calls it after applying its own modulation. And temper expectations: this is an experimental text-conditioning port on a model the paper never touched, so results will be workflow- and seed-dependent. It's a "try it and see whether your WAN listens better" node, not a quality guarantee.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| enabled | BOOLEAN | true | — |
| block_preset | COMBO | paper_sparse_flux_remapped | 2 options: paper_sparse_flux_remapped, custom_block_indices |
| block_indices | STRING | 1,15,36,41,48 | — |
| strength | FLOAT | 0.35-1–1 | — |
| sigma_start | FLOAT | 0.0000–1 | — |
| sigma_end | FLOAT | 1.0000–1 | — |
| sigma_ramp | FLOAT | 0.0000–0.5 | — |
| token_weight_mode | COMBO | none | 3 options: none, linear, exponential |
| token_tail | FLOAT | 0.350–1 | — |
| preserve_image_context_prefix | BOOLEAN | true | — |
| cond_only | BOOLEAN | true | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| model | MODEL | — |
| summary | STRING | — |