Capture Webcam
Your webcam, straight into the graph, no app required
- image
Some workflows want to be live. Webcam in, a frame gets redrawn, out again, forever. Capture Webcam is the no-companion-app way to do that in ComfyUI: it grabs a single frame from your camera inside the node graph itself and hands it to you as a plain IMAGE. The author's own demo video shows a webcam feed being i2i'd in near-real-time, and this is the node doing the capturing.
It's part of ComfyUI_toyxyz_test_nodes, a personal grab-bag pack from toyxyz - the same person behind the Blender poser / hand-foot-pose ControlNet helper that's been floating around the community since 2023. Think of the pack as "the tools one working artist actually uses," and this node as the fast, direct webcam grabber in it.
How it works
Under the hood it's OpenCV with the training wheels off. The node calls cv2.VideoCapture(select_webcam, cv2.CAP_DSHOW) - that DirectShow flag matters, and it means this is a Windows thing in practice. It then reads two frames on purpose: the first one out of a camera is often warmup garbage with artifacts, so it throws that away and keeps the second.
The frame gets converted BGR→RGB, normalized to 0–1 floats, and returned as a one-image batch tensor. Two details make it work well in live loops:
- It releases the camera in a
finallyblock every run, so it doesn't hold your webcam hostage between queues. - Its
IS_CHANGEDalways returnsNone, which tells ComfyUI "re-run me every time." That's the whole trick behind a live mirror - without it, ComfyUI would cache the frame and your feed would freeze.
The inputs that matter
There's exactly one: select_webcam, an integer 0–10, default 0. That's the index of your camera device - 0 is usually the built-in laptop cam, and secondary USB cams are typically 1, 2, and so on. If you get nothing, try bumping it.
The single output, image (IMAGE), wires straight into whatever you're feeding - a VAE encode for img2img, a ControlNet condition, a KSampler's latent. For a live loop you'll want Auto Queue on (the author says so in the README) and a fast distilled model like an LCM or Turbo variant; at full step counts this becomes a slideshow instead of a mirror.
Installing it
Use ComfyUI Manager: search for ComfyUI_toyxyz_test_nodes, install, restart. Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/toyxyz/ComfyUI_toyxyz_test_nodes
then restart ComfyUI. The node itself only needs OpenCV (plus the pack's shared deps - note the module imports win32gui at load, so pywin32 is a hard requirement even for nodes that don't touch Windows APIs). The CaptureCam app and its setup.bat venv are only needed for the other webcam node, not this one.
Common issues
The author is refreshingly honest here: the README flat-out says this node is unstable compared to Load Webcam Image, and if you're using OBS he recommends that other node instead. Why? Because two programs can't easily grab the same camera - if OBS (or anything else) already has it open, you'll get Error: Could not open webcam. in the console. The camera-busy problem and wrong-index problems are the two things that bite people.
Also worth knowing: the README warns that ControlNet preprocessors chew up a lot of the speed in live loops, so he recommends preparing your ControlNet images with separate tools rather than in the graph. And since the pack needs DirectShow + pywin32, don't expect this node to work on Linux or macOS - the import itself will fail there.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| select_webcam | INT | 00–10 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |