Nodes/ComfyUI PK Load Image Paste/Paste Image (Load) — PK
ComfyUI Node

Paste Image (Load) — PK

Paste an image into ComfyUI without saving a temp file first

By smbdsbrain·Created 11 months ago·Updated 10 months ago· 2
Paste Image (Load) — PK
    • IMAGE
    • MASK
    image

    If you've ever grabbed a screenshot of a reference face, a product photo, or a selection from your editor and thought "I just want this in ComfyUI," this node is the fix. Paste Image (Load) - PK is a plain old Load Image with one addition: a Paste from clipboard button on the node. Click it, and whatever image is in your clipboard gets uploaded to ComfyUI/input/pasted/, named paste_<timestamp>.png, and loaded - no saving a temp file, no hunting through the file picker.

    The clipboard-juggling pain is real enough that people have built whole workarounds for it. The standard move is saving the image to disk, browsing to it, and deleting it later; or pasting into the canvas and hoping the browser pastes the image instead of workflow JSON. This node's whole pitch (from its own README) is that it only ever handles images, so there's no ambiguity about what lands in your graph.

    How it works

    The node is a fork of ComfyUI's built-in Load Image with two changes under the hood.

    The frontend part is a small JavaScript extension that adds the button. When you click it, it reads your clipboard via the browser's Clipboard API (navigator.clipboard.read()), grabs the first image it finds, uploads it to ComfyUI's /upload/image endpoint, and sets the node's image field. That's the whole trick - and it's why the "requirements" section is just "a modern browser." No models, no Python deps, no pip install. The repo's pyproject.toml confirms it: the only dependency is ComfyUI itself.

    The backend load() function is where it gets a little more interesting. Instead of the combo-box file picker the stock Load Image uses, the image input is a free-text STRING. The source code comment says exactly why: "using STRING input to avoid 'Value not in list' issues." Anyone who's had the stock node throw that error after the file list changed under it will appreciate this. You can type a path relative to the input folder (image.png, subfolder/image.png, input/image.png) or an absolute path, and it resolves it against folder_paths.get_input_directory().

    The inputs and outputs that matter

    • image (STRING) - the only input. A path to a file relative to ComfyUI/input/, or an absolute path. When you paste, the node fills this in for you as pasted/paste_….png.
    • IMAGE - the loaded image as a float tensor (B, H, W, 3), the same shape every Load Image hands to a VAE Encode or any image input. Wire this wherever you'd wire a stock Load Image.
    • MASK - the alpha channel as a mask if the image has transparency, or a zeroed mask otherwise. Handy if your clipboard image is a cutout and you're heading toward an inpainting or compositing workflow.

    Two niceties the stock node also has: EXIF orientation is applied, and 16-bit grayscale images are normalized. Pasted PNGs with alpha behave exactly like the built-in node - the mask convention matches, so you can drop it into an existing workflow without rethinking anything.

    Installing it

    ComfyUI Manager is easiest - search for "PK Load Image Paste" (or the pack title) and install. Manual route:

    cd ComfyUI/custom_nodes/
    git clone https://github.com/smbdsbrain/ComfyUI-PK_load_image_paste.git
    

    Then restart ComfyUI. It shows up under the image category as Paste Image (Load) - PK. No model downloads, no extra dependencies, no frontend build step - the JS ships ready to go.

    Common issues

    The README lists the failure modes, and they mostly come from the clipboard step, not the node:

    • "Clipboard API not available" - your browser is old, or ComfyUI isn't being served over a secure context. The Clipboard API's read() method needs HTTPS or localhost, so it works on your local machine but can fail when you access ComfyUI over a LAN/network. Refreshing the page sometimes fixes a stale permission state.
    • "No image in clipboard" - you copied text, or the app you copied from puts something odd on the clipboard. Recopy the image.
    • "Upload failed" - check the server logs; usually a write-permission problem on the input directory or a full disk.
    • "Image not found" - a typed path that doesn't resolve. Relative paths resolve against ComfyUI/input/.

    One thing worth knowing: the paste button is browser-only, so it's a UI nicety for interactive work. If you're driving ComfyUI via the API, you just set the image string yourself - which, thanks to the free-text input, is more flexible than the stock node anyway.

    It's a small tool and it does one thing, but it's the kind of small tool that deletes a daily annoyance. If you're constantly feeding reference images in from screenshots or editors, it's worth the 30 seconds to install.

    Categoryimage

    Inputs (1)

    NameTypeDefaultDescription
    imageSTRING

    Outputs (2)

    NameTypeDescription
    IMAGEIMAGE
    MASKMASK