Nodes/ComfyUI-SaveImageDPI/Save Image (DPI)
ComfyUI Node

Save Image (DPI)

The print shop wants 300 DPI. Your PNG says 72. Fix it before Photoshop.

By mzkmkgm22-sudo·Created 2 months ago·Updated 2 months ago· 0
Save Image (DPI)
  • images
    filename_prefixComfyUI
    format
    dpi72
    model_name
    seed0
    quality90
    embed_workflowtrue

    You generated the image, it looks great on screen, and then the print shop's upload form asks for "300 DPI, TIFF or PSD accepted." ComfyUI's stock Save Image happily writes a PNG that reports 72 DPI, and the file your photobook or poster needs is a trip through Photoshop away. Save Image (DPI) is the node that kills that round-trip: a drop-in replacement for Save Image that writes PNG, JPEG, TIFF, or PSD with real DPI metadata - plus %model%/%seed% filename tokens that make batch output actually sortable.

    This is a small, honest utility from a small pack (ComfyUI-SaveImageDPI, one node, one dependency). It isn't a color-managed CMYK pipeline - more on that below - but for "my print shop wants a 350 DPI TIFF and I don't want to touch Photoshop," it's exactly the thing.

    How it works

    The mechanism is refreshingly simple, and the source backs the README up. For PNG, JPEG, and TIFF, the node hands your image to Pillow with a dpi=(dpi, dpi) argument, which writes the proper XResolution/YResolution tags into the file. That's the part every print workflow reads.

    PSD is where it gets interesting, because readers genuinely disagree on where a PSD's resolution lives. The node writes it twice:

    • ResolutionInfo (image resource 1005, the spec's canonical spot) - what Photoshop, Clip Studio Paint, and psd-tools read.
    • EXIF X/YResolution (image resource 1058) - the only place macOS ImageIO (Preview, Quick Look, sips) looks. The README notes this was verified empirically: a PSD with only the spec-perfect 1005 resource shows up as 72 DPI in sips until 1058 is added.

    It uses psd-tools under the hood for that, flattening to a single 8-bit RGB layer with RLE compression. No layer soup, just a flat printable file.

    Two more nice touches buried in the source: filenames come out prefix_00001.png - no trailing underscore like the stock node's prefix_00001_.png - and the sequence counter scans the folder for the highest existing number, so re-running doesn't overwrite.

    The inputs that matter

    There are four required and four optional; you'll set maybe three of them.

    • images (IMAGE) - the tensor to save; a batch becomes sequential numbered files.
    • filename_prefix (STRING) - supports subfolders and tokens, e.g. print/%model%_%seed%. %date:yyyyMMdd% is left to ComfyUI core. Feed model_name and seed the values you want interpolated - the node strips paths and extensions from the model name for you.
    • format - png / jpg / tiff / psd. TIFF uses lossless LZW; JPEG takes the quality input (default 90).
    • dpi (INT, default 72, max 1200) - the actual number the print shop cares about. Remember: DPI here is metadata, not resampling.

    It's an output node: no tensor out, it just returns the saved filenames to the UI. One gotcha - PSD files are deliberately left out of the browser preview list, because browsers can't render them.

    Install

    The whole pack is one file plus psd-tools. Either use ComfyUI Manager (search "ComfyUI-SaveImageDPI") or the manual route:

    cd ComfyUI/custom_nodes
    git clone https://github.com/mzkmkgm22-sudo/ComfyUI-SaveImageDPI
    pip install -r ComfyUI-SaveImageDPI/requirements.txt
    

    Restart ComfyUI. That requirements.txt is a single line - psd-tools - and you only need it for PSD output. PNG/JPEG/TIFF work without it, so if you're a TIFF-and-done shop you can skip it.

    Where people get burned

    • DPI is not resampling. Setting 300 DPI on a 1024×1024 image doesn't make it print at 300 DPI size - it makes the physical print about 3.4 inches. Real print work wants 240–300 DPI, so upscale the pixels first (a 4× model takes 1024×1024 to a poster-size 4096×4096). And as anyone who's tried knows, a print-resolution PNG is enormous - that's half the reason this node offers JPEG and TIFF.
    • JPEG strips the workflow. embed_workflow only applies to PNG. If you need the graph in the file (per the workflow-in-image convention, PNG is the only format that round-trips it), keep a PNG master and export the derivative.
    • No CMYK. This writes RGB files with correct DPI metadata. If you need actual color-managed CMYK with ICC profiles for a real press, that's a different pack (Darkroom) - for "shop accepts RGB TIFF/PSD at 300 DPI," this covers you.

    For print-on-demand, photobooks, and anyone tired of re-exporting through Photoshop, this is the save node you'll actually reach for.

    Categoryimage/save

    Inputs (8)

    NameTypeDefaultDescription
    imagesIMAGE
    filename_prefixSTRINGComfyUI
    formatCOMBO4 options: png, jpg, tiff, psd
    dpiINT721–1200
    model_nameoptSTRING
    seedoptINT00–18446744073709550000
    qualityoptINT901–100
    embed_workflowoptBOOLEANtrue

    Outputs (0)

    No outputs