🐳色彩范围
Recolor one color in a photo without touching the rest
- image
- IMAGE
Selective Color (🐳色彩范围) is the Photoshop move in node form: pick a target color, shift its hue, punch its saturation, or lift its brightness - and leave every other color in the image alone. The classic use is recoloring a red car to orange, making a sky bluer without touching the clouds, or nudging a skin tone that's gone too magenta. It's one of those deterministic pixel operations the community does a surprising amount of by hand, and it's exactly the kind of job that should never be a diffusion re-roll.
The mechanism is textbook HSV masking. The node converts the image to HSV (OpenCV's cv2.cvtColor), builds a mask centered on the target hue, and only applies your adjustments where that mask is active. That's what the three adjustment sliders do: 色相偏移 (hue shift, -180 to 180), 饱和度调整 (saturation, -1 to 1), and 明度调整 (brightness/lightness, -1 to 1). Two knobs control how surgical the mask is - 范围宽度 (range width, 10 to 90, default 30) is how wide a band of hues counts as "target", and 羽化程度 (feather, 0 to 1, default 0.5) is how soft the transition at the edge of that band is. Range width up, feather up, and you get a gentle regional tint; both low and you get a hard-edged recolor that will look patchy if the color you're targeting varies across the image.
One wrinkle worth knowing: the node treats white and black specially. For those two targets it ignores hue entirely and builds its mask from luminance instead, so 白色/黑色 are really "adjust the highlights" and "adjust the shadows" - useful for affecting a bright sky or dark clothing that isn't a single hue. The other six targets (red, yellow, green, cyan, blue, magenta) are hue-centered at the classic color-wheel positions.
What to actually set
For most jobs you only touch a few things:
目标颜色- which hue family to act on (the one that matters, since everything is relative to it)范围宽度- start at 30; widen only if the color spans a lot of the wheel (e.g. green foliage is broad)羽化程度- keep it around 0.5 for photo work; drop it if you see color fringing outside your target- Then whichever of hue/saturation/brightness you actually need changed
Input is just image, output is the adjusted IMAGE - so it slots anywhere in a post-VAE pipeline. Batch-safe too: it loops over every frame in the batch.
Where people get burned: on skin. Skin tones are a narrow range but they sit right next to red and magenta, so an aggressive red-target adjustment with a wide range will start eating faces. If you're fixing skin hue, keep range width low and feather high, and check the output on a crop before committing.
Install
Part of the Pond Nodes pack:
cd ComfyUI/custom_nodes
git clone https://github.com/Pondowner857/comfy_Pond_Nodes
cd comfy_Pond_Nodes
pip install -r requirements.txt
Restart after. It needs opencv-python, which the pack's requirements install - if you skipped the full list, make sure opencv is present or this node errors out at the HSV conversion. As always with this pack, the README warns about a console-spam conflict if you also run comfyui_HiDream-Sampler.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| 目标颜色 | COMBO | 8 options: 红色, 黄色, 绿色, 青色, 蓝色, 品红, +2 | |
| 色相偏移 | FLOAT | 0-180–180 | — |
| 饱和度调整 | FLOAT | 0.00-1–1 | — |
| 明度调整 | FLOAT | 0.00-1–1 | — |
| 范围宽度 | FLOAT | 3010–90 | — |
| 羽化程度 | FLOAT | 0.500–1 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |