ComfyUI Node

PVL Save Or Not

Save images, but only when you mean it

By pvlprk·Created about a year ago·Updated 8 months ago· 1
PVL Save Or Not
  • images
    filenameimage
    format
    quality100
    conditiontrue

    ComfyUI's built-in Save Image node saves everything you run through it, all the time. If you're running a batch where you only want to keep some outputs - the ones that passed a quality check, the seed that hit the "good" branch, the images from a specific toggle state - you end up with a hard drive full of rejects. PVL Save Or Not is the version with a kill switch: one condition boolean, and when it's false, nothing gets written.

    It's part of pvlprk/comfyui-pvl-api-nodes ("ComfyUI Assistant Node"), and for anyone automating ComfyUI it's the kind of small quality-of-life node that quietly saves you from junk files.

    How it works

    It's an output node (it ends the chain - no outputs, just the save). It writes to ComfyUI's standard output directory, same place core's Save Image puts things. The logic:

    • condition (BOOLEAN, default true) - the gate. False, and the node returns early with an empty result: no save, no error.
    • images - the IMAGE input. The node also defends against None or empty tensors, so a dead upstream won't crash it either.
    • filename - base name, default image. For a batch of more than one, it appends an index: image_0.png, image_1.png, and so on.
    • format - png, jpeg, or webp.
    • quality - 1–100, used for jpeg/webp. PNG is lossless, so quality is ignored there.

    The whole thing is wrapped in try/excepts and prints errors to the console instead of killing the run - which is friendly, but means a failed save can be easy to miss. If a file you expected isn't on disk, check the terminal.

    The realistic use case

    Wire condition to anything that makes a decision: a PVL Switch output, a math-condition result, an API response flag, even a UI toggle node. Suddenly "save" becomes part of your logic instead of a reflex. The classic automation pattern - generate N candidates, run them through a scorer or a prompt-condition, keep only the ones that pass - becomes: condition = (score > threshold), and only the winners land in your output folder. No more triaging a dump of 200 images.

    Installing

    cd ComfyUI/custom_nodes
    git clone https://github.com/pvlprk/comfyui-pvl-api-nodes
    

    restart, or install through ComfyUI Manager by searching for "ComfyUI Assistant Node". No model downloads; it only needs Pillow and numpy, both present in any standard ComfyUI install. The pack's heavier requirements (OpenAI, Google, fal clients) are for its other nodes, not this one.

    Where people get burned

    • The filename is a base, not a path. You get filename_0.png in the root output directory - there's no subfolder or full path control. If you need per-run folders, you'll have to wrap it or accept the flat dump.
    • Batch naming is automatic and unconfigurable. One image in → image.png; two → image_0.png/image_1.png. Fine for most, but don't expect 0001, padding, or your own naming scheme.
    • Silent failures. Between the condition gate and the exception handling, a lot of ways to "not save" are quiet. If nothing appears on disk, your condition is probably false - check it before assuming the node broke.
    • Saves go to the output dir like core's Save Image, so it plays fine with the built-in "show output" UI.
    CategoryPVL_tools

    Inputs (5)

    NameTypeDefaultDescription
    imagesIMAGE
    filenameSTRINGimage
    formatCOMBO3 options: png, jpeg, webp
    qualityINT1001–100
    conditionBOOLEANtrue

    Outputs (0)

    No outputs