Nodes/Ruucm's ComfyUI Nodes/Ruucm Share Screen
ComfyUI Node

Ruucm Share Screen

Turn your screen into a ComfyUI image input, no print-screen required

By ruucm·Created 2 years ago·Updated 6 months ago· 3
Ruucm Share Screen
  • image_base64
  • default_image
  • image

Ruucm Share Screen is the odd one in this pack: a node whose real work happens in your browser, not in Python. It grabs whatever's on your screen and feeds it into ComfyUI as an IMAGE, live. Think of it as a "capture current screen as input" button for workflows where the thing you want to process is what's on your monitor - a video player, a web app, a game, a second canvas - rather than a file sitting on disk.

How it works

The mechanism is all front-end. The node's extension (borrowed from ComfyUI_zfkun, per the README) uses navigator.mediaDevices.getDisplayMedia - the browser's built-in screen-share API, the same thing Zoom and Meet use. When you add the node you get a "Start Share Screen" button and a live video preview right in the node. Click it, pick the tab, window, or full screen you want, and the browser starts capturing. As the video plays, each frame is drawn to an offscreen canvas, converted to base64 JPEG, and held in a hidden widget. When your prompt runs, that base64 string gets serialized into the workflow, and the Python side decodes it back into a PIL image and returns it as a standard IMAGE tensor.

In the current source, the fancier features from the original - a clip-area selector so you could grab just a region, and an auto-queue loop that re-triggered the workflow whenever the screen changed (via average-pixel-difference) - are present in the code but commented out. So today it's essentially a manual frame-capture node: hit run and you get the current frame.

Inputs and output

  • image_base64 (BASE64) - the captured frame, injected by the front-end widget. You generally don't touch this; it fills itself when you run from the browser.
  • default_image (optional IMAGE) - the fallback. If there's no captured frame (or the base64 is empty), the node uses this instead; if neither exists you get a 512×512 black image.

Output: image (IMAGE) - ready to wire into anything that takes an image. This is an output node, so it works as the source of a preview or the input to a processor.

Installing

Standard pack install:

cd ComfyUI/custom_nodes
git clone https://github.com/ruucm/ruucm-comfy

Restart ComfyUI. The front-end extension lives in the pack's entry/ folder and is registered automatically. Note the README's dev instructions (npm install, npm run build --watch) are only for rebuilding the UI - the shipped dist/ folder means you don't need Node at all for normal use.

The honest limitations

  • It's browser-bound. getDisplayMedia only works in a secure context - localhost or HTTPS. Access it over plain HTTP on a LAN IP and it fails with a browser security error. And it captures what the browser can see, so you have to pick the right tab or window, and whatever you pick keeps showing in your share (and on the node's preview).
  • Only works when run from the browser. Run the workflow via the API, a queue manager, or a headless runner and there's no live frame - you get the default_image or a black box. The captured frame only exists because a real browser tab is holding it.
  • No automation anymore. The auto-queue-on-change behavior is commented out, so "screen → image" is a one-shot grab, not a live video pipe.
  • Browser permission friction. The first time you hit the button, the OS may ask for screen-recording permission; on macOS that's a System Settings approval, not just a browser dialog.

Who's this for? If you've built image-processing pipelines (upscale this, inpaint that) and keep having to save screenshots to disk and load them - this removes the round trip. For anything more ambitious, treat it as a building block with a browser-shaped constraint: it only works as well as the tab you're showing it.

Categoryruucm 🎾

Inputs (2)

NameTypeDefaultDescription
image_base64BASE64—
default_imageoptIMAGE—

Outputs (1)

NameTypeDescription
imageIMAGE—