Presave Image
The preview/save hybrid that keeps your output folder honest
- image
- mask
Every ComfyUI user hits the SaveImage-versus-PreviewImage fork in the road eventually. SaveImage commits a permanent PNG to output/; PreviewImage writes a throwaway to temp/ so you can iterate without burying your output folder in rejects. MKRPreSave is the pack's answer to that false choice: it's one node that starts life as a preview and flips into a real save when you're ready. Hence the name - it's a pre-save.
What it's for
You reach for it at the end of a chain when you're generating batches and want to (a) see what you made without polluting output/, and (b) still have a one-click path to real files with the quality settings you care about. The preview_only boolean defaults to true, which means out of the box it behaves like a PreviewImage. Uncheck it and it writes PNG/JPEG/WebP/GIF to output/<subfolder> instead. Same node, two lives.
It's also an output node that always runs - the source returns float("nan") from IS_CHANGED, which in ComfyUI terms means "rerun me every queue event, don't cache me away" (see the node-plumbing docs for why that trick works). And it ships a custom frontend via the pack's WEB_DIRECTORY, so the widgets you see are the author's own.
Inputs that matter
preview_only- the whole gimmick. True = preview in temp, False = commit to disk.output_format-png,jpeg,webp, orgif. PNG is default, and the only one that embeds the workflow metadata (the "drag it back in and rebuild the graph" trick lives in the PNG text chunks).animation_mode-auto(decides from frame count and format),single_animation(one animated gif/webp from the batch), orper_frame(one file per frame).orientation+split_percent+fit_mode- this is the custom frontend's showpiece: a side-by-side split preview (horizontal or vertical, split atsplit_percent,contain/cover/stretchfor fit). Great for before/after compares.save_mask- if you also feed the optionalmaskinput, it can write the mask out too.filename_prefix,subfolder,overwrite- standard output plumbing.filename_labels(optional) lets you give frames their own names.
Compression/quality knobs: png_compress_level, jpeg_quality, webp_quality, and animation_fps + animation_loop for animated output.
Installing it
Pack-level install, unchanged:
cd ComfyUI/custom_nodes
git clone https://github.com/criskb/MKRShift_Nodes
then restart ComfyUI (or search MKRShift_Nodes in ComfyUI Manager). This node is pure PIL + torch - no ffmpeg needed, no extra requirements.
Common issues
The classic self-inflicted wound: you leave preview_only checked for a week, generate a whole batch, and nothing ever lands in output/. That's not a bug - flip the toggle. The reverse is also worth knowing: PNG embeds the workflow, but JPEG/WebP/GIF don't carry the graph, so if you care about "workflow included," keep your final deliverable PNG. And if you're animating, remember single_animation only produces an animated file for gif/webp - asking it for a single-animation PNG just gets you one still.
Inputs (18)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| preview_only | BOOLEAN | true | — |
| output_format | COMBO | png | 4 options: png, jpeg, webp, gif |
| animation_mode | COMBO | auto | 3 options: auto, single_animation, per_frame |
| filename_prefix | STRING | MKR | — |
| subfolder | STRING | — | |
| overwrite | BOOLEAN | false | — |
| save_mask | BOOLEAN | false | — |
| orientation | COMBO | horizontal | 2 options: horizontal, vertical |
| split_percent | FLOAT | 0.5000–1 | — |
| fit_mode | COMBO | contain | 3 options: contain, cover, stretch |
| png_compress_level | INT | 40–9 | — |
| jpeg_quality | INT | 921–100 | — |
| webp_quality | INT | 901–100 | — |
| animation_fps | INT | 121–60 | — |
| animation_loop | INT | 00–1000 | — |
| maskopt | MASK | — | |
| filename_labelsopt | STRING | — |
Outputs (0)
No outputs