OpenCV rotate_1
The same 90-degree flips, UMat edition
- src
- dst
- nparray
rotate_1 is rotate_0's duplicate - same cv2.rotate function, same inputs, same outputs, and no behavior you'll be able to tell apart from inside ComfyUI. This one is the UMat overload variant; the pack's generator numbered every OpenCV type-stub overload, so almost every function ships twice. The _0/_1 split is an artifact, not a feature.
What it does
What it does: rotates an image by 90, 180, or 270 degrees, exactly and without resampling. rotateCode is an integer - 0 for 90° clockwise, 1 for 180°, 2 for 90° counterclockwise. Everything else errors. It cannot do arbitrary angles; that's warp-affine territory. It takes src (NPARRAY) and outputs one nparray, plus an optional dst out-parameter you should leave unwired per the pack's README.
Which one to pick
If you're choosing between the two, don't. There is no meaningful difference. Use whichever the workflow you copied uses, or whichever you happen to click first. The only time the variant matters is if you're hand-editing a workflow JSON and see one class name but have the other installed - they're interchangeable, so the swap is harmless.
Installing
cd ComfyUI/custom_nodes
git clone https://github.com/geroldmeisinger/opencv-comfyui
pip install opencv-contrib-python
Install is the pack's standard: ComfyUI Manager → search "opencv-comfyui", or the commands above, then pip install opencv-contrib-python to cover the dependency (it's what requirements.txt declares). No model files.
Gotchas
Same traps as the _0 twin: batch_size must be 1 on the way in (Image2Nparray will refuse a batch), and remember you're moving between Comfy's RGB tensor world and OpenCV's BGR numpy world, so cvtColor sits in between when channel order matters. This article is short on purpose - the interesting version is rotate_0, and it has all the detail. If you came here looking for "how do I rotate an image," you have what you need.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| src | NPARRAY | — | |
| rotateCode | INT | — | |
| dstopt | NPARRAY | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| nparray | NPARRAY | — |