Nodes/WAS Node Suite v3/WAS Latent Detail Boost
ComfyUI Node Runs on cloud

WAS Latent Detail Boost

A high-pass sharpen that runs before you decode

By WASasquatch·Created 3 years ago·Updated 3 days ago· 1,832
WAS Latent Detail Boost
  • latent
  • latent
  • mask
  • mask_preview
sigma_small0.60
sigma_large1.40
gain0.35
limit1.25
rms_sigma1.20
rms_floor0.060
edge_protect0.45
edge_sigma0.80
edge_threshold0.25
edge_softness0.10
preview_mask_scale8
preview_modedetail_mask

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 higher gain.
  • preview_mode (edge_mask / detail_mask) - controls what mask_preview shows 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.

CategoryWAS Suite/Latent

Inputs (13)

NameTypeDefaultDescription
latentLATENTThe latent to enhance. A video latent with a time axis is handled frame by frame.
sigma_smallFLOAT0.600–8The fine end of the detail that is boosted, in latent blocks. Together with sigma_large it picks which size of feature is affected: 0.6 keeps the treatment on the smallest structures. Set to 0.0 to reach the very finest detail, including noise.
sigma_largeFLOAT1.400–16The coarse end of the detail that is boosted, in latent blocks. Widening the gap between it and sigma_small treats larger features as well; 1.4 against 0.6 gives a narrow band that reads as texture. The two are swapped if entered the wrong way round.
gainFLOAT0.350–2How much of the isolated detail is added back. 0.0 leaves the latent alone, 0.35 is a gentle lift, and above about 1.0 the texture starts to dominate the picture.
limitFLOAT1.250.1–8How hard the detail is squashed before it is added, which is what stops a strong edge ringing. High values such as 4.0 flatten the strongest detail to a uniform level; 1.25 keeps most of the variation; 0.1 barely limits at all.
rms_sigmaFLOAT1.200–16How large an area the local amount of contrast is measured over, in latent blocks. It is what lets a smooth sky gain as much texture as a busy tree instead of being left behind. 0.0 measures over the whole frame instead, which restores the plain behaviour of sharpening everything by the same amount.
rms_floorFLOAT0.0600–1A floor under that local measurement, which keeps genuinely flat areas from being amplified into noise. Raise it towards 0.2 if a clear sky or a plain wall comes out grainy; lower it towards 0.0 to treat flat areas as hard as everything else.
edge_protectFLOAT0.450–1How much the enhancement is held back on strong boundaries, which is what prevents dark outlines around objects. 0.0 turns the protection off and skips finding edges at all; 1.0 leaves boundaries completely untouched; 0.45 halves the effect there.
edge_sigmaFLOAT0.800–8Blur applied before boundaries are looked for, in latent blocks. Raise it so that fine texture is not counted as an edge and protected from the very treatment it wants; 0.0 finds the finest boundaries.
edge_thresholdFLOAT0.250–1How strong a boundary has to be to be protected, measured against the strongest one in the picture. 0.25 covers the clear outlines; lower values protect more and enhance less.
edge_softnessFLOAT0.100.0005–1How gradually the protection fades in around that threshold. Small values give a hard-edged protected strip that can be seen; 0.10 fades over a comfortable range.
preview_mask_scaleINT81–16How many preview pixels each latent block becomes. 8 matches the size the latent decodes to on most VAEs, so the preview lines up with the finished picture; 1 gives the small raw map. This affects the preview image only, never the mask output.
preview_modeCOMBOdetail_maskWhich map leaves the node. `detail_mask` shows where detail was added and how much, which is what to watch while setting gain. `edge_mask` shows the boundaries that were protected, which is what to watch while setting edge_threshold.

Outputs (3)

NameTypeDescription
latentLATENTThe enhanced latent, ready for a sampler or a decode.
maskMASKThe chosen map at latent resolution, useful for driving another node from the same areas this one treated.
mask_previewIMAGEThe same map as a viewable image, enlarged by preview_mask_scale.