Nodes/ComfyUI-nkxx/🍌 Grsai Nano Banana 命名细化版
ComfyUI Node

🍌 Grsai Nano Banana 命名细化版

Batch generation that names files after the prompts that made them

By nkxx188·Created 11 months ago·Updated 6 months ago· 14
🍌 Grsai Nano Banana 命名细化版
  • image_1
  • image_2
  • image_3
  • image_4
  • image
  • status
  • filenames
file_path
column_nameprompt
prompt_prefix
filename_prefixGrsaiBanana
rm_prompt_prefix
rm_prompt_suffix
modelnano-banana-fast
concurrency10
max_count50
aspect_ratioauto
image_size默认
ui_display_mode保存 (Saved)
api_key

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 (default prompt), prompt_prefix, model, concurrency (1–50), max_count (1–100), aspect_ratio, image_size, api_key, image_1image_4 - same semantics as the batch node.
  • filename_prefix (default GrsaiBanana) - 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 to ComfyUI/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_suffix and short prefixes are for.
  • Want to check naming without committing? Set ui_display_mode to 预览 (Preview) - no files land in your output folder.
  • Credit math: identical to the batch node - rows × executions_per_prompt is the bill. Preview mode still costs the same renders; it only changes where files go.
CategoryNkxx/Grsai/图像

Inputs (17)

NameTypeDefaultDescription
file_pathSTRING
column_nameSTRINGprompt
prompt_prefixSTRING
filename_prefixSTRINGGrsaiBanana
rm_prompt_prefixSTRING
rm_prompt_suffixSTRING
modelCOMBOnano-banana-fast6 options: nano-banana-fast, nano-banana-pro, nano-banana-pro-vt, nano-banana-pro-cl, nano-banana-2, nano-banana-2-cl
concurrencyINT101–50
max_countINT501–100
aspect_ratioCOMBOauto11 options: auto, 1:1, 16:9, 9:16, 4:3, 3:4, +5
image_sizeCOMBO默认4 options: 默认, 1K, 2K, 4K
ui_display_modeCOMBO保存 (Saved)2 options: 保存 (Saved), 预览 (Preview)
api_keyoptSTRING
image_1optIMAGE
image_2optIMAGE
image_3optIMAGE
image_4optIMAGE

Outputs (3)

NameTypeDescription
imageIMAGE
statusSTRING
filenamesSTRING