Nodes/comfyui_cv/CV Batch → Image Batch
ComfyUI Node

CV Batch → Image Batch

Converts a batched NPARRAY ([B,H,W,C] or [B,H,W]) back to a ComfyUI IMAGE batch. The inverse of 'Image Batch → CV Batch'. For BGR uint8 input (the standard cv2 path) the default settings work directly. 'RGB' keeps the channel order for data that is already RGB-ordered; both BGR and RGB round-trip through uint8. 'RAW' converts nothing and passes values as-is (for HDR or out-of-range data). 4-channel BGRA input yields an IMAGE batch plus an alpha MASK batch. A single [H,W] mask is wrapped to a one-frame batch; a 3-D [H,W,C] single frame is read as a [B,H,W] gray batch — use 'CV Array → Image' for single color frames.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
CV Batch → Image Batch
  • nparray
  • image
  • alpha
channel_orderBGR (OpenCV default)
Categoryimage/CV/low-level

Inputs (2)

NameTypeDefaultDescription
nparrayNPARRAYBatched ndarray: [B,H,W,C] or [B,H,W]. A single [H,W] mask is wrapped to a one-frame batch; a 3-D [H,W,C] single frame is read as a [B,H,W] gray batch — use 'CV Array → Image' for single color frames.
channel_orderCOMBOBGR (OpenCV default)How to interpret 3/4-channel data. BGR: standard cv2→IMAGE conversion (BGR→RGB, uint8→float32 0..1). RGB: skip channel swap, clamp to 0..1 — for float32 BGR from cv2 arithmetic where values stay in range. RAW: no conversion at all, values as-is — for HDR or arithmetic results outside 0..1.

Outputs (2)

NameTypeDescription
imageIMAGEIMAGE batch [B,H,W,C] float32 RGB 0..1 (RAW mode may exceed 0..1).
alphaMASKAlpha MASK batch from BGRA input (all-255 opaque when input is RGB/BGR).