Flex Image Contrast β‘π ‘π π £π
Reactive contrast and brightness that behaves
- images
- opt_feature
- IMAGE
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.contrastandbrightness- 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.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| strength | FLOAT | 1.000β1 | Overall strength of the effect (0.0 to 1.0) Higher values create more dramatic changes, while lower values are more subtle. |
| feature_threshold | FLOAT | 0.000β1 | Minimum 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_param | COMBO | Choose 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_mode | COMBO | relative | How to apply the feature modulation: - relative: Changes are centered around the original value - absolute: Changes scale directly from zero to the maximum |
| images | IMAGE | Input image sequence to be processed (IMAGE type) | |
| contrast | FLOAT | 1.000β3 | Controls the amount of contrast adjustment (0.0 to 3.0) |
| brightness | FLOAT | 0.00-1β1 | Adjusts the overall brightness of the image (-1.0 to 1.0) |
| preserve_luminosity | BOOLEAN | true | When enabled, maintains the overall luminosity of the image |
| opt_featureopt | FEATURE | Optional 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)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | β |