Nodes/Basix Image Filters/Rotate Hue (HSL)
ComfyUI Node

Rotate Hue (HSL)

Recolor the whole image without re-prompting

By maludwig·Created 2 years ago·Updated about a year ago· 6
Rotate Hue (HSL)
  • image
  • mask_opt
  • image
masked_areatrue
degrees15

This is the most powerful node in the pack, and the most fun. Rotate Hue (HSL) takes the hue of every pixel and spins it around the color wheel, like rotating a dial that turns red into cyan and blue into yellow. It's the closest thing here to a genuine image-wide recolor, and the README's example is the killer use case: you want a yellow universe in a bottle, and every time you type "yellow," the model just hands you honey. Recolor the image, don't fight the prompt.

How it works

The node converts the image to HSL, adds your degrees divided by 360 onto the hue channel, and wraps the result modulo 1.0 so the hue keeps looping instead of running off the end. Then it converts back to RGB. Because hue is a circle, a 180-degree rotation maps each color to its complement - red becomes cyan, green becomes magenta, blue becomes yellow. Rotating 360 degrees is a no-op, and negative values spin the other way. Unlike the darken/lighten nodes, hue rotation touches saturation and lightness only through the round-trip conversion, so the image's general tonal character survives; it's the colors that move.

The inputs that matter

  • image - any IMAGE tensor.
  • degrees (default 15, range −360 to 360, step 5) - the hue rotation. Small values like 15–30 give a subtle color-grade; 90 is a dramatic shift; 180 flips to complement colors; negative spins counter-clockwise.
  • masked_area + optional mask_opt - the pack's standard masking, and here it matters more than anywhere else.

Output: one image tensor.

Where people get burned

The README is blunt about it: rotate the whole image and you also rotate skin tones, sky, everything. The author's LoRA example - a model that does green shirts perfectly but chokes on red ones, so you rotate green→red to match what it was trained on - comes with the warning that the person wearing the shirt changes color too. The fix is the mask. Use mask_opt, and toggle masked_area between modify_masked and modify_unmasked to recoloring just the shirt instead of the whole frame.

Also, don't over-rotate and then wonder why the image looks radioactive. This node is strong and it will happily give you technicolor garbage at 180 degrees if the source wasn't built for it. Small nudges (15–45 degrees) are the sweet spot for grading; big rotations are for deliberate effect.

Installing it

ComfyUI Manager → search "Basix Image Filters" (repo basix_image_filters) → install → restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/maludwig/basix_image_filters

Restart after. No models, no keys, no heavy dependencies - pure torch math, and the hue rotate is effectively free to run.

Putting it to work

Hue rotation is a dream img2img hint. Rotate your source image, run it through the sampler at 0.7–0.9 denoise, and the model follows the recolored reference instead of reverting to its training-set color habits. It's also a legitimate color-correction tool on its own: fixing a green cast by rotating a few degrees toward magenta is a classic white-balance move, and you can do it right inside ComfyUI with this node.

CategoryImage Filters

Inputs (4)

NameTypeDefaultDescription
imageIMAGE
masked_areaBOOLEANtrue
degreesFLOAT15-360–360
mask_optoptMASK

Outputs (1)

NameTypeDescription
imageIMAGE