OpenCV detailEnhance_0
Detail enhancement that doesn't blow out your edges
- src
- dst
- nparray
detailEnhance_0 is OpenCV's cv2.detailEnhance wrapped as a node - a "smart" sharpening pass that pops texture and fine detail without the halo-ridden mess you get from a naive sharpen filter. If your render looks soft and you want to pull up skin grain, fabric weave, or product surface texture without re-rolling the generation, this is one of the better first stops.
The mechanism is worth understanding because it's why this beats a plain unsharp mask. detailEnhance runs a domain transform filter: first it smooths the image while preserving edges (sigma_s controls how much spatial smoothing, sigma_r controls how sensitive the filter is to color differences - treat anything with a large color step as an edge to keep). Then it subtracts the smoothed version from the original to isolate the high-frequency detail, amplifies it, and adds it back. It's the same blur-and-add-back recipe as unsharp masking, but the smoothing respects edges, so you get detail without halos on the boundaries. That's the whole selling point, and it's why this lives in the deterministic post-processing layer - a millisecond operation, not a diffusion pass.
The inputs that matter:
src- your image as an NPARRAY (see below).sigma_s- spatial smoothing, range 0–200. Higher = smoother base = more detail pulled out. Start around 10–30; past ~60 things start looking waxy.sigma_r- color-range sensitivity, range 0–1. Lower means more of the image counts as "edge" and is preserved; higher flattens more. 0.1–0.2 is a sane starting zone.
The optional dst input is an OpenCV out-parameter - leave it disconnected. The node returns the result anyway, and the README explicitly says to avoid the out-parameters in this pack.
Output: one nparray - the enhanced image. Wire it into Nparrays2Image to get a ComfyUI IMAGE back.
The catch, and it's the pack-wide one: every image node here expects an NPARRAY, not a Comfy IMAGE. You must convert with the pack's Image2Nparray before this node (it flips RGB→BGR and scales 0–255), and Nparrays2Image after. And the pack only supports batch_size==1 - if you get Only images with batch_size==1 are supported!, split your batch with ImageFromBatch (length=1) first.
Installing: the node ships in geroldmeisinger/opencv-comfyui - Manager → search "OpenCV", or:
cd ComfyUI/custom_nodes
git clone https://github.com/geroldmeisinger/opencv-comfyui
restart, and make sure opencv-contrib-python is installed (pip install opencv-contrib-python). If you get Cannot import name 'guidedFilter' from 'cv2.ximgproc', you've got conflicting OpenCV wheels and need to sort that before any node in the pack will load.
detailEnhance_1 is the same function as a separate node - the pack generates one per OpenCV overload and both collapse to the same NPARRAY path here, so use whichever you happen to grab. Don't expect detailEnhance to fix a genuinely mangled face - that's what a detailing pass is for. This is the finishing touch for an image that's already basically good.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| src | NPARRAY | — | |
| sigma_s | FLOAT | — | |
| sigma_r | FLOAT | — | |
| dstopt | NPARRAY | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| nparray | NPARRAY | — |