View Image (Format)
Preview losslessly, save as JPG/WebP, and keep the workflow anyway
- images
- images
Every format decision in this ecosystem is really a metadata decision: a ComfyUI PNG carries the entire node graph inside it, and anything that re-encodes the file throws that away. WorkflowX_ViewImageFormat is the node that takes the decision seriously. It previews losslessly, saves in PNG, WebP or JPG, and for the two formats that can't hold a graph it writes the workflow to a JSON sidecar next to the image instead.
What it is
A preview/save node in WorkflowX/Image with one foot in each camp: fast iteration and final export. With saving off, it's a preview node - the batch is shown as a lossless PNG in ComfyUI's temp directory and nothing permanent is written. With save_automatically on, it saves in the format you picked and previews that. On top of that, PNG / JPG / WEBP buttons on the node open your browser's native Save As dialog for a full-resolution manual export at any time, without re-queuing.
That last part is the reason to use it. The classic annoyance is generating something good under a preview node, realising you want the full-quality file, and re-running the graph to get it. Here the original float tensor is still on the server, so "save it properly" is a click, not a queue.
How it works
When the node executes, it retains the batch in a process-wide store keyed by an opaque token - up to 2 GiB, oldest-idle eviction, one latest batch per node/session. The preview it renders is always PNG, regardless of the format you selected for automatic saving, so what you're looking at is the 8-bit display conversion and not a JPEG that's been quietly squeezed.
The PNG/JPG/WEBP buttons post that token back to a route on the ComfyUI server, which encodes the frame from the retained float source and streams it to the browser. The image lands wherever you choose in the native dialog - no copy is written into output/. Storage is pinned per execution, so double-clicks can't interleave two encodes.
Metadata is where the thought went in:
- PNG embeds the ComfyUI
promptandworkflowchunks, so drag-and-drop still reconstructs the graph. - JPG and WebP share one JSON sidecar per producing execution in the output directory (or your prefix subfolder). The UI workflow is at the JSON root and provenance sits under
extra.workflowx_export. Load that JSON in ComfyUI and you're back where you were. Saving another format updates the same sidecar atomically instead of making a duplicate. include_metadataoff, or ComfyUI started with the global metadata-disable setting, and none of this is written.--disable-metadatawins over the widget.
Inputs are images, filename_prefix, format (png/webp/jpg), quality (JPG/WebP only; PNG is lossless), save_automatically and include_metadata, plus an optional session_key that overrides how the node identifies the owning browser session - handy when you drive it from an API and want retained sources keyed predictably. Output is images, a pass-through of the original tensor, so you can chain it and keep working.
Installing it
No models, no extra dependencies:
ComfyUI Manager → search "WorkflowX Configurator" → Install → restart
# or manually
cd ComfyUI/custom_nodes
git clone https://github.com/haroonaslam/WorkflowX-Configurator
Restart ComfyUI, then hard-refresh the browser - the format buttons are a frontend extension plus a server route, and a cached frontend shows you a node without buttons.
Where people get burned
- "Preview source unavailable - run the node again." The retained batch was evicted (oldest-idle) or the server restarted. The previews you already saved are fine; manual export of that old run isn't possible any more.
- Huge batches can't be manually exported. Over the 2 GiB retained-source limit, the node still previews and can still auto-save, but the manual Save As path is disabled for that batch. That limit is per process, not per node.
- Nothing happens when you click a format button. Native Save As needs Chrome or Edge on localhost or HTTPS. Other browsers get an explicit message rather than a file dumped in the wrong place.
- 403 on save behind a reverse proxy. The route rejects cross-origin requests using Fetch Metadata and
Origin, and tolerates proxies that rewrite the Host header. If you front ComfyUI with something that mangles both, exports fail while previews still work - that's the tell. - "JPG flattens transparency onto white." It's in the tooltip and it's literal: WebP and PNG keep alpha, JPG composites, so semi-transparent edges get a white fringe. For mattes, export PNG.
- Auto-save naming surprises. Automatic saves use ComfyUI's normal output numbering, while the manual Save As counter is browser-local and per prefix - two tabs can suggest the same number. Existing-file confirmation is the browser's job.
- The sidecar is not a replacement for the PNG. It's an honest workaround for a format with no room for a graph, not a better archive. Keep the PNG, publish the small one.
If you're still running the older View Image (Format) - Legacy JPG node in a workflow, it still works, but it's deprecated for exactly these reasons: no format choice, no manual export, and no workflow kept anywhere.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| filename_prefix | STRING | ComfyUI | — |
| format | COMBO | png | 3 options: png, webp, jpg |
| quality | INT | 951–100 | JPG/WebP quality. PNG is lossless. JPG flattens transparency onto white. |
| save_automatically | BOOLEAN | false | — |
| include_metadata | BOOLEAN | true | — |
| session_keyopt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |