PS Image Preview
The node that pushes your render back into Photoshop as a layer
- image1
- image2
- mask
Every ComfyUI-plus-Photoshop integration eventually faces the same question: after the sampler finishes, how does the image actually get back into the document? PS Image Preview is the ComfyUI-PS-Connector pack's answer. It's an output node with no outputs - you put it at the end of your graph, feed it the rendered image, and it writes a special temp file that the PS frontend grabs over the WebSocket and pastes onto the canvas as a new layer. Without it, your workflow generates, and PS just sits there wondering what happened.
Mechanically it's straightforward but with a real purpose behind each input. It takes an optional image1 (IMAGE), image2 (IMAGE), and mask (MASK), then saves them as temporary PNGs into ComfyUI's temp directory - filenames get a random suffix so runs don't collide. The PS plugin knows these filenames, polls them over the WebSocket, and layers the result into the document.
Here's the sizing logic that makes the paste-back actually line up, and it's worth understanding if you've ever fought with misaligned inpaint results: image2 is treated as the reference. If image1 or the mask are a different resolution than image2, they get rescaled to match before saving. So image2 is effectively "the thing that defines where on the canvas this lands" - typically the original source image or a reference canvas - while image1 is the freshly rendered result that needs to sit on top of it. If you're doing a masked edit, the mask gets aligned the same way. No image2? Then image1's own dimensions become the reference and everything aligns to that.
The two booleans control the PS-side behavior:
insert(BOOLEAN, defaultfalse) - whether to insert the result as a new layer.return(BOOLEAN, defaultfalse) - whether to send the image back to the canvas (in the pack's examples, like(C)(SDXL)A.json, this is the one set totruefor the main output).
In practice you set these based on what the workflow is for: a straight txt2img gets return on; a workflow that composites into an existing document uses insert. When the input comes from a PS "extract canvas" flow and the size matches, the plugin slots the generated image back over the original as a layer, which is the whole "edit in place" loop the pack is built around.
Install is the pack install, one time: search "ComfyUI PS Connector" in ComfyUI Manager, or
cd ComfyUI/custom_nodes
git clone https://github.com/doubley2000/ComfyUI-PS-Connector
then restart ComfyUI. On first boot the plugin auto-clones ComfyUI-Lora-Manager and copies example workflows into ComfyUI/user/default/workflows/PSflows/, so restart once more. No extra Python dependencies - this node is plain torch, PIL, and numpy, all already in ComfyUI.
Troubleshooting tips, grounded in how it actually behaves: if nothing lands in PS, check that the workflow file starts with ( so the plugin even lists it, and that it's exported in API format. If your result comes back misaligned or wrongly sized, suspect the image2 reference - it defines the canvas frame everything else snaps to. And if you're not using the PS panel at all, skip this node entirely; it saves to the temp directory and offers nothing to a plain ComfyUI user that the built-in preview doesn't. Like the rest of this young, solo-authored pack, it's tuned for one specific two-app dance - but for that dance, it's the only node in the pack that closes the loop.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| insert | BOOLEAN | false | — |
| return | BOOLEAN | false | — |
| image1opt | IMAGE | — | |
| image2opt | IMAGE | — | |
| maskopt | MASK | — |
Outputs (0)
No outputs