Nodes/comfyui-immich/Save to Immich
ComfyUI Node

Save to Immich

Stop drowning in timestamp PNGs — save straight to your own Immich

By ericmey·Created 5 months ago·Updated 12 days ago· 0
Save to Immich
  • images
    character
    description
    album_id
    filename_prefixComfyUI

    If you generate a lot, you know the endgame: a folder of ComfyUI_00001_.png files with no way to find that one LoRA stack from three weeks ago. ComfyUI ships no gallery, and there are whole r/comfyui threads about how people search old outputs - the community answers are usually digiKam, PhotoPrism, or Immich, the self-hosted Google Photos. Save to Immich just deletes the "download, then manually import" step.

    This is an output node from the tiny comfyui-immich pack (v0.2.6, MIT). Wire your finished image into it and it uploads to your own Immich server, embeds the full workflow in the PNG exactly like the built-in SaveImage node, and - the genuinely nice part - auto-writes a searchable description so Immich's search can actually find a generation later.

    How it works

    Under the hood it's unglamorous and that's the point: the node takes your image tensor, converts it to PNG bytes with prompt and workflow JSON baked into the PNG metadata (same keys as SaveImage, so drag-back-into-ComfyUI works), then does a multipart POST to {IMMICH_URL}/api/assets with an x-api-key header. After upload it can PUT a description and add the asset to an album. Each image in a batch is wrapped in its own try/except, so one bad upload doesn't kill the rest - you'll just see [SaveToImmich] ERROR: lines in the console.

    Best bit: zero extra dependencies. It uses only PIL, numpy, torch (all already in ComfyUI) and Python's stdlib urllib - no requests, no pip installs, nothing to break. The README's claims hold up in the source.

    The inputs that matter

    Only one is required:

    • images - the IMAGE tensor, usually from VAE Decode, a Detailer, or any image-producing node.

    The optional ones are mostly for organization:

    • description - text shown in the Immich UI. Leave it blank and the node builds one for you: it parses the workflow for checkpoint, sampler/steps/CFG, seed, and your positive/negative prompts, prefixed with the character field. That's what makes old gens searchable.
    • album_id - the Immich album UUID; the image is added right after upload.
    • filename_prefix - default ComfyUI, used as prefix_YYYYMMDD_HHMMSS_0000.png.

    It has no output sockets - it's an output node. It does return ui image data so the preview shows up in ComfyUI like a normal SaveImage, and it also writes that same PNG to your local output folder.

    Install & config

    ComfyUI Manager has it - search "comfyui-immich" - or clone it:

    cd /path/to/ComfyUI/custom_nodes
    git clone https://github.com/ericmey/comfyui-immich.git
    

    Restart ComfyUI and you'll find the node under image/immich. Then configure credentials in the node's own directory:

    cd custom_nodes/comfyui-immich
    cp .env.example .env
    # edit: IMMICH_URL=https://your-immich-instance.com  IMMICH_API_KEY=your-api-key-here
    

    Grab the key from your Immich instance at User Settings → Account Settings → API Keys → New API Key. The .env is gitignored, so git pull updates won't clobber it. (You can also set the two variables in the shell environment - the code checks both.)

    Where people get burned

    • It needs an Immich server. If you don't already run one, that's a whole separate self-hosting project - this node is for people who already live in Immich.
    • Config lives in the pack folder, not your home dir. If you drop a .env in the wrong place you'll get the clear "IMMICH_URL not set" error with the exact path it's looking in - read that message, it tells you where.
    • A 401 means your API key is wrong; a 404 on upload usually means your Immich version doesn't match what the node expects (it targets Immich v3-style payloads). Description and album failures print warnings but don't fail the upload.
    • It re-encodes to PNG and uploads over your network - big batches of huge images will take a while; there's a 30s timeout per request.

    For a 0-impression hobby pack it's tidy and it does one job well. If you're already on Immich, this is the cleanest way to keep your generations searchable.

    Categoryimage/immich

    Inputs (5)

    NameTypeDefaultDescription
    imagesIMAGE
    characteroptSTRING
    descriptionoptSTRING
    album_idoptSTRING
    filename_prefixoptSTRINGComfyUI

    Outputs (0)

    No outputs