HD Image Levels
ComfyUI Node Guide
- image
- IMAGE
If you've ever dragged the black/gray/white sliders under a histogram in Photoshop or GIMP, you already know exactly how this node works - it's a Levels adjustment, full stop, ported straight into ComfyUI's graph. No neural network, no model to load, just three numbers remapping the tonal range of an image. It's the kind of unglamorous utility that doesn't get its own tutorial anywhere because there's nothing to explain beyond "move the number, see the effect."
What it does. Levels remaps the brightness range of your image using three control points, all on the familiar 0-255 scale even though ComfyUI's tensors work in 0-1 internally under the hood: black_level sets the point that gets crushed to pure black (raise it above 0 and you clip shadow detail - everything darker than the value goes flat black), white_level sets the point that gets blown out to pure white (lower it below 255 and you clip highlights the same way), and mid_level is the midtone/gamma point sitting between them - nudge it down and the midtones brighten without touching your black and white points, nudge it up and they darken. It's the same three-point control you'd use to punch up contrast or rescue a flat, washed-out image, and the defaults (0, 127.5, 255) are a no-op - a straight, unmodified pass-through.
Where it fits in the pack. The hd_node README frames this pack's second stated purpose as "adjust image levels, then decide whether to brighten" - which tells you this node is the mechanical half of that idea. The deciding part (some check on the result that determines whether more brightening is warranted) isn't exposed as its own node in this pack's schema, so treat that as logic the author wired up in their own workflow rather than something HD Image Levels does for you. What you get here is the adjustment itself: feed it an image and three numbers, get a re-leveled image back.
The one input that actually matters. In practice you'll touch mid_level far more than the other two - it's your brightness dial with the least risk of clipping detail you want to keep. Reach for black_level and white_level only when you deliberately want to crush shadows or blow out highlights (say, punching up contrast on a flat-looking crop before a detail pass), because both of those are lossy: information outside the new range doesn't come back.
Installing it. Standard pack install: search "hd-nodes-comfyui" or "HD Nodes" in ComfyUI Manager, or clone it by hand - cd ComfyUI/custom_nodes && git clone https://github.com/xiaoxiaodesha/hd_node - then restart ComfyUI. This particular node does zero face detection and needs nothing exotic to run, but the pack as a whole has one hard dependency (insightface, for the face-detection node elsewhere in this same pack) that the README makes non-optional at install time. If HD Image Levels isn't showing up in your node search after a restart, that's the first thing to check - a failed insightface import can take the entire pack down with it, not just the node that needed it. See the HD-FaceIndex article in this series if you land there.
Troubleshooting. There isn't much to go wrong with a three-number remap, which is honestly the appeal. The failure mode worth knowing about is the same one that trips people up in Photoshop: setting black_level and white_level too aggressively looks like a nice contrast boost on screen and then bites you the moment you feed the result into anything downstream that expected the original tonal range - a face-detail pass, a color-matching step, another Levels call stacked on top. If a later stage in your workflow starts producing odd results after adding this node, back off the black/white points first before assuming the problem is somewhere else in the graph.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| black_level | FLOAT | 0.00–255 | — |
| mid_level | FLOAT | 127.50–255 | — |
| white_level | FLOAT | 255.00–255 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |