OpenCV transform_1
Transform_1 — the same per-pixel matrix node, one number later
- src
- m
- dst
- nparray
transform_1 is transform_0's near-identical twin. Both wrap cv2.transform, which multiplies every pixel by a matrix you supply. The _0/_1 split is an artifact of the pack's generator expanding OpenCV's overload declarations into separate nodes - same function, same inputs, same output, different label. If you picked this page because a workflow references transform_1, you've got the right function; nothing about the number changes how it behaves.
So the real subject here is cv2.transform itself, which is a hidden gem for color work. Give it a 3×3 matrix and it applies that matrix to every pixel's channel values. That single operation covers channel mixing, custom color grading, gain per channel, and a big slice of what people burn diffusion passes on. The KB's post-processing essay makes the case plainly: these deterministic, millisecond operations are the right tool for color correction, and reaching for a model to do a matrix multiply's job is the failure mode this whole layer exists to prevent.
Inputs and outputs that matter
- src (NPARRAY) - the array to transform.
- m (NPARRAY) - the per-pixel transform matrix; columns must equal the channel count (3×3 for a normal BGR image).
Optional dst is OpenCV's out-parameter, exposed for compatibility - leave it disconnected. Output is one nparray.
Note what this node is not: it's not a geometric transform. It recolors values in place; it does not warp, rotate, or move pixels. Reach for the pack's warp/perspective nodes if you need geometry, this one if you need per-pixel math.
Installation
One pack, both twins: ComfyUI Manager (search "OpenCV" or geroldmeisinger/opencv-comfyui), or git clone https://github.com/geroldmeisinger/opencv-comfyui into ComfyUI/custom_nodes, restart. Needs opencv-contrib-python (pip install opencv-contrib-python). No models.
Common issues
The usual suspects, all from the pack README: wrong-shaped m gets you an OpenCV assertion error - match the column count to the channel count. A batched image gets you Only images with batch_size==1 are supported out of Image2Nparray, so split batches first (ImageFromBatch, length=1). And keep in mind the BGR/ RGB split: Image2Nparray hands you BGR, so if your grading matrix was tuned for RGB, apply it after the conversion nodes have done their thing.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| src | NPARRAY | — | |
| m | NPARRAY | — | |
| dstopt | NPARRAY | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| nparray | NPARRAY | — |