Nodes/comfyui_psd_smart_object/PSD Mockup Embedder
ComfyUI Node

PSD Mockup Embedder

Paste your image into a Photoshop mockup without ever opening Photoshop

By leafiy·Created 10 months ago·Updated 10 months ago· 2
PSD Mockup Embedder
  • mockup_image
  • mockup_image
  • debug_info
  • png_path
psd_file
smart_object_names
output_width800

If you generate product shots, the workflow usually ends the same way: you render something, then you have to put it "on" a mug, a poster, a phone case, or a billboard before anyone takes it seriously. Normally that means opening a mockup PSD in Photoshop and manually double-clicking a smart object - the boring, repetitive part of an otherwise fun job. PSD Mockup Embedder does that paste for you, inside ComfyUI, and it's the first node in the pack that does actual work instead of just telling you things.

It's a niche tool and it knows it. There's no model to download, no GPU load, no API call - it's a geometry and compositing utility. If you've ever made a living (or a side hustle) dropping AI renders into brand mockups, you'll get why this exists. People in the AI-to-PSD space describe exactly this bottleneck: generate the base with SD/Flux, then fight to keep it editable and in perspective. This node automates the "in perspective" step for any PSD that already has a smart object in place.

How it works

The node takes your artwork and your PSD, then does four things:

  1. Opens the file with psd-tools and finds the smart-object layer(s) you targeted.
  2. Composites the PSD with those layers removed, keeping everything else - shadows, highlights, rounded corners, the whole clipping stack.
  3. Reads the layer's transform_box (the same perspective/rotation/scale data Photoshop stores) and uses OpenCV to warp your image into that quad, then alpha-composites it back onto the canvas.
  4. Returns the result as an IMAGE tensor and auto-saves a PNG.

That last part is a nice touch - the png_path output means you don't need a Save Image node just to get a file on disk. And because it goes through the normal IMAGE tensor, you can chain post-processing (color grade, sharpening) before the result hits your eyes.

The inputs that matter

  • psd_file - required, and the README-friendly way is the "choose PSD to upload" button on the node (or drag the file onto it). That bundled frontend script uploads into ComfyUI/input and fills the field for you. Pasting an absolute path works too.
  • mockup_image - required. Wire any Load Image/Upload Image output into this.
  • smart_object_names - optional, comma-separated, case-insensitive. Leave it empty and it targets the first smart object in the file. If your names don't match anything, it falls back to the first smart object and tells you so in the debug output - which is exactly why the pack's Inspector node exists.
  • output_width - optional, default 800, in pixels. Set to 0 to keep the PSD's native resolution. 800 is a fine preview size; if you need it for print or a portfolio, go full res.

The outputs are mockup_image (IMAGE), debug_info (a JSON string telling you which layers got replaced), and png_path (the auto-saved file location).

Installing it

From the README, nothing exotic - no model weights, no torch magic, just three small Python packages:

cd ComfyUI/custom_nodes
git clone https://github.com/leafiy/comfyui_psd_smart_object
pip install -r requirements.txt

...then restart ComfyUI. You can also find it as comfyui_psd_smart_object in ComfyUI Manager. The requirements are psd-tools, opencv-python-headless, numpy, and Pillow - all light, none of them fight your existing environment the way, say, a transformers pin will.

Where people get burned

The biggest one is OpenCV. The perspective warp needs cv2, and if ComfyUI logs an import error, it's almost always because opencv-python-headless isn't in the same environment. Install it there and restart.

The second is expectations about what "editable" means. The result is flattened. Blend modes and lighting that sit on top of the smart object get baked into the background - the README says this plainly, and it's worth repeating: if a mockup has a complex lighting stack, you may still need Photoshop for final touch-ups. This node is for the 90% case where the mockup is a clean surface with a smart object waiting for content. For that, it's genuinely one of those "why is this not a default" tools.

Categorypsd/mockup

Inputs (4)

NameTypeDefaultDescription
psd_fileSTRINGUse the built-in upload button or paste a path manually
mockup_imageIMAGE
smart_object_namesoptSTRING
output_widthoptINT8000–8192Resize final image to this width (0 keeps original size)

Outputs (3)

NameTypeDescription
mockup_imageIMAGE
debug_infoSTRING
png_pathSTRING