Nodes/WAS_Extras/WAN 2.2 Exposure Stabilizer
ComfyUI Node

WAN 2.2 Exposure Stabilizer

Fixing Wan 2.2's brightness drift on long generations

By WASasquatch·Created 3 years ago·Updated 17 days ago· 43
WAN 2.2 Exposure Stabilizer
  • images
  • images
  • report
anchor_modemiddle
ref_tail_frames12
anchor_center0.55
anchor_window16
correct_endsstart_and_end
tolerance_ev0.10
stable_count4
max_correct_frames20
proxy_size96
gain_min0.70
gain_max1.30
gain_smooth_window5
clip_low0.00
clip_high1.00

If you've extended a Wan 2.2 generation past its native length - chaining clips with SVI, stitching last-frame-to-first-frame, or any of the other tricks the community uses to get past the ~5-second wall - you've probably watched the clip visibly brighten or shift tone as it goes, especially near the seams between segments. That's a real, reported symptom, not something you're imagining. WAN 2.2 Exposure Stabilizer measures it per frame and corrects it, instead of you eyeballing a brightness curve fix in post.

How it works

It computes per-frame log-luma statistics (a proxy for perceived brightness) across your image batch, picks a reference exposure from either a window of frames in the middle of the clip (anchor_mode=middle, the default - sensible when both the start and end are prone to drifting) or the last few frames (anchor_mode=tail, when you already know the ending is stable), and works out a per-frame gain that pulls outlier frames back toward that reference. The gain curve is temporally smoothed so it doesn't visibly "pump," and clamped by gain_min/gain_max so correcting a frame can't itself blow out highlights or crush shadows. It also does settle detection - once a run of consecutive frames is inside tolerance, it stops touching them - and hard-caps how many frames near the start or end it's allowed to correct at all.

The inputs and outputs that matter

Beginner-relevant first:

  • images (IMAGE, required) - your frame batch.
  • anchor_mode (middle default, or tail) - pick based on which part of the clip you actually trust as a reference.
  • correct_ends (start_and_end default, or start_only) - turn off tail correction if you know the ending is already fine.
  • max_correct_frames (default 20) - the hard ceiling on frames touched; set to 0 to disable correction entirely and just get stats back.
  • tolerance_ev (default 0.1) - how strict "stable" means, in exposure stops. Lower catches more drift but corrects more frames.
  • gain_min/gain_max (default 0.7/1.3) - the safety rails on how hard any single frame's gain can be pushed.

More advanced tuning fields, each with its own tooltip: ref_tail_frames/anchor_center/anchor_window (sizing the reference window), stable_count (how many consecutive in-tolerance frames counts as "settled"), proxy_size (downscales frames before measuring luma, for speed), gain_smooth_window (temporal smoothing of the gain curve), and clip_low/clip_high (clamp used only when computing stats, never applied to actual output pixels).

Outputs: images (the corrected batch) and report (STRING) - a human-readable summary of the exposure deltas and gains it computed. Worth wiring into a text/preview node the first time you use this, so you can see whether it actually found and fixed drift or decided your clip didn't need it.

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 model downloads, no extra dependencies.

Common issues & troubleshooting

Nothing changed. Check report first - if the drift was already inside tolerance_ev, or happened outside the reach of max_correct_frames, the node may have correctly decided there was nothing to fix. Lower tolerance_ev or raise max_correct_frames and re-check.

Visible pumping / over-correction. Raise gain_smooth_window so the gain curve reacts less abruptly between frames, or narrow gain_min/gain_max.

Wrong reference chosen. If you're on anchor_mode=tail but the tail also drifts, switch to middle, or tighten anchor_window/ref_tail_frames down to a stretch of frames you're actually confident is flat.

Don't expect this to fix everything about long Wan 2.2 clips. It corrects overall per-frame brightness/exposure - it isn't a general deflicker for shifting textures or identity drift across segments, which is a separate, harder problem the wider community is still chasing workarounds for.

CategoryWAS/Video

Inputs (15)

NameTypeDefaultDescription
imagesIMAGE
anchor_modeCOMBOmiddleHow the exposure reference is chosen. middle: use a window around anchor_center as the reference (recommended for WAN drift at BOTH start/end). tail: use the last ref_tail_frames as the reference (useful when the end is known-stable).
ref_tail_framesINT121–256Only used when anchor_mode=tail. Number of final frames sampled to compute the reference exposure (median log-luma). Increase if the tail is stable but noisy; decrease if the tail contains fades/changes.
anchor_centerFLOAT0.550–1Only used when anchor_mode=middle. Normalized position (0..1) for the center of the anchor window. 0.50 anchors the middle; 0.55 biases slightly later if the beginning is more unstable.
anchor_windowINT161–256Only used when anchor_mode=middle. Number of frames in the anchor window used to compute the reference exposure. Larger is more robust, but avoid spanning major scene changes.
correct_endsCOMBOstart_and_endWhich regions to correct. start_only: correct only the initial transient until it settles. start_and_end: also correct tail drift if the last stable_count frames are outside tolerance_ev.
tolerance_evFLOAT0.100–2Stability tolerance in exposure stops (EV). Lower = stricter (detects drift longer, may correct more frames). Higher = more forgiving (corrects fewer frames, less risk of reacting to content changes).
stable_countINT41–64How many consecutive frames must be within tolerance_ev to be considered stable. Higher values reduce false-stability on noisy sequences but may delay settle detection.
max_correct_framesINT200–512Hard cap on how many frames can be corrected at the start and (if enabled) at the end. 0 disables correction entirely (stats/report only).
proxy_sizeINT960–512Downscale size used to compute luminance statistics. 0 uses full resolution (slower). 64–128 is usually sufficient and much faster.
gain_minFLOAT0.700.05–2Minimum allowed exposure gain applied to any frame. Lower values allow stronger darkening correction but can crush highlights if too low.
gain_maxFLOAT1.300.05–4Maximum allowed exposure gain applied to any frame. Higher values allow stronger brightening correction but can clip highlights if too high.
gain_smooth_windowINT51–51Temporal smoothing window for the per-frame gain curve. Use odd values. Larger values reduce pumping but can lag real drift. The anchor window is forced to gain=1.0 after smoothing.
clip_lowFLOAT0.000–0.5Luminance clamp floor used ONLY for computing stats (not applied to output pixels). Raise slightly (e.g., 0.02–0.05) to reduce influence of deep blacks/noise on exposure estimation.
clip_highFLOAT1.000.5–1Luminance clamp ceiling used ONLY for computing stats (not applied to output pixels). Lower slightly (e.g., 0.98–0.995) to reduce influence of specular peaks on exposure estimation.

Outputs (2)

NameTypeDescription
imagesIMAGE
reportSTRING