🍌 Grsai Nano Banana 命名细化版
Batch generation that names files after the prompts that made them
- image_1
- image_2
- image_3
- image_4
- image
- status
- filenames
The complaint that motivated this node: a batch run dumps image_0001.png … image_0050.png and you can't tell which one is the "red car at sunset" without opening every file. This is the batch node that solves that - it generates from a CSV/Excel column and names each saved file after the prompt that produced it (sanitized, truncated, deduplicated with (1), (2) suffixes). It's the GrsaiNanoBananaBatch sibling with a save-and-organize layer bolted on.
Given how often Nano Banana gets used for style-consistency and product-line work - where you absolutely want to know which prompt made which variant - this is honestly the one I'd reach for over the plain batch node. The naming feature sounds cosmetic until you're 200 files in and your status output gives you the exact filenames list.
The inputs that matter
Everything from GrsaiNanoBananaBatch, plus the naming controls:
file_path,column_name(defaultprompt),prompt_prefix,model,concurrency(1–50),max_count(1–100),aspect_ratio,image_size,api_key,image_1…image_4- same semantics as the batch node.filename_prefix(defaultGrsaiBanana) - the leading tag on every filename.rm_prompt_prefix/rm_prompt_suffix- strip these substrings from the prompt before it becomes a filename. This is the "my CSV has a shared prefix like 'style: ' and I don't want 200 files all starting with it" control.ui_display_mode-保存 (Saved)(default, writes toComfyUI/output) or预览 (Preview)(writes to temp, shows only in the UI). Preview mode is your free rehearsal: check naming before committing to disk.
Outputs: image (IMAGE), status (STRING), and filenames (STRING - newline-separated list of every saved path).
How it works
Readable source, Grsai side. Prompts are read with pandas, stripped of the rm_prompt_prefix/rm_prompt_suffix substrings, run through a filename sanitizer, and rendered with the filename_prefix tag. The thread pool writes each result to ComfyUI/output/ (or temp in preview mode), auto-incrementing on name collisions. It's synchronous - the whole batch runs in one node execution, which is fine for medium batches and worth knowing for large ones.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/jieg9341-lab/ComfyUI-nkxx
restart (or ComfyUI Manager, "ComfyUI-nkxx"). Auto-installs requests, pandas, openpyxl, yt-dlp, opencv-python, aiohttp. Grsai key from nkxx.grsai.ai.
Common issues
- Long unreadable filenames: the sanitizer truncates to ~100 chars; if your CSV prompts are long essay-prompt style, filenames get unwieldy - that's what
rm_prompt_suffixand short prefixes are for. - Want to check naming without committing? Set
ui_display_modeto预览 (Preview)- no files land in your output folder. - Credit math: identical to the batch node - rows ×
executions_per_promptis the bill. Preview mode still costs the same renders; it only changes where files go.
Inputs (17)
| Name | Type | Default | Description |
|---|---|---|---|
| file_path | STRING | — | |
| column_name | STRING | prompt | — |
| prompt_prefix | STRING | — | |
| filename_prefix | STRING | GrsaiBanana | — |
| rm_prompt_prefix | STRING | — | |
| rm_prompt_suffix | STRING | — | |
| model | COMBO | nano-banana-fast | 6 options: nano-banana-fast, nano-banana-pro, nano-banana-pro-vt, nano-banana-pro-cl, nano-banana-2, nano-banana-2-cl |
| concurrency | INT | 101–50 | — |
| max_count | INT | 501–100 | — |
| aspect_ratio | COMBO | auto | 11 options: auto, 1:1, 16:9, 9:16, 4:3, 3:4, +5 |
| image_size | COMBO | 默认 | 4 options: 默认, 1K, 2K, 4K |
| ui_display_mode | COMBO | 保存 (Saved) | 2 options: 保存 (Saved), 预览 (Preview) |
| api_keyopt | STRING | — | |
| image_1opt | IMAGE | — | |
| image_2opt | IMAGE | — | |
| image_3opt | IMAGE | — | |
| image_4opt | IMAGE | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| status | STRING | — |
| filenames | STRING | — |