๐ผ> Contrast
Punch up a flat generation without a full color-grade graph
- image
- mask_opt
- image
Some checkpoints, especially at lower step counts or with certain samplers, hand you back images that look a little hazy - blacks that aren't quite black, whites that aren't quite white. Contrast is the one-node fix for that, without building out a whole curves/levels graph.
How it works
contrast is a simple scaling factor around the midpoint: 1 leaves the image alone, values above 1 push darks darker and lights lighter, values below 1 flatten everything toward gray. It's the same shape as this pack's Brightness and Saturation nodes, and it takes the same optional mask - so you can punch up contrast globally, or confine it to just your subject after a segmentation step, while the background stays as-is.
The inputs and outputs that matter
image(IMAGE) - required.contrast(FLOAT, 0โ2, step 0.01, default 1) - 1 is neutral, 0 flattens to solid gray, 2 is aggressive high contrast.mask_opt(MASK, optional) - confine the effect to a masked region; leave it out for a global adjustment.imageout.
How to install it
Via ComfyUI Manager: search "yanc" or "ComfyUI_yanc" and install, then restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/ALatentPlace/ComfyUI_yanc
then restart ComfyUI. No extra dependencies or model downloads - a filter node, same as the rest of the pack's post-processing suite.
Common issues & troubleshooting
Nothing changed. contrast defaults to 1, which is a deliberate no-op - the same "neutral by default" pattern as this pack's Brightness and Saturation. Move the slider.
Shadows and highlights clip hard past ~1.3โ1.5. This is a straightforward scale, not a filmic S-curve, so it has no soft rolloff - push it too far and you lose detail in both the darkest and brightest parts of the image rather than getting a gentle punch. Small moves (1.05โ1.2) usually do what people actually want; if the image needs more correction than that, the issue is probably upstream in the generation itself.
Masked contrast creates a visible edge. Same trap as masked Brightness: a hard, unfeathered mask shows its boundary once you push contrast inside it. If the seam is visible, soften the mask itself before wiring it into mask_opt, or generate it from something that already has soft edges, like this pack's own Light Source Mask.
Image and mask resolutions don't match. The standard ComfyUI trap - if your mask came from a different step in the graph at a different size, resize it to match the image first or you'll hit a shape error.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | โ | |
| contrast | FLOAT | 1.000โ2 | โ |
| mask_optopt | MASK | โ |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | โ |