OpenCV imread_1
The imread with a dst you should ignore — here's why it exists
- dst
- nparray
imread_1 loads an image from a filesystem path as a numpy array - same job as imread_0, with one extra input: a dst out-parameter that you should almost certainly leave disconnected.
This pack auto-generates a node per OpenCV function overload, and OpenCV's imread stub has three variants: the plain imread(filename, flags), plus two that include an optional dst output array that OpenCV would fill instead of allocating one. So imread_1 and imread_2 exist because the type stubs listed those overloads, not because they're useful to you. In the generated source both call cv2.imread the same way - imread_1 and imread_2 are identical to each other, and the only difference from imread_0 is the extra optional dst socket.
Which means: reach for imread_0. The README's explicit advice for the whole pack is to avoid the optional out-parameters (usually named dst), because the node returns the result through its own nparray output anyway. Wiring dst gets you nothing except a place to trip over type mismatches. imread_1 isn't broken - it just carries an input that doesn't do anything for you in a node graph.
The function itself, if you're new to it: cv2.imread(filename, flags) decodes an image file from a path into a BGR uint8 array. Useful when your file lives outside ComfyUI/input (absolute path, mounted drive, generated filename from a loop) or when you want the OpenCV-native array straight into the rest of this pack without an Image2Nparray conversion in between.
Inputs. filename (STRING) - the path, as the ComfyUI server sees it. Absolute paths are safest. flags (INT) - 1 (IMREAD_COLOR, default 3-channel BGR), 0 (IMREAD_GRAYSCALE), -1 (IMREAD_UNCHANGED, native depth/channels). dst (NPARRAY, optional) - ignore it.
Output. One nparray (NPARRAY) - the loaded image. Convert back with Nparrays2Image.
Installing. ComfyUI Manager → search "opencv-comfyui", or:
cd ComfyUI/custom_nodes
git clone https://github.com/geroldmeisinger/opencv-comfyui
pip install opencv-python-contrib
Restart ComfyUI; the node is under image/OpenCV.
Where people get burned. Same as any imread: a missing file returns None (no error raised), which surfaces downstream as 'NoneType' object has no attribute 'shape' - check the path on the server machine. And the output is BGR, so convert with Nparrays2Image before it touches anything that expects RGB. If you wire dst expecting it to change behavior, you'll be confused; nothing changes. Save yourself the confusion and use imread_0.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| filename | STRING | — | |
| flags | INT | — | |
| dstopt | NPARRAY | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| nparray | NPARRAY | — |