Nodes/ComfyUI-IC-Light/Background Scaler
ComfyUI Node Runs on cloud

Background Scaler

Flattening a background before IC-Light gets to it

By kijai·Created 2 years ago·Updated about a year ago· 1,158
Background Scaler
  • image
  • mask
  • IMAGE
scale0.500
invertfalse

This is the smallest, plainest node in the pack - and it isn't a relighter itself. Per its own description, all it does is set the masked area of an image toward a grayscale value. That sounds almost too simple to bother writing about, but it earns its place here because IC-Light is sensitive to what's around your subject: a plain, controllable gray backdrop gives it a more predictable and consistent lighting cue than whatever background happened to be in your source photo, or than a noisy, colourful one you'd otherwise feed into the fbc path.

How it works

Give it an image and a mask, and it nudges the masked region toward gray by an amount and direction you control with scale. That's the entire mechanism - no model, no relighting math, just controlled desaturation of a region you've already isolated.

The inputs and outputs that matter

  • image (IMAGE) - the picture you're prepping.
  • mask (MASK) - required, and it's doing the real work here: everything the calculation touches is scoped to what this mask covers.
  • scale (default 0.5, range −10 to 10) - how far, and in which direction, to push the masked area toward gray. This isn't a simple 0–1 opacity slider - the range goes well past 1 and into negative territory, so treat the default as a starting point and nudge from there rather than assuming a fixed scale.
  • invert (BOOLEAN, default false) - flips which side of the mask gets scaled.

Output is a single IMAGE.

How to install it

Same pack, same steps: ComfyUI Manager, search "IC-light", install, restart - or clone manually with git clone https://github.com/kijai/ComfyUI-IC-Light into ComfyUI/custom_nodes. Nothing extra to download for this node; it's pure image math.

Common issues & troubleshooting

Nothing visibly changes. Check the mask first - if it doesn't cover the region you expect, BackgroundScaler has nothing to act on. This is the usual culprit far more often than scale being wrong.

The wrong region got scaled - your subject went gray instead of the background. That's invert doing the opposite of what you assumed. Flip it and rerun.

Not sure how far to push scale. There's no "correct" value - it depends on how neutral you want the backdrop and how strong your mask is. Start near the default (0.5) and move in either direction; because the range extends to 10 and −10, small early steps are safer than jumping straight to an extreme.

Where this actually fits: pair it with a background-removal node (rembg or BiRefNet are the usual choices) upstream to generate the mask automatically instead of hand-painting one every time, then use BackgroundScaler to flatten what's left before it goes into LoadAndApplyICLightUnet's pipeline - either as a cleaner plate for the foreground-only fc model, or as a controlled input for fbc's background conditioning, where a less chaotic background means less colour bleeding into your subject.

CategoryIC-Light

Inputs (4)

NameTypeDefaultDescription
imageIMAGE
maskMASK
scaleFLOAT0.500-10–10
invertBOOLEANfalse

Outputs (1)

NameTypeDescription
IMAGEIMAGE