Nodes/ComfyUI-ZhiHui/💾 智绘_保存PSD
ComfyUI Node

💾 智绘_保存PSD

A real multi-layer PSD straight out of ComfyUI — rare, and yes it needs pytoshop

By zhuyungen·Created 8 months ago·Updated 3 months ago· 0
💾 智绘_保存PSD
  • 🖼️ 图像列表
    📄 文件名前缀zhihui_psd
    📂 自定义路径

    Saving layered PSD files from ComfyUI is a desert. The community discussion around it is basically people asking "has nobody ever wanted this?" and getting told to stack two PNGs side by side and run a Photoshop action (that's literally the top workaround advice). So ZH_SavePSD ("💾 智绘_保存PSD") quietly does the thing everyone assumed was too niche: take a batch of images and write a genuine multi-layer Photoshop document, with each image as its own layer, via the pytoshop library.

    It's from ComfyUI-ZhiHui, a Chinese-language utility pack. It's a genuinely useful node hiding in an obscure pack - the kind of thing you'd reach for at the end of an img2img or background-removal pipeline when you want the original, the cutout, and the composite handed to Photoshop as separate layers for manual cleanup.

    How it works

    Feed it an image batch or list (🖼️ 图像列表). It converts every frame to RGBA, computes a canvas size of max(width) × max(height) across all images, and places each image as its own layer, centered on that canvas - layer 1, layer 2, and so on (named "图层 1" in the Chinese UI). The canvas auto-grows to fit, and layers keep their transparency, so a cutout layer arrives in Photoshop with its alpha intact. Saving uses raw, uncompressed chunks for maximum compatibility across PSD readers - files are bigger, but they open everywhere.

    Outputs: none. It's a terminal node; the file just lands. Name is {文件名前缀}_{counter:05d}_.psd (default prefix zhihui_psd), written to 📂 自定义路径 if you set one, otherwise ComfyUI's default output directory.

    The input that matters

    Only one, really: 🖼️ 图像列表 - the images to stack as layers. The prefix and optional path are self-explanatory.

    Install

    The pack installs via the usual route, but this node has a hard extra dependency:

    cd ComfyUI/custom_nodes
    git clone https://github.com/zhuyungen/ComfyUI-ZhiHui.git
    pip install pytoshop
    

    Restart ComfyUI. If pytoshop isn't in your environment, the node raises 智绘_保存PSD: pytoshop 模块未找到 at run time - that's the signal, not a broken install. On a portable Windows build use python_embeded\python.exe -m pip install pytoshop. ComfyUI Manager search "ComfyUI-ZhiHui" also works.

    Where people get burned

    The pytoshop dependency is the classic first trip - the README lists it under requirements, but nothing nags you about it until you run the node. Second: memory. A PSD holds every layer's full pixels uncompressed, so a batch of big images is a batch of big RAM and a big file - the author's guide suggests keeping under ~20 layers per save. Third, layers are always centered on the max-size canvas; if your inputs have wildly different sizes, the small ones float in the middle of empty space, which you then have to reposition in Photoshop anyway. And if you hit a "can't mix absolute and relative paths" style error, that's an old bug the pack claims to have fixed in V2.1+ - update the pack before debugging your own path.

    Category智绘灵箱/图片

    Inputs (3)

    NameTypeDefaultDescription
    🖼️ 图像列表IMAGE需要保存的图像批次或列表
    📄 文件名前缀STRINGzhihui_psd文件名前缀
    📂 自定义路径optSTRING自定义保存路径,留空则使用默认路径

    Outputs (0)

    No outputs