- 图像输出
- 时间戳
This is the node that turns ComfyUI into a live video filter. FlowCV's 摄像头输入 node (class FCV_CAM) grabs a frame from your webcam and feeds it into the graph as a CVIMAGE, and because it re-executes every run, you can chain it into real-time pipelines - think webcam-to-image-to-diffusion, or live edge detection on whatever's in front of you. People have been doing exactly this kind of thing with LCM-style low-step models since 2024; the webcam-to-image trick is a known hobbyist obsession, and this is one of the few packs that hands you the camera part as a single node.
The honest caveat: nobody's getting cinematic frame rates here. Camera-capture + OpenCV preprocessing + a diffusion pass adds up, and community reports of webcam workflows settle around a few frames per second even on decent GPUs. Use it for what it's good at - grabbing a frame, experimenting, interactive demos - and don't expect 60fps.
How it works
The node holds an OpenCV VideoCapture open for the life of the ComfyUI session (it's stored on the node instance, released when the node is destroyed). Each execution reads one frame via cap.read(), and the pack's auto-registration means every queue run grabs a fresh one. The IS_CHANGED hook returns the current time, which forces re-execution even when inputs haven't changed - that's the trick that makes "live" feel live.
Three inputs:
- 摄像头索引 (camera index, default 0) - which device; 0 is your default webcam, and devices get higher numbers if you have several.
- 宽度 / 高度 (width/height, defaults 640×480) - requested capture resolution. OpenCV treats these as requests; your camera may or may not honor them exactly.
Two outputs: 图像输出 (a CVIMAGE frame) and 时间戳 (a FLOAT timestamp that updates every run - handy if you want a changing value to drive other logic).
The error path is worth knowing: if the camera can't open or read fails, it returns a black frame labeled "Camera Error" rather than crashing. So a black image with red text isn't a bug, it's the node telling you the device is busy.
Wiring it up
The frame is a CVIMAGE (BGR numpy), so it plays directly into the pack's other nodes - run FCV_Canny or a threshold on live video, or convert with FCV_CVToIMAGE to feed the frame into a diffusion pipeline. Note the capture is held open until ComfyUI restarts or the node is destroyed; if a second process grabs the camera, expect the error frame.
Installing
Bundled in FlowCV - ComfyUI Manager, search "FlowCV"; or:
cd ComfyUI/custom_nodes
git clone https://github.com/Koren-cy/FlowCV
Restart ComfyUI. Dependencies: opencv-python, numpy, pyserial. Your OS still needs a working camera driver (OpenCV uses V4L2 on Linux, DirectShow on Windows) - that's outside the pack's control. The README notes the project migrated to ComfyUI_For_Academic, so this repo is archived.
Gotchas
Webcam is a single-user resource: two browser tabs or two nodes both reading index 0 will fight, and the loser shows the error frame. Camera permission matters - on Linux you usually need to be in the video group. And remember the pack-wide quirk: exceptions print a Chinese message to the console and return the black error frame. If you see it, check the terminal for the real reason.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| 摄像头索引 | INT | 00–10 | 摄像头设备索引,通常0为默认摄像头 |
| 宽度 | INT | 640320–3840 | 图像宽度 |
| 高度 | INT | 480240–2160 | 图像高度 |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| 图像输出 | CVIMAGE | openCV(ndarray)格式的图片 |
| 时间戳 | FLOAT | 当前的时间戳 |