Image YUV to RGB
The other half of ComfyUI's luminance-and-color trick
- Y
- U
- V
- IMAGE
On its own, Image YUV to RGB is a node with three inputs and one output that you'll never touch. Paired with its sibling Image RGB to YUV, it's the reason the color-grading trick in ComfyUI works at all. It rebuilds a full RGB image from three separate Y, U, and V channels - which is exactly what you want when you've split images apart, mixed their luminance and color between them, and now need to put the result back together.
How it works
The mechanism is worth understanding, because it tells you what inputs it actually expects. For each of Y, U, V, the node first takes the mean across the channel dimension - so a 3-channel input collapses to a single per-pixel value. Then it stacks the three into one tensor and runs kornia's ycbcr_to_rgb, the BT.601 inverse of what the RGB-to-YUV node does, clamping the result to [0,1].
That mean step is deliberate. When Image RGB to YUV outputs its channels, each one is expanded to a full 3-channel IMAGE tensor (so you can wire them anywhere), and the mean collapses those back to the single value they really contain. Feed it that node's output and the reconstruction is clean. Feed it three arbitrary full-color photos and the mean quietly turns each one into its own gray average - the result is a muddy, desaturated mess, and you'll have no idea why.
Why you'd reach for it
It's the "put it back together" half of a two-node workflow. The thing people actually build with it is luminance-preserving recoloring:
- Split image A and image B with Image RGB to YUV.
- Keep A's Y (the lighting and detail), take B's U/V (the color).
- Rebuild here.
The output keeps A's structure while wearing B's palette. It's the honest, deterministic way to do "recolor without destroying detail" in the graph - the kind of move people doing film-style grading reach for when they want to keep an original's luminance and borrow chrominance from an AI-regraded version. A byproduct of the same construction: convert to YUV, drop U/V (or zero them at the 0.5 midpoint), rebuild, and you've got a controlled grayscale.
Inputs and what to feed them
Three inputs, all IMAGE, labeled Y, U, V, and one IMAGE output. The only real rule is that each input should be a flat channel - a single value per pixel, which is what Image RGB to YUV produces. If your U input is actually a full-color photo, you're asking the node to average it into a gray wash. Keep each wire fed from a matching YUV split and you can't go wrong.
The honest caveats
The round trip is not lossless. The conversion math plus the inverse's clamping means RGB → YUV → RGB shifts colors slightly and clips anything that lands outside [0,1]. It's a processing tool, not a lossless container - don't use it as a storage format.
Wire order matters. The three inputs are labeled and the node doesn't care about the semantic meaning of "Y" beyond the math, so if you swap U and V between two images, you get a hue-flipped grade rather than a subtle recolor. Which, to be fair, is also a trick people use on purpose.
Where it lives
Ships with ComfyUI core, added alongside Image RGB to YUV in March 2025 - no install, no model files. Find it under Image → Color, or search "color space conversion." It's a boring-looking node, but it's the one that turns the whole luminance-swap idea from a Photoshop chore into a two-wire edit in your graph.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| Y | IMAGE | — | |
| U | IMAGE | — | |
| V | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |