Monks Image Generation Prompt Enhancer
This Node Hands Your Prompt to Gemini — and It Knows Which Model You're Prompting
- reference_image
- enhanced_prompt
Every prompt-enhancer node out there does the same lazy thing: dump your text into some LLM and hope for a longer, shinier version. Monks Image Generation Prompt Enhancer is not that. Its whole bet is that what makes a good prompt depends on the model you're about to feed, and it encodes that as hand-written system prompts rather than vibes. Tell it the target image model and the job you're doing, and it rewrites your raw idea the way that model actually wants to be talked to.
The name's a slight lie worth knowing up front: it doesn't generate images. It's a text-in, text-out node that makes a live Google Gemini API call on every run - no GPU work, no local model, and no free lunch. Each run is a billed request plus a network round-trip. Cheap (Gemini 2.5 Flash is nearly free), but it's a dependency on the outside world sitting in the middle of your graph.
Why model-aware prompting is the point
This is the part that separates it from a generic ChatGPT rewrite. LLM-encoded image models - FLUX.2 Klein, and Google's Gemini-native "Nano Banana" generation - treat your prompt as an instruction to a language model, not a bag of tags. Comma-separated booru keywords and (word:1.3) weight syntax do nothing for them; what they respond to is structured prose. The node's system prompts bake that in. For FLUX.2 Klein text-to-image it tells Gemini to write like a novelist - subject first, then setting, details, lighting (treated as the single highest-impact element), ending with an explicit style and mood statement. For image editing it strips any description of the base image and returns only the transformation. For multi-image fusion it keeps prompts minimal, because over-prompting confuses Klein's cross-attention. That's genuinely useful knowledge, and you get it without reading BFL's docs.
How it works
Pick the two dropdowns and the node loads the matching system prompt from a markdown file (prompts/<model>/<purpose>.md), then calls gemini-2.5-flash through the google-generativeai SDK with that instruction. Connect a reference_image and it's sent to Gemini as visual context. The returned text comes back as enhanced_prompt. Notably, it fails loud: a missing API key or empty prompt raises an error, and an empty Gemini response throws rather than silently passing your original text through.
The inputs you actually touch: prompt (multiline, your raw idea), api_key (a Google AI Studio key - masked in the UI, but plaintext in the saved workflow JSON, so don't share workflows that contain it), target_image_generation_model (Gemini Nano Banana or FLUX.2 Klein), and purpose (Text to Image / Image Editing / Multi Image Fusion). reference_image is optional; prompt_generation_model currently has exactly one choice (Gemini Flash 2.5).
One honest caveat about that target-model dropdown: it doesn't load a model or change what runs in ComfyUI. It only changes the writing strategy. The FLUX.2 Klein output feeds normally into a CLIP Text Encode (Klein needs ~13GB VRAM via BFL's checkpoints). Nano Banana is a Google API/ImageFX product with no open weights, so its target setting is for when you're taking the prompt somewhere else - Google's own pipeline.
Installation
The README's "copy the monks_prompt_enhancer/ folder" instruction is stale - the actual repo keeps the node at the root, so clone it and install its one real dependency:
cd ComfyUI/custom_nodes
git clone https://github.com/Experience-Monks/Monks-Prompt-Enhancer-ComfyUI-Node
cd Monks-Prompt-Enhancer-ComfyUI-Node
pip install -r requirements.txt
Restart ComfyUI and you'll find "Monks Image Generation Prompt Enhancer" under @Gemini AI/TextGen. requirements.txt is just google-generativeai plus Pillow (which ComfyUI ships anyway) - no heavy weights to fetch, nothing for your GPU to choke on.
Where people get burned
The failure modes here are boring and predictable. Forget the key: no api_key and it throws before making a call. Empty response: you've hit quota or the key's out of credit; the error message says so. Your workflow slows down: every single run is an API call, so re-runs aren't free or instant the way a local prompt is. And if you're on an older ComfyUI install, google-generativeai may need a manual pip install even though the requirements file exists.
It's a young pack - shipped by Monks, a proper creative agency, not a random hobbyist, but it's fresh enough that you shouldn't expect a community of troubleshooting threads yet. For FLUX.2 Klein users it's the most interesting of the "LLM rewrite" crowd precisely because it knows Klein doesn't upsample your prompt: what comes out is exactly what the sampler sees. If you run Klein and keep fighting its prompting style, it's worth the one-time setup.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | — | |
| api_key | STRING | — | |
| prompt_generation_model | COMBO | 1 options: Gemini Flash 2.5 | |
| target_image_generation_model | COMBO | 2 options: Gemini Nano Banana, FLUX.2 Klein | |
| purpose | COMBO | 3 options: Text to Image, Image Editing, Multi Image Fusion | |
| reference_imageopt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| enhanced_prompt | STRING | — |