Apply DCW (Wavelet Patch)
DCW's Wavelet Patch, Explained
- model
- MODEL
One node, and it's a model patch
Apply DCW (Wavelet Patch) doesn't generate anything by itself. It's a model_function_wrapper - you drop it into the purple MODEL slot between your checkpoint loader and your KSampler, and it quietly rewrites how the model denoises on every step. Think of it like a LoRA that isn't trained: it changes behavior with zero retraining, and it changes nothing until you tell it to.
DCW stands for Dynamic Consistency Weighting, a technique from NVIDIA's AMAP research group (AMAP-ML/DCW, paper "Elucidating the SNR-t Bias of Diffusion Probabilistic Models"). Its whole pitch is few-step generation that doesn't fall apart. Anyone who's run LCM or Turbo at 4–8 steps knows the failure mode: the image comes out fast but colors go muddy, composition wobbles, details smear. That's not just "low quality" - it's low-frequency error piling up step over step. DCW attacks exactly that.
How it actually works
Here's the part that's genuinely clever. On each denoising step, the node:
- Runs your model normally to get its prediction, then reconstructs the "clean image estimate" (x0) from the noisy latent and the current timestep.
- Splits both the noisy input and that estimate into frequency bands with a single-level wavelet transform - low frequency (color, composition, big shapes) and high frequency (texture, edges).
- Rebuilds the estimate, but only the low-frequency band gets corrected, blended toward the input by an amount that scales with how far along the denoise you are:
low = estimate + strength × (input_low − estimate_low) × t/1000. Early steps lean hard on the input's structure; late steps trust the model. - Converts the fixed estimate back into a prediction (
(input − x0_corrected) / timestep) so the sampler's math still holds, and hands that to the next step.
High-frequency detail is preserved untouched, which is the whole trick - you fix the color/composition drift without sanding off the texture. It also handles 5D video latents (it reshapes to 4D, processes, reshapes back) and pads odd-sized latents so the wavelet transform doesn't choke.
The inputs that matter
There are only three, and one of them you'll leave alone:
- model (required) - your MODEL. Feed it the output of your checkpoint/UNET loader.
- strength (FLOAT, 0–4, default 1.0) - the correction intensity. The README's guidance: 0.3 for ultra-fast 8-step generation, 1.0 for medium, 2.0+ is heavy and can artifact at very low steps. 0.0 is a clean passthrough, which makes A/B testing trivial.
- wavelet (haar / db2 / db3, default haar) - the wavelet basis.
haaris fastest and a good default;db2preserves a bit more detail;db3is maximum detail but slower. In practice: start with haar, switch if you're chasing fine texture.
The single output is a patched MODEL - wire it straight into your sampler.
Installing it
ComfyUI Manager can find it if you search for "DCW", or do it by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/DawnW0lf/ComfyUI-DCW-Diffusion-Color-Wavelets-Node.git
cd ComfyUI-DCW-Diffusion-Color-Wavelets-Node
pip install -r requirements.txt
Then restart ComfyUI. One README trap: its install section says cd comfyui-dcw, but no such directory exists - the folder is the repo name above. Don't be alarmed when cd fails.
Gotchas worth knowing
- The dependency that bites:
pytorch_wavelets. It's a compiled package built against your installed PyTorch, and it's the most likely thing to fail during install (PyWavelets, the other dep, is a boring wheel). If pip's build errors out, the usual fix is building it from source against your torch version. - This is brand-new, barely-adopted code. As of writing there's essentially no community chatter about it - v1.0.0, one node, one author. Treat it as research code: A/B it against your normal workflow before you trust it.
- Silent failure mode is silent. If something goes wrong mid-generation, the wrapper catches the exception, prints
[DCW FATAL ERROR]to your ComfyUI console, and returns the unpatched output. So if your results look identical and you're not watching the console, it might be failing every step without telling you. - The license is non-commercial. CC-BY-NC-SA 4.0, inherited from the NVIDIA research code. Fine for personal use and experiments; a hard no for selling what you make with it unless you get permission.
Where does it shine? Paired with a distilled/fast model at low step counts - that's the regime where low-frequency drift is worst and DCW has the most to fix. At 20+ steps on a full model you probably won't notice it, because you didn't have the problem in the first place.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| strength | FLOAT | 1.000–4 | — |
| wavelet | COMBO | haar | 3 options: haar, db2, db3 |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |