Batch Normalize (Image)
Kill per-frame brightness flicker across a batch
- images
- IMAGE
Anything that processes a video frame-by-frame instead of frame-aware is prone to flicker - each frame drifts slightly in brightness or contrast independently, and the sequence looks like it's subtly pulsing even though nothing in the actual content changed. It shows up constantly in this ecosystem: frame-by-frame depth estimators flicker where video-native ones don't, and even mature upscalers report visible flicker at batch-processing boundaries. Batch Normalize (Image) is a lightweight statistical fix for exactly that class of problem, specific to brightness/contrast: per the README, it "normalizes each frame in a batch to the overall mean and std dev, good for removing overall brightness flickering."
It computes the mean and standard deviation across the whole batch, then nudges every individual frame toward matching that shared statistic. It's not a temporal-consistency fix in the deeper sense - it can't fix content that changes frame to frame, only pull each frame's overall tone back toward a consistent baseline.
The one setting
images(IMAGE) - required, your batch/sequence.factor(default 1, -10 to 10) - strength of the pull toward the batch's shared mean/std.1is the sane default and most people won't need to touch it; lower values apply the correction more gently if a full normalize feels too aggressive; negative values would push frames away from the shared statistic instead of toward it, which isn't a use case you'd reach for on purpose.
One output: IMAGE.
What this is and isn't good for
Good for: killing subtle overall brightness/contrast drift across a batch of frames that are otherwise supposed to look consistent - a common artifact when frames were processed independently rather than with temporal awareness. It's cheap, it's a single statistical operation, and it's the kind of fix you drop in near the end of a pipeline without much fuss.
Not good for: real content flicker - if the actual generated content is shifting frame to frame (not just its overall brightness), this node won't touch that; it operates purely on the image's statistics, not its structure. That's a deeper problem that needs either a temporally-aware generation model or dedicated video-consistency tooling, not a batch normalize.
How to install it
ComfyUI Manager: search "ComfyUI-Image-Filters", install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/spacepxl/ComfyUI-Image-Filters
then restart. Dependency is opencv-contrib-python; a cv2 import error on startup is typically a conflicting opencv variant from another node pack, not this pack itself - the author's install.bat/import_error_install.bat fix that on Windows, and manually elsewhere it's uninstalling stray opencv installs and reinstalling opencv-contrib-python alone. No models, negligible compute cost.
Common issues & troubleshooting
Flicker is still visible after running this. If the flicker is in content - shapes, detail, structure shifting between frames - rather than overall brightness, this node genuinely can't fix it; it only touches statistical brightness/contrast, not structural consistency. Confirm the flicker you're seeing is actually a tonal pulse before assuming this is the right tool.
Normalizing pulled the whole batch's brightness somewhere you didn't want. The batch's overall mean/std is computed from every frame in it - if a handful of outlier frames (much brighter or darker than the rest) are in that batch, they'll skew the shared target every frame gets pulled toward. Consider whether your batch actually represents a consistent scene before normalizing across all of it at once.
Effect feels too strong / changes the intended look of some frames. Lower factor below 1 for a gentler pull rather than a full snap to the batch statistics - you don't have to apply the correction at full strength.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| factor | FLOAT | 1.00-10–10 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |