Nodes/🐰 MaraScott Nodes/🐰 Image To Gradient - v1 /i
ComfyUI Node

🐰 Image To Gradient - v1 /i

Flatten any image into its own color gradient

By MaraScottΒ·Created 3 years agoΒ·Updated 10 months agoΒ· 179
🐰 Image To Gradient - v1 /i
  • image
  • gradient

Sometimes you don't want the image, you want its mood - the palette and the direction light falls across it. Image To Gradient does exactly that: it takes a photo or render and produces a smooth gradient version of it, keeping the overall color story while erasing the detail. If you've ever hand-made a gradient from a reference image in a design tool to use as a background or a color-palette source, this automates it.

It's a niche utility, and the pack's own changelog calls it exactly that - an "Image to Gradient" introduction with no grand claims. Reach for it when you're building moodboards, extracting a palette for a style-match, or want a low-detail backdrop that still feels like the source image.

How it works

The mechanism is blunt and effective. It takes your image and repeatedly blurs it - 33 passes of a heavy Gaussian-style blur (radius 31, sigma 1.0), which is more than enough to flatten every edge into smooth color regions. Then it runs a color-match operation (from Kijai's ColorMatch, which this pack vendors) to pull the original's exact tones back onto the blurred result, so the gradient doesn't drift in hue. The result is an image that reads as a soft, abstract color field built from the source.

Input: image (IMAGE). Output: gradient (IMAGE) - same dimensions as the input, just detail-free.

Using it

Feed it any image and wire the output into a preview, a Save, or an image mixer as a backdrop layer. Because it preserves the source's color distribution and spatial layout, it works nicely as a color reference: pair it with a color-palette or ImageAnalyzer-style node downstream. It's also a decent quick check of "what are the dominant tones here?" without firing up a dedicated palette extractor. The blur is the whole story - there's no resolution or strength control, so what you see is what you get.

Installing it

Ships in the MaraScott pack: ComfyUI Manager β†’ search "MaraScott" β†’ Install β†’ restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/MaraScott/ComfyUI_MaraScott_Nodes

Then restart. The color-match step is why the pack lists color-matcher and opencv-python in its requirements - both come with the install.

Common issues

The heavy fixed blur means the output can be quite soft, and there's no tuning knob - if you wanted a milder "toned-down" version rather than a full gradient, this isn't that; adjust opacity downstream instead. Big images take noticeably longer because of the 33-pass blur loop, so downscale before feeding it if you're processing a stack. And since it's color-matching a blurred copy back to the original, images with extreme contrast can end up with slightly muddy midtones - again, that's the design, not a bug.

Category🐰 MaraScott/Utils

Inputs (1)

NameTypeDefaultDescription
imageIMAGEβ€”

Outputs (1)

NameTypeDescription
gradientIMAGEβ€”