Nodes/ComfyUI_toyxyz_test_nodes/Save Image to Path
ComfyUI Node

Save Image to Path

Write your generations to any folder you want

By toyxyz·Created 3 years ago·Updated about 17 hours ago· 635
Save Image to Path
  • image
    path./ComfyUI/custom_nodes/ComfyUI_toyxyz_test_nodes/CaptureCam/rendered_frames/render.jpg
    save_sequencefalse
    image_format.jpg
    jpg_quality70
    png_compression5

    ComfyUI's built-in Save Image always dumps into its output folder, and that's fine right up until it isn't. Save Image to Path is the node that writes your image to an arbitrary folder path instead - and in this pack it's not a convenience, it's load-bearing. The whole live-render loop works because this node can write to CaptureCam/rendered_frames/render.jpg, the exact file the webcam app watches to display your generated output. Without a save-to-path node, the loop has nowhere to put the image.

    It's also just handy day to day: save into a project folder, a render queue, a network share, anywhere. And because it's an output node (no outputs of its own), it sits at the end of the line and does the writing while the rest of your graph keeps flowing.

    How it works

    The node creates the folder if it doesn't exist, then writes the image. The behavior that matters most is how it names files, which is controlled by save_sequence:

    • false (default) - overwrites the same file every run. That's what a live render loop wants: the app keeps reading the same render.jpg and you always see the latest frame.
    • true - appends a counter so nothing is ever clobbered: comfyui_000001.png, comfyui_000002.png, ... This is the mode you want when collecting a sequence of frames - the README's webcam-app export flow relies on it to stitch frames into a video later.

    Two file-handling details are worth knowing because they come up constantly. Feed it a MASK from ComfyUI's Load Image node and the mask becomes an alpha channel, so you can save true transparent RGBA PNGs instead of a flattened image. And if you need prompts or captions alongside, it'll write a .txt file with the same name as the image.

    The inputs

    • path - where to write (default CaptureCam/rendered_frames/render.jpg).
    • image - the IMAGE tensor to save.
    • save_sequence - false/true, described above.
    • image_format - .jpg, .png, or .bmp.
    • jpg_quality - 0–100, default 70.
    • png_compression - 1–9, default 5.

    One wrinkle to flag: the schema comfy.icu scrapes for this node shows save_sequence, but the current source in the repo expresses the same choice differently - a name for the base filename and a Save/Overwrite method - plus those optional MASK and text inputs. The behavior is the same either way; don't be surprised if your installed version spells the knobs slightly differently.

    Installing and pitfalls

    It ships in toyxyz/ComfyUI_toyxyz_test_nodes. Install via ComfyUI Manager (search the pack title) or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/toyxyz/ComfyUI_toyxyz_test_nodes
    

    then restart.

    The main gotcha is format + transparency: .jpg and .bmp can't hold an alpha channel, so an RGBA image gets flattened onto a white background (the code pastes it over white). If you're saving masked/transparent output, use .png or you'll wonder where your transparency went. Also keep an eye on the path default - the webcam app only shows your renders if the path here matches what the app expects.

    CategoryToyxyzTestNodes

    Inputs (6)

    NameTypeDefaultDescription
    pathSTRING./ComfyUI/custom_nodes/ComfyUI_toyxyz_test_nodes/CaptureCam/rendered_frames/render.jpg
    imageIMAGE
    save_sequenceCOMBOfalse2 options: false, true
    image_formatCOMBO.jpg3 options: .jpg, .png, .bmp
    jpg_qualityINT700–100
    png_compressionINT51–9

    Outputs (0)

    No outputs