๐ผโ๐ฒ Image to grayscale (black & white)
Convert an image to black & white (and why IPAdapter users want it)
- image
- IMAGE
Exactly what it says: it takes an image and converts it to grayscale. No settings to fuss with beyond one alpha toggle. In the pack's menu it's "Image to grayscale (black & white)."
The obvious use is when you just want a black-and-white image. The less obvious - and honestly more common - use is as a preprocessing step. The author's own example is feeding a grayscale image into IPAdapter to kill the color influence: IPAdapter picks up on the reference image's palette, and stripping the color first lets you borrow the composition or subject without dragging its color scheme along. That's a nice trick to have in your back pocket.
How it works
It desaturates the image - collapsing the RGB channels into luminance so every pixel becomes a shade of gray. Standard grayscale conversion, nothing exotic. The only decision is what to do with transparency, handled by the one toggle below.
The inputs and outputs that matter
image- the image to convert.preserve_alpha- a boolean (default off). Leave it off for a plain grayscale image. Turn it on if your input has transparency you want to keep - otherwise the alpha channel can get flattened along with the color.
Output is a single IMAGE, ready to wire wherever you'd send any image: into IPAdapter, into a preview, into another processing node, or out to a save node.
How to install it
ComfyUI Manager: search Bjornulf_custom_nodes, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/justUmen/Bjornulf_custom_nodes
Restart ComfyUI. This node is a trivial image op and needs none of the pack's heavier dependencies, though running pip install -r Bjornulf_custom_nodes/requirements.txt is fine if you'll use the rest of the pack.
Common issues
There's very little to go wrong here. The one thing to watch is preserve_alpha: if your input image has transparency and you want to keep it (say you're going to composite the grayscale result onto something else), turn the toggle on. If you don't care about transparency, leave it off.
Beyond that, just remember grayscale is a one-way trip - this node throws color away, it can't bring it back. If you're using it for the IPAdapter color-suppression trick, put it before the IPAdapter encode, not after; running it on the output does nothing useful. And if you actually wanted a stylized black-and-white look - film grain, a duotone, a moody desaturation that keeps some tone - that's a job for a proper color-grading or LUT node, not this one. This is a flat luminance conversion and nothing more.
That simplicity is also why it's reliable: there are no thresholds to tune, no model to load, no way for it to produce a surprising result. Drop it in, pick whether to keep alpha, and move on. It's the kind of small utility you wire in once and stop thinking about.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | โ | |
| preserve_alpha | BOOLEAN | false | โ |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | โ |