Nodes/Boyonodes/Boyo Paired Image Saver
ComfyUI Node

Boyo Paired Image Saver

Building a ControlNet Dataset One (Source, Control) Pair at a Time

By DragonDiffusionbyBoyo·Created 2 years ago·Updated 26 days ago· 16
Boyo Paired Image Saver
  • original_image
  • controlnet_image
    folder_namebatch_output
    filename_prefixgenerated

    Training a ControlNet - or any conditioning model - means feeding it pairs: the source image and the condition you derived from it, matching filenames so the trainer knows which goes with which. Doing that by hand is a nightmare of rename games and miscounted folders. BoyoPairedImageSaver is the small node that does the bookkeeping for you: two images in, two correctly-paired PNGs out, automatically numbered.

    It takes an original_image and a controlnet_image (the conditioned copy - edge map, depth render, pose skeleton, whatever your preprocessor produced), plus a folder_name and filename_prefix for organisation. Every run writes a pair like generated001_original.png and generated001_controlnet.png into ComfyUI/output/<folder_name>/. It's an output node with no return values - it just writes files.

    The mechanism worth knowing

    The numbering isn't random: the node scans the target folder for existing files with your prefix, finds the highest number, and continues from there. That means re-running a workflow or restarting ComfyUI won't collide with and overwrite earlier pairs - it appends. Within a single session it increments a per-folder/prefix counter. That "continue where you left off" behaviour is the difference between this and a dumb saver, and it's what makes it safe to leave running across a long batch.

    Where it fits

    The obvious home is a pipeline like: source image → edge/pose preprocessor → sampler → save the pair. Run it across a folder of source images and you've built a labelled training set without touching a file manager. It plays naturally with the pack's Boyo Image Grab if you're doing iterative edits - grab the newest source, edit it, save the before/after as a pair.

    One note on naming: the input is called controlnet_image (that's what lands in the schema and the filename suffix), even though you can pair any two images - it's oriented toward ControlNet-style datasets, not generic before/after shots. If your goal is original-vs-upscaled comparison pairs, the pack's BoyoSaver is the one that writes A.png/B.png naming instead.

    Installing it

    It ships with Boyonodes:

    cd ComfyUI/custom_nodes
    git clone https://github.com/DragonDiffusionbyBoyo/Boyonodes
    

    Restart ComfyUI, or search "Boyonodes" in ComfyUI Manager. No extra Python deps for this node - it's pillow + tensor math, both already in ComfyUI.

    Gotchas

    • Output goes to ComfyUI/output/<folder_name>/, not to your project folder. If you need a custom absolute path, this node doesn't take one - copy the folder out after the run.
    • It saves only the first frame of each batch (image[0]). Feed it single images, not batched tensors, or you'll silently lose frames.
    • The folder_name is your only namespacing tool; using the same folder + prefix across different projects will interleave numbers.

    For anyone assembling a ControlNet or conditioning dataset from inside ComfyUI, this is the sort of node you don't know you need until you've hand-renamed 200 pairs once.

    CategoryBoyonodes

    Inputs (4)

    NameTypeDefaultDescription
    original_imageIMAGE
    controlnet_imageIMAGE
    folder_nameSTRINGbatch_output
    filename_prefixSTRINGgenerated

    Outputs (0)

    No outputs