WAS Latent Detail Boost
A high-pass sharpen that runs before you decode
- latent
- latent
- mask
- mask_preview
This pack ships two pixel-space sharpeners (VividSharpen and its V2) that work on decoded images, right before you save. This node does the same conceptual job - a high-pass-style detail boost - but on the latent itself, before decode, using a contrast-limited band-pass technique (Difference-of-Gaussians, the classic "unsharp mask" math) with limiting and edge protection so it doesn't blow out or halo the way naive latent sharpening can.
How it works
sigma_small and sigma_large define a band-pass: two blur radii that get differenced against each other, isolating the frequency band in between as "detail" (narrow-vs-wide is the standard Difference-of-Gaussians approach to detail extraction). gain is the overall boost strength applied to that band, and it's a genuinely conservative default at 0.35 - this node is built to be pushed, not to arrive already strong.
Two limiting systems keep gain from running away. RMS-based limiting (rms_sigma, rms_floor, and the overall limit cap) scales the boost down in regions that already have high local contrast, so already-punchy areas don't get pushed into clipping just because you wanted more detail elsewhere. Edge protection (edge_protect, edge_sigma, edge_threshold, edge_softness) is a separate system specifically targeting hard edges - the same "back off near strong boundaries to avoid haloing" idea this pack's WAS_AdaptiveDifferenceLatentUpscale node uses for latent upscaling, applied here to sharpening instead. Both systems exist so that raising gain past its conservative default doesn't immediately produce the ringing and hard outlines that naive detail-boosting is prone to.
Doing this in latent space rather than pixel space matters if the boosted result needs to participate in a further sampling pass - a second KSampler, a refiner - rather than just being the very last thing before saving.
The inputs and outputs that matter
latent(LATENT) - what you're boosting.gain(default 0.35, range 0–2) - the main strength control. Start here before touching the sigma or limiting parameters.sigma_small(default 0.6) /sigma_large(default 1.4) - the band-pass radii. Leave at default until you have a specific reason to widen or narrow the targeted detail band.edge_protect(default 0.45, range 0–1) - how strongly the node backs off near hard edges. Raise it if you're seeing haloing at highergain.preview_mode(edge_mask / detail_mask) - controls whatmask_previewshows you.
Three outputs: latent (the boosted result, ready for your next sampling stage or a VAE decode), mask (the computed mask as MASK), and mask_preview (an IMAGE visualization - switch preview_mode between detail_mask, to see where boost is being applied, and edge_mask, to see what's being protected).
How to install it
Via ComfyUI Manager: search "WAS_Extras", install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/WASasquatch/WAS_Extras
Restart ComfyUI. No extra dependencies.
Common issues & troubleshooting
Effect is barely noticeable. That's expected at the default gain of 0.35 - this node is deliberately conservative out of the box. Raise gain gradually; the limiting systems are there specifically so you can push it further than a naive sharpener without immediately breaking the image.
Ringing or hard outlines appear at higher gain. Raise edge_protect before backing gain back down - that's the control built specifically to counter this failure mode. Check mask_preview with preview_mode: edge_mask to confirm the node is actually identifying the edges you're seeing artifacts around.
Detail boost looks uneven - strong in some regions, invisible in others. That's the RMS-based limiting doing its job: regions with already-high local contrast get less additional boost by design (rms_sigma/rms_floor/limit). If you want more uniform boosting regardless of existing contrast, that's working against this node's core design rather than a setting to flip off.
Not sure whether to use this or VividSharpen. Use this one when the boosted result needs to feed back into another sampling pass while still in latent form; use VividSharpen or V2 when you're working on already-decoded pixels as the final step before saving.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| latent | LATENT | — | |
| sigma_small | FLOAT | 0.600–8 | — |
| sigma_large | FLOAT | 1.400–16 | — |
| gain | FLOAT | 0.350–2 | — |
| limit | FLOAT | 1.250.1–8 | — |
| rms_sigma | FLOAT | 1.200–16 | — |
| rms_floor | FLOAT | 0.0600–1 | — |
| edge_protect | FLOAT | 0.450–1 | — |
| edge_sigma | FLOAT | 0.800–8 | — |
| edge_threshold | FLOAT | 0.250–1 | — |
| edge_softness | FLOAT | 0.100.0005–1 | — |
| preview_mask_scale | INT | 81–16 | — |
| preview_mode | COMBO | detail_mask | 2 options: edge_mask, detail_mask |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| latent | LATENT | — |
| mask | MASK | — |
| mask_preview | IMAGE | — |