Nodes/Yumil MPM/Yumil Batch Save
ComfyUI Node

Yumil Batch Save

A save node that writes a whole little project folder in one shot

By maigonia·Created 6 months ago·Updated about a month ago· 0
Yumil Batch Save
  • image_0
  • image_1
  • image_2
  • image_3
  • image_4
  • image_5
    parent_folder
    folder_name
    text

    Most ComfyUI save nodes write one image to a directory. This one writes an entire batch of related files into a single named subfolder - up to six images plus a text file - all under one filename prefix. It exists because the pack's regional-prompt and mask workflows need to hand Yumil MPM a tidy, self-contained bundle: the generated masks, the pose images, and the prompt text that goes with them, all in one place with one project name.

    Think of it as "save this run as a project." Give it a parent folder, a project name, wire in whatever images and text you've got, and it creates parent_folder/project_name/ and fills it. The naming is what keeps it organized: for folder_name = my_project, you get my_project.txt, my_project_0.jpg, my_project_1.jpg, and so on.

    How it works

    Plain and honest file writing. It os.makedirs the folder (creating parents if needed), writes the optional text input to {folder_name}.txt as UTF-8, then saves each connected image_0 through image_5 as JPEG at quality 95. Two details matter:

    • JPEG only, quality 95. There's no PNG mode and no format choice. Fine for masks and references that another tool will consume; if you need lossless or want the ComfyUI graph embedded, this isn't your node.
    • It saves only the first frame of each IMAGE tensor (image_tensor[0]). An IMAGE input that holds a batch of 4 frames becomes just frame 0 on disk. If you're feeding this from a batch of references, split the batch first or you'll silently lose everything but the first image.

    It's an output node, and its IS_CHANGED returns NaN, so it runs on every execution - that's what you want from a saver (you don't want the cache deciding a save can be skipped).

    Inputs at a glance

    Only two are required:

    • parent_folder - where the project folder goes. The tooltip example is C:/output/masks. Must be non-empty or the node raises a ValueError.
    • folder_name - the subfolder to create and the filename prefix. Also required, also ValueError on empty.

    Optional: text (saved as {folder_name}.txt) and image_0image_5 (saved as {folder_name}_N.jpg). Anything left unconnected is simply skipped - it doesn't write empty files for unused slots.

    Installing and when to reach for it

    Pack install, same as its siblings:

    cd ComfyUI/custom_nodes
    git clone https://github.com/maigonia/comfyui-yumil-mpm.git
    cd comfyui-yumil-mpm
    pip install -r requirements.txt
    

    or ComfyUI Manager → search comfyui-yumil-mpm → restart. It does depend on Pillow, but ComfyUI ships that already; requests is the only extra declared dependency.

    Honest advice on when to use it: reach for this when you're building data - masks, pose renders, reference sets that another tool (MPM, a training script, a game asset pipeline) will consume from disk as JPEGs. Don't reach for it as your primary output saver. JPEG re-encoding drops the ComfyUI graph metadata entirely, and the default Save Image's PNG with embedded workflow is what lets you drag an image back into ComfyUI to recover the setup. If you post to CivitAI or care about workflow-included sharing, keep this node for the machine-consumable side of your output and let the core Save Image handle the human-facing copy.

    CategoryYumil/IO

    Inputs (9)

    NameTypeDefaultDescription
    parent_folderSTRINGParent folder path (e.g. C:/output/masks)
    folder_nameSTRINGFolder name to create. Also used as file name prefix (e.g. 'my_project' -> my_project.txt, my_project_0.jpg)
    textoptSTRINGText to save as text.txt
    image_0optIMAGESaved as image_0.jpg
    image_1optIMAGESaved as image_1.jpg
    image_2optIMAGESaved as image_2.jpg
    image_3optIMAGESaved as image_3.jpg
    image_4optIMAGESaved as image_4.jpg
    image_5optIMAGESaved as image_5.jpg

    Outputs (0)

    No outputs