Load Image (Clipboard)
Stop hunting in the file picker — load your clipboard straight into ComfyUI
- IMAGE
- MASK
Every time you want to img2img something you just saw, the dance is the same: screenshot it, save it somewhere, dig through LoadImage's file dialog, find the file. This node deletes the middle of that dance. Load Image (Clipboard) from Machete3000's comfyui-clipboard-image-loader watches your OS clipboard, shows a live thumbnail right on the node, and hands the pixels downstream as a normal IMAGE/MASK pair. Copy an image anywhere on your machine - Snipping Tool, a browser, Discord - and the next run uses it. No Ctrl+V, no upload, no file picker.
It's a small utility, not a headline act, but it's the kind of thing that quietly rewires how you work once you have it. For anyone doing quick inpaint/ControlNet passes on whatever is on screen, it's faster than any built-in path ComfyUI ships.
How it works
The mechanism is split across a tiny frontend extension and a backend route. The frontend polls /clipboard_image_loader/poll every ~1.5 seconds (and smartly skips polling when the browser tab is in the background). On Windows the backend does a cheap check first - the OS clipboard sequence number, read via stdlib ctypes, increments on every clipboard change - and only actually grabs the bitmap with PIL.ImageGrab.grabclipboard() when something changed. That's a nice touch: it avoids hammering the clipboard on every poll. On macOS and Linux there's no sequence number, so it just grabs each time, which is fine at 1.5s intervals.
The grabbed image is normalized and saved into ComfyUI's temp directory (folder_paths.get_temp_directory()) under a content-hashed filename like clipboard_ab12cd34.png. That filename is written into a hidden clipboard_file widget, and the node's load() then runs the exact same conversion pipeline as the built-in LoadImage - EXIF transpose, RGB convert, alpha channel pulled out as a mask. So the thumbnail you see on the node is literally the file that flows downstream.
Two implementation details are worth knowing. First, IS_CHANGED returns a SHA-256 of the saved file, so re-running with the same clipboard image is fully cached - only copying a new image forces the node to re-run (and even then, it doesn't auto-queue; you still hit run). Second, it handles both clipboard shapes grabclipboard() can return: a copied bitmap and a list of file paths copied in Explorer, in which case it opens the first image-looking one.
The inputs and outputs that matter
There are only two inputs, and one of them you never touch. clipboard_file is the hidden, JS-managed filename - leave it alone. The one you actually care about is:
error_if_empty(boolean, default on) - when nothing has been captured yet, the node raises a clear error telling you to copy an image and wait for the thumbnail. Turn it off and it silently outputs a 64×64 black image instead.
Outputs are the standard pair:
IMAGE- an RGB tensor, ready for a VAE encoder, ControlNet, IPAdapter, or any other image input.MASK- the alpha channel as a mask (white = transparent, matching ComfyUI'sLoadImageconvention; zeros if the image is opaque).
Install
No models to download, no heavy deps - Pillow is already required by ComfyUI. Through ComfyUI Manager, search "Clipboard Image Loader" and install. Or, the manual way:
cd ComfyUI/custom_nodes
git clone https://github.com/Machete3000/comfyui-clipboard-image-loader
Then restart ComfyUI and add Load Image (Clipboard) from the image category. One quirk worth knowing: the project declares pywin32 as a Windows dependency, but the shipped code does the sequence-number check with stdlib ctypes and never imports it - so nothing extra actually needs to be installed.
Where people get burned
- The clipboard is read on the server. If ComfyUI runs on a different machine than the one you copy on (a remote box, a Docker host), it sees that machine's clipboard, not yours. This is a local-setup node.
- Linux needs a paste tool.
ImageGrab.grabclipboard()relies onxcliporwl-pastebeing installed (sudo apt install xclip, or the Wayland equivalent) or the grab silently returns nothing. - Temp files don't survive a restart. ComfyUI clears
temp/on shutdown, so a freshly-loaded saved workflow can error with "Clipboard image file no longer exists" until you copy something new. That's expected, not a bug. - Keep
error_if_emptyon. A black 64×64 placeholder flowing into a latent is the kind of silent failure that wastes a run; the loud error is the feature.
Bottom line: it's a genuinely handy quality-of-life node for local, same-machine ComfyUI - fast to install, zero dependencies, and once you've used it for a couple of days, the file picker starts to feel very 2023.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| clipboard_file | STRING | — | |
| error_if_emptyopt | BOOLEAN | true | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| MASK | MASK | — |