Image RGB to YUV
Split luminance from color — grayscale, color grading, and the swap trick
- image
- Y
- U
- V
The most useful trick in color work is separating how bright a pixel is from what color it is. That's what Image RGB to YUV does: it takes one RGB image and hands you three images back - a luminance channel (the black-and-white version) and two color-difference channels. The commit that added it to ComfyUI said it in one line: "Can be used to convert an image to black and white." That's the entry point, but the real power is everything you can do once luminance and color are no longer tangled together.
How it works
Under the hood it's kornia's rgb_to_ycbcr, using the classic BT.601 coefficients:
Y = 0.299 * R + 0.587 * G + 0.114 * B
That weighted mix is why the Y output looks like a proper grayscale photo rather than a flat average - the eye is far more sensitive to green than blue, and the coefficients know it. The U and V channels are the color-difference signals: how far each pixel's blue and red deviate from that luminance, centered around 0.5.
A note on the name: it says "YUV," but this is actually the digital YCbCr variant, not the analog YUV used in broadcast video. Same family, slightly different scaling. For anything you'll do in ComfyUI, the difference doesn't matter - the important part is that Y is luminance and U/V are color.
Two details make this node usable in practice. First, each output is a full IMAGE tensor (the single channel is expanded to all three), so you can wire Y, U, or V into any image input - preview them, save them, feed them onward. Second, the outputs are meant to feed back into the sibling Image YUV to RGB node, which reverses the math. The pair was added together in March 2025 as part of ComfyUI's newer schema nodes.
What you'll actually do with it
Grayscale in one wire. Grab the Y output and you're done - no extra desaturation node needed. Luminance-only images are also great fodder for edge and lineart extraction, since they drop the color noise that confuses those models.
The luminance-swap trick. Split image A and image B, keep A's Y, take B's U/V, and rebuild with ImageYUVToRGB. You get "the detail and lighting of A, recolored as B." People doing film-style grading in ComfyUI use exactly this - keep the original's luminance, borrow chrominance from an AI-processed version, and the detail survives while the color changes. That's the color-grading move this family exists for.
Gotchas
Previewing U or V directly looks wrong - they're washed-out green/magenta blobs, because they're differences from a midpoint, not colors. That's normal. Don't feed U/V into a VAE or a model expecting real RGB; they'll just be garbage in.
The round trip isn't lossless. The conversion, the channel handling, and the inverse's clamping all introduce small errors, so RGB → YUV → RGB won't give you a pixel-identical image. Mild color shifts, occasional clipping near the extremes. It's a processing step, not a lossless container.
Where it lives
Ships with ComfyUI core, so there's nothing to install and no model files to fetch. Find it under Image → Color, or search "color space conversion." If you see the Y output in your preview and it's a clean grayscale, it's working exactly as intended - the odd-looking U/V channels are the feature, not the bug.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| Y | IMAGE | — |
| U | IMAGE | — |
| V | IMAGE | — |