Nodes/Image Misc/Arbitrary Normalize
ComfyUI Node

Arbitrary Normalize

Normalize an image to any mean and std you care to dial in

By set-soft·Created about a year ago·Updated 8 months ago· 2
Arbitrary Normalize
  • image
  • parameters
  • image

The general-purpose member of the pack's normalization family. Where the other normalize nodes are fixed recipes - ImageNet's mean/std, [-0.5, 0.5], [-1, 1] - Arbitrary Normalize takes your mean and standard deviation as an input and applies them, so you can match whatever preprocessing some custom model expects without hunting for the right pre-built node.

The math is the standard per-channel normalization that every vision model's training code uses:

output = (input - mean) / std

one mean and one std per color channel. If you've used torchvision's Normalize transform, this is that, exposed as ComfyUI nodes.

Inputs

  • image - the image tensor, in ComfyUI's usual [0, 1] range.
  • parameters - a NORM_PARAMS value. This is the interesting bit: you don't type numbers here, you wire in the output of the pack's Normalize Parameters node, which gives you six sliders (mean/std for R, G, B). The sliders live on a separate node so you can share, swap, or drive a parameters wire from elsewhere in the workflow.

Output is the normalized image. Be aware the value range changes significantly - output values will fall outside [0, 1], which is fine if the model you're feeding expects normalized input, and a great way to wreck a preview node that assumes display range. If your goal is just to look at the image afterward, put a preview before the normalize, not after.

Installing it

Part of Image Misc, installed with the whole pack:

cd ComfyUI/custom_nodes
git clone https://github.com/set-soft/ComfyUI-ImageMisc
cd ComfyUI-ImageMisc && pip install -r requirements.txt

or ComfyUI Manager → "Image Misc", then restart. Under image/normalization. No extra dependencies beyond the pack's seconohe helper, no models.

The honest take

Realistically, you'll use this node rarely - the pack's three fixed normalize nodes cover the cases most people actually hit, and for ImageNet preprocessing specifically you don't need to think at all. Arbitrary Normalize is for the edge cases: a model card that says "normalize with mean (0.7, 0.5, 0.3), std (0.2, 0.2, 0.2)" and no prebuilt node for it. On those occasions it's exactly the tool, and the two-node setup (parameters + apply) keeps the design clean instead of cramming six widgets onto every normalize node. Wire NormalizeParameters into parameters, set your values, and you're done - the only real mistake available is feeding normalized data back into something that expects [0, 1].

Categoryimage/normalization

Inputs (2)

NameTypeDefaultDescription
imageIMAGE
parametersNORM_PARAMS

Outputs (1)

NameTypeDescription
imageIMAGE