ComfyUI Node

ww Photopea

A Free Photoshop Clone, Docked Right On Your ComfyUI Canvas

By eokoo·Created 6 months ago·Updated 5 months ago· 5
ww Photopea
    • IMAGE
    • MASK
    photopea_filename

    PhotopeaNode drops a real, working image editor into the middle of your graph - the whole free Photoshop clone that lives at photopea.com, docked over the node as a live iframe. You edit with layers, clone stamp, and healing brushes, hit save, and the result flows into whatever node is downstream. No API key, no GPU, no model download. It's the "manual touch-up, right here, without leaving ComfyUI" move, and for the way people actually work it can be genuinely nicer than round-tripping through GIMP.

    The pitch is simpler than it sounds. ComfyUI's normal masking story is "paint a mask in an external editor and import it" or "let a detector find the region for you" - the automation angle covered in the KB's masking docs. This node is the manual option living inside the graph: a pixel-perfect fix before an inpaint, a cleanup pass before an upscaler, a quick crop-and-touch before feeding something to a ControlNet or img2img. It shows up in the node list as ww Photopea (that "ww" is just the author's prefix), under the image/edit category.

    How it actually works

    The Python side is nearly empty - it just loads an image file and hands it on. All the magic is in the frontend (web/js/photopea_widget.js). When you click the node's title bar, the extension creates a floating container with an iframe pointing at photopea.com#{"fullScreen":true}, sized and positioned over the node, and re-syncs it as you pan and zoom the canvas. So you're literally editing inside the graph, not in a separate tab.

    When you hit the 💾 保存图像 ("save image") button, it posts app.activeDocument.saveToOE("png") into the iframe - that's Photopea's own scripting/Open Exchange bridge - receives the PNG bytes back via postMessage, uploads them to ComfyUI's /upload/image endpoint, and stores the returned filename in the node's hidden widget. The node watches that file's modification time, so it re-executes each time you save a fresh edit.

    The one input and the two outputs that matter

    • photopea_filename - the only input, a hidden STRING widget you'll never touch. The save button fills it for you.
    • IMAGE - your edited image as an RGB tensor, ready to wire anywhere.
    • MASK - the clever bit: it's 1 − alpha. Anything you erased or made transparent in Photopea comes out as mask=1, i.e. "regenerate here" in ComfyUI's inpainting convention. Erase a background in the editor, wire MASK into an inpaint pass, and the model fills in exactly what you removed. If your image is fully opaque, the mask is all zeros - it only becomes useful once you actually cut something out.

    Install

    No dependencies, no weights, nothing heavy:

    cd ComfyUI/custom_nodes
    git clone https://github.com/eokoo/ComfyUI-Photopea
    

    Restart ComfyUI (or Reload Custom Nodes). You can also search "Photopea" in ComfyUI Manager. Just make sure you get the pack from eokoo - see below, because the name is a trap.

    Where people get burned

    • The name collision. The famous Photopea node is coolzilj/ComfyUI-Photopea, a two-year-old pack that quietly broke with ComfyUI's newer frontend - "it's been broken for a while," as one r/comfyui thread put it, with users finding the editor never opens. eokoo's pack has the same repo name. If the editor won't appear, check you've actually got the eokoo version, and open the browser dev console - this is a frontend feature, so frontend errors are the first place to look.
    • Forgetting to save. If you edit but never hit 保存图像, the hidden widget stays empty and the node returns a 64×64 black image with a zero mask. That's a great way to silently poison everything downstream. Save before you run.
    • Internet required. The editor itself is served from photopea.com, so it won't load without network. Your image data isn't uploaded anywhere - it round-trips through your own browser - but the editor UI needs the connection.
    • Browser-only. This is a canvas hack, not a headless node. API/queue runs get nothing useful; it's meant for you, at the keyboard.
    • The reset bug. The README documents that the node used to reset its edits when you switched workflows - fixed on 2026-04-04. If you're on an older checkout, update.
    Categoryimage/edit

    Inputs (1)

    NameTypeDefaultDescription
    photopea_filenameSTRING

    Outputs (2)

    NameTypeDescription
    IMAGEIMAGE
    MASKMASK