KJNodes/imagegenerated

Screencap Stream(ScreencapStream)

Captures a frame from a browser screen/window share stream. Click 'Start capture' to select a screen or window to share. Live preview is shown in the node. Works with auto-queue. Crop controls: - Drag on preview to draw a crop box - Drag inside the box to move it - Drag edges or corners to resize - Shift+drag to lock aspect ratio - Right-click or double-click to clear crop

Screencap Stream

image
frame_data
STRING
crop_width
INT
crop_height
INT
KJNodes

Description

Captures a single frame from a browser screen, window, or application tab share stream.
When the node appears in the workflow, a “Start capture” button is shown in the frontend. Clicking it opens the browser’s screen‑share permission dialog; after picking a source, a live preview appears directly in the node.

The node supports interactive cropping:

  • Drag on the preview to draw a crop box.
  • Drag inside the box to move it.
  • Drag edges or corners to resize.
  • Shift + drag to lock the aspect ratio.
  • Right‑click or double‑click inside the preview to clear the crop.

The final output image is the selected crop area, resized to the dimensions given by the crop_width and crop_height inputs.

Works with auto‑queue – when queued repeatedly, the node re‑captures the same screen source on each run (useful for real‑time processing).


Inputs

NameTypeRequiredDefaultDescription
frame_dataSTRINGYes""Internal placeholder for the captured frame data. Leave as empty string – the node handles capture automatically.
crop_widthINTYes(none)Width (in pixels) of the output image after cropping.
crop_heightINTYes(none)Height (in pixels) of the output image after cropping.

The crop dimensions define the final output resolution. The interactive crop box is drawn at free proportions on the preview; the captured region is then scaled (if needed) to match crop_width × crop_height.


Outputs

NameTypeDescription
IMAGEtorch.TensorThe captured and cropped frame. Shape: (1, H, W, 3) in RGB order, values 0.0–1.0.

Usage Notes

  • Browser permission – The first time “Start capture” is clicked, the browser will ask permission to share a screen, window, or tab. The node can only access the source you explicitly select. If permission is denied, an error will be shown in the workflow.
  • Auto‑queue – When the workflow is set to auto‑queue, the node captures a new frame on every execution. To stop, either disable auto‑queue or remove the node.
  • Cropping behaviour – The crop box is drawn interactively on the preview. If the drawn region does not match crop_width × crop_height in aspect ratio, the final output will be resized to those exact dimensions (stretching or letterboxing as needed).
  • No crop – If you never draw a crop box (or clear it with right‑click / double‑click), the full captured frame is used. In that case, the output is still resized to crop_width × crop_height.
  • Output dimensions – Best performance and quality are obtained when crop_width and crop_height approximately match the resolution of the source content. Very large values may cause slowdowns or memory issues.

Comments

Sign in with GitHub to join the discussion.

Loading comments…
Screencap Stream (ScreencapStream) - ComfyUI-KJNodes | ComfyUI Wiki