Webcam Input

ComfyUI can grab video from a camera connected to your PC as an image.

Webcam Capture Node

  • 1. Add a Webcam Capture node
  • 2. If your browser asks for permission to use the camera, allow it.
  • 3. Press ▷ Run, and the camera frame at that moment is output as an image.

Capturing Your PC Screen with OBS

With the Virtual Camera feature of OBS Studio, the well-known streaming software, you can send your desktop or a specific window to ComfyUI as if it were a webcam.

This is really an OBS feature rather than a ComfyUI one, but it's handy, so I'm including it.

1. OBS Settings

Install OBS and set up the screen you want to capture.

  • Source Settings (Window Capture)

    • Click + under Sources, choose Window Capture, and pick the app you want (e.g., Paint).
    • Capture Method: If the capture is black, switching to Windows 10 (1903 or later) may fix it (this often happens with drawing apps like Affinity).
    • Cursor: Uncheck "Capture Cursor" if you prefer.
  • Canvas Size

    • Not required, but setting it under Settings → Video to match the resolution you generate at in ComfyUI makes the aspect ratio easier to manage.

2. Start Virtual Camera

Click Start Virtual Camera under Controls at the bottom right of OBS. The OBS output will now show up as a webcam.

3. Loading in ComfyUI

Back in ComfyUI, change the Webcam Capture node's settings.

  • 1. Select OBS Virtual Camera from the camera selection dropdown
    • *If it doesn't show up, reload ComfyUI (F5).
  • 2. Run it, and the OBS screen is captured as an image.

Real-time Execution (Auto Queue)

A normal run is fine if you only need a single still, but if you want AI to transform your drawing in real time, use Run (Instant) from the ▷ Run menu.