Nodes/RyanOnTheInside/Flex Image Contrast βš‘πŸ…‘πŸ…žπŸ…£πŸ…˜
ComfyUI Node

Flex Image Contrast βš‘πŸ…‘πŸ…žπŸ…£πŸ…˜

Reactive contrast and brightness that behaves

By ryanontheinsideΒ·Created 2 years agoΒ·Updated 5 months agoΒ· 852
Flex Image Contrast βš‘πŸ…‘πŸ…žπŸ…£πŸ…˜
  • images
  • opt_feature
  • IMAGE
β—„strength1.00β–Ί
β—„feature_threshold0.00β–Ί
β—„feature_paramβ–Ύβ–Ί
β—„feature_moderelativeβ–Ί
β—„contrast1.00β–Ί
β—„brightness0.00β–Ί
β—„preserve_luminositytrueβ–Ί

The plainest of RyanOnTheInside's image nodes, and honestly one of the more useful ones day to day - it's just contrast and brightness, but with the option to have either one driven by a reactive Feature instead of sitting fixed for a whole clip. Think a subtle contrast pump that tracks a kick drum, or a brightness lift that follows overall scene motion.

How it works

contrast (0–3, default 1) is a straight multiplier: 1 is unchanged, below 1 flattens the image toward gray, above 1 pushes lights and darks further apart. brightness (-1 to 1, default 0) shifts the whole image up or down. preserve_luminosity (on by default) keeps the image's overall perceived brightness roughly constant while contrast is being pushed around - without it, cranking contrast tends to visibly darken or brighten the average image as a side effect, which usually isn't what you want if contrast is the only thing you meant to change.

Any one of the three can be the modulation target: feature_param picks contrast, brightness, preserve_luminosity, or None for no modulation. Note that preserve_luminosity is a boolean under the hood, so if a feature is driving it, what actually happens is that feature crossing some effective threshold flips the setting rather than smoothly scaling it - this is one of the rare Flex parameters where "modulation" behaves like a toggle rather than a dial. feature_mode (relative/absolute) and feature_threshold work as they do across the rest of the pack, and strength scales overall pull.

Inputs and outputs that matter

  • images - required.
  • contrast and brightness - the two dials that matter; adjust these by hand first before adding feature modulation, so you know your baseline look.
  • preserve_luminosity - leave it on unless you specifically want brightness to drift as a side effect of contrast changes.

Output is a single IMAGE.

How to install it

Via ComfyUI Manager, search "RyanOnTheInside." Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/ryanontheinside/ComfyUI_RyanOnTheInside
cd ComfyUI_RyanOnTheInside
pip install -r requirements.txt

then restart. No model files, no heavy dependency specific to this node - it's a basic tensor operation.

Common issues & troubleshooting

Image gets noticeably darker or brighter just from raising contrast. That's preserve_luminosity being off. Turn it back on if you want contrast and brightness to behave as independent controls rather than bleeding into each other.

Feature-driven preserve_luminosity feels like it "snaps" instead of ramping smoothly. That's expected - it's a boolean setting, so a feature driving it is really just flipping it on or off past some point in its range, not gradually blending between the two states. If you want a smooth reactive brightness effect, drive brightness or contrast with the feature instead and leave preserve_luminosity fixed.

Contrast pushed high looks blown out or crushed rather than punchy. contrast can go up to 3, which is an aggressive multiplier - most usable looks sit well under 1.5 unless you're deliberately going for a harsh, high-contrast style. Push it gradually and watch your highlights/shadows for clipping.

CategoryRyanOnTheInside/FlexFeatures/Targets/Images

Inputs (9)

NameTypeDefaultDescription
strengthFLOAT1.000–1Overall strength of the effect (0.0 to 1.0) Higher values create more dramatic changes, while lower values are more subtle.
feature_thresholdFLOAT0.000–1Minimum feature value to trigger the effect (0.0 to 1.0) Only applies the effect when the feature value exceeds this threshold. Lower values make the effect more sensitive, higher values make it more selective.
feature_paramCOMBOChoose which parameter to modulate: - contrast: Dynamically adjust contrast level - brightness: Dynamically adjust brightness level - preserve_luminosity: Dynamically toggle luminosity preservation - None: No parameter modulation
feature_modeCOMBOrelativeHow to apply the feature modulation: - relative: Changes are centered around the original value - absolute: Changes scale directly from zero to the maximum
imagesIMAGEInput image sequence to be processed (IMAGE type)
contrastFLOAT1.000–3Controls the amount of contrast adjustment (0.0 to 3.0)
brightnessFLOAT0.00-1–1Adjusts the overall brightness of the image (-1.0 to 1.0)
preserve_luminosityBOOLEANtrueWhen enabled, maintains the overall luminosity of the image
opt_featureoptFEATUREOptional feature input for modulation Connect any feature node here to control the effect. Features can come from audio, motion, color, or other sources.

Outputs (1)

NameTypeDescription
IMAGEIMAGEβ€”