Boyo Incontext Saver
Save source-and-edit image pairs for an in-context dataset in one click
- source_image
- diffusion_output
If you're building training data for semantic editing - the workflow this whole pack is oriented around, with Kontext, Qwen Image Edit and HiDream in the README's own words - then every good example is two images: the source you started from and the edited result. Boyo Incontext Saver is the output node that captures that pair, names them consistently, and keeps numbering them across runs. It's the dataset-factory half of the pack's editing story.
Run it and it writes two PNGs into ComfyUI/output/<folder_name>/: the source as control_XXX.png and the edit as dataset_XXX.png, both zero-padded and sequentially numbered. The naming is deliberate - control_ + dataset_ is the ControlNet-style pair convention, where one image is the condition and the other is the target. If you've been manually renaming saved images to line up source and output, this removes a whole chore.
How it works
The mechanism is simple but thoughtful: it keeps a per-folder counter and, on first use, scans the folder for the highest existing number so it continues instead of overwriting. Feed it the two images, give the folder a name, and every queue run adds another pair. It's a pure output node - no outputs, nothing to wire onward, which is exactly what a saver should be.
The inputs
- source_image - the input image before editing.
- diffusion_output - the edited result.
- folder_name - subfolder under
output/, defaultincontext_dataset. Change it per project or dataset batch to keep things separated.
Install
Part of Boyonodes. ComfyUI Manager → search "Boyonodes", or:
cd ComfyUI/custom_nodes
git clone https://github.com/DragonDiffusionbyBoyo/Boyonodes
Restart. No extra dependencies.
Where it fits
The natural loop is Boyo Image Grab (watch a directory, load the newest edit) feeding an editing pass, then this saver capturing the before/after as a numbered pair - build up a couple hundred of those and you have a usable in-context training set without ever touching a file manager. The one thing to keep in mind: it appends to whatever folder you name, so if you start a fresh dataset, use a new folder_name rather than clearing files and wondering why the counter starts at 42.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| source_image | IMAGE | — | |
| diffusion_output | IMAGE | — | |
| folder_name | STRING | incontext_dataset | — |
Outputs (0)
No outputs