Grok Image Save 🖼
Numbered Files, Baked-In Workflows, No Output Folder
- images
- saved_path
Why you'd reach for it
You generated ten images with Grok Imagine Generate, two of them are keepers, and now they're in ComfyUI/output as ComfyUI_00041_.png with no sign of which prompt made the good one. This node fixes the part that actually wastes your evening: your folder, your base name, image_000000.png, image_000001.png - and a .txt next to each one holding the prompt that produced it, plus a .json of the whole workflow.
It's the image half of the pack's save pair, and it behaves like the video one: it never writes into ComfyUI's output folder, the six-digit counter continues from the highest number already in the destination folder, and nothing is ever overwritten. Re-run the graph tomorrow and you get image_000042, not a clobbered 000000.
Inputs
images is the required IMAGE input - the images output of Grok Imagine Generate, the image output of Grok Imagine Edit, or any IMAGE wire at all. Every image in a batch gets its own number, so a n: 4 generation lands as four numbered files, not one stacked thing.
folder (default D:/grok_images) is created if missing, takes forward slashes happily on Windows, and an empty value errors rather than guessing. filename is the base name - a six-digit counter is always appended, and the same placeholders work as in the video node: %date%, %time%, %date:yyyy-MM-dd%. Connect a text node to filename_input and it takes over from the widget, counter still appended.
Then the granularity you actually want:
formatispngorjpg. PNG is lossless and keeps the workflow embedded in the file, so you can drag the image back onto the ComfyUI canvas later and recover the graph. JPG is quality 95, smaller, and carries no embedded workflow - which is whysave_workflow_jsonexists.save_prompt_txtwritesname_000000.txtfrom theprompt_textinput, and for a batch every image gets its own.txt, which is the feature that makes batch generation reviewable at all.save_workflow_jsonwrites the complete workflow once per run.
Connect the Grok node's prompt output into prompt_text and the sidecars write themselves. Nothing else to configure.
Outputs and the in-node preview
One output: saved_path, a STRING with the full path of the first saved image - for a batch, the rest follow with the next numbers. It's chainable if you want to log or feed a naming convention downstream.
The node is also an output node, so it renders its own preview and offers the same button row as the video saver: 📂 Reveal in Explorer, 🖼 Open image, and 🗑 Delete this set, which removes the image plus the workflow JSON and every .txt it wrote for that batch. The buttons only touch files this node saved during the current ComfyUI session - no arbitrary paths from the browser. (The video saver's Save Last Frame button doesn't apply here; there's no frame to grab.)
Install
ComfyUI Manager, search Grok Imagine, or do it by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/Slartibart23/comfyui-grok-imagine-video
..\..\python_embeded\python.exe -m pip install -r comfyui-grok-imagine-video\requirements.txt
Restart, then press Ctrl+F5 once in the browser - that loads the preview script, and without it the preview and buttons in the node stay empty even though the files were written correctly. Requirements are requests, numpy, Pillow, imageio, imageio-ffmpeg; the image node itself only needs Pillow, the rest is the pack's shared furniture.
Where people get burned
No .txt files is the big one: save_prompt_txt defaults to on, but it needs prompt_text actually connected. Second, choosing JPG and then wondering where the embedded workflow went - JPG has none, by design; if you want drag-and-drop recovery either use PNG or turn on save_workflow_json. Third, forgetting that the counter is global per base name in that folder: switching folders starts at 000000 again, which is occasionally confusing when you're comparing two directories. And the default folder is written for a Windows box - D:/grok_images on Linux or macOS quietly creates a subfolder literally named D: wherever ComfyUI was started from, so change it to something real before you wonder where your images went.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | The image(s) to save - connect the 'images' output of Grok Imagine Generate / Edit or any IMAGE. Every image of a batch gets its own number. | |
| folder | STRING | D:/grok_images | Destination folder on any drive, e.g. D:\Videos\grok. Created if it does not exist. This node never writes into the ComfyUI output folder. |
| filename | STRING | image | Base name for the files. A six-digit counter is always appended: name_000000, name_000001, ... The counter continues from the highest number already in the folder, so nothing is ever overwritten. Placeholders: %date% (2026-09-25), %time% (143012), %date:yyyy-MM-dd%. Ignored when filename_input is connected. |
| format | COMBO | png | png = lossless, larger, keeps the workflow embedded in the file (drag & drop into ComfyUI). jpg = smaller, quality 95, no embedded workflow (use save_workflow_json). |
| save_prompt_txt | BOOLEAN | true | Write name_000000.txt with the prompt (needs prompt_text connected). For a batch every image gets its own .txt. |
| save_workflow_json | BOOLEAN | true | Write name_000000.json with the complete workflow (once per run). |
| filename_inputopt | STRING | Optional: connect a text (e.g. from a Text node or the 'filename' output of a loader) to use it as the base name instead of the filename field above. The counter is still appended. | |
| prompt_textopt | STRING | Optional: connect the 'prompt' output of the Grok node. It is written as name_000000.txt next to the file when save_prompt_txt is on. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| saved_path | STRING | Full path of the first saved image (for a batch the others follow with the next numbers). |