Burn Image
Darken shadows, midtones, and highlights like Krita's burn tool
- image
- mask
- IMAGE
"Burn" in image editing is the old darkroom move: darken the shadows without flattening the whole photo. Krita ships burn/dodge treatments for this, and BurnImage is a port of that idea for ComfyUI - with the twist that you can target the shadows, midtones, and highlights independently, and mask the effect to a region. It's post-processing for generations, which is where a lot of output quality actually lives after the sampler hands you a slightly-washed image.
Why you'd reach for it
Generated images often come out a bit flat - the shadows don't sit, the midtones blend together. BurnImage lets you push the shadows down without touching the highlights, which is exactly the fix for "nice image, but it lacks depth." It's the kind of node you chain after VAE decode and before your save node, and it composes with the HueSaturationLightLevels node in the same pack to form a Krita-style finishing pass.
How it works
The node computes a Rec.709 luminance (a weighted sum of R, G, B) for every pixel, then builds three Gaussian weight maps centered on dark, mid, and bright luminance values. Your shadows, midtones, and highlights percentages (0-99) each scale their map, and the sum becomes a darkening factor: each pixel is multiplied by 1 - factor. Higher values in any range darken that range more. The optional mask limits the effect to a region - masked areas keep the original pixels, unmasked areas get burned. It's a clean, well-behaved implementation: clamped, tensor-native, and it handles batches of images as one tensor.
The inputs that matter
- image (IMAGE) - what to burn.
- shadows (INT, 0-99, default 0) - darkening applied to shadow tones.
- midtones (INT, 0-99, default 0) - darkening applied to midtones.
- highlights (INT, 0-99, default 0) - darkening applied to highlights.
- mask (MASK, optional) - restrict the effect. Unused = whole image.
- IMAGE - the darkened result, same shape as the input.
Installing it
The image nodes in this pack import kornia, and here's the gotcha: the pack has no requirements.txt, so kornia isn't installed for you. Get it once:
cd ComfyUI/custom_nodes
git clone https://github.com/LaVie024/comfyui-lopi999-nodes
pip install kornia
Then restart ComfyUI. ComfyUI Manager's "search comfyui-lopi999-nodes" works too - but verify kornia installed, because the whole pack fails to load if this import is missing, not just the image nodes.
Common issues
That kornia import is the big one - if the pack won't load at all, check pip show kornia. On the creative side: burn is multiplicative darkening, so going heavy (99) on shadows will crush blacks; it's a tonal push, not an HDR tool. And if the effect doesn't look like it's working on a masked region, remember the mask semantics - masked areas are the ones changed, not preserved.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| shadows | INT | 00–99 | — |
| midtones | INT | 00–99 | — |
| highlights | INT | 00–99 | — |
| maskopt | MASK | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |