🎨 Prompt Reverse Builder
Reverse-prompt any image into the prompt that (probably) made it
- prompt
Prompt reverse - interrogation, captioning, whatever you call it - is how you turn a reference image into a prompt you can actually reuse in a sampler. Prompt Reverse Builder is the pack's node for exactly that, and the twist is it asks the VLM to write for a specific generator: Stable Diffusion, Flux, SDXL, or Midjourney. That's smarter than it looks, because a good prompt for a Midjourney vibe is a bad prompt for a booru-tag model, and this node knows it.
It's a string builder, same as its siblings in the pack's Business category. You pick a target and a language, and it hands you a prompt STRING wired to request subject, composition, lighting, color palette, style, camera/framing, details, and a short negative prompt. Feed that into Remote VLM Business Task (or any analysis node) with your image attached and the VLM writes the reverse prompt.
The two knobs
- target - Stable Diffusion, Flux, SDXL, or Midjourney. The template phrase changes: it asks for the kind of prompt that generator responds to, rather than a one-size-fits-all description.
- language - English or 中文. English is the sensible default since essentially every image model was trained on English prompt text.
The trap worth knowing about
Vision models trained partly on video captioning have a real habit of describing motion - "a woman walks through the street" - when you need a still-frame image prompt. That's not just this pack's problem; it's a well-documented community complaint about using LLMs for prompt generation. The builder's template pushes back by asking for framing and lighting explicitly, but if your reverse prompts keep coming back with action verbs and temporal language, that's the model fighting the instruction. The practical fix is a remote model that's genuinely image-native, or a beefier local quant.
Also, manage expectations: a reverse prompt is a reconstruction, not the original. The prompt that made the image is gone; the VLM is guessing a plausible one. That's fine for cloning a style or kickstarting a variation, but don't expect to recover the exact seed-and-prompt that produced someone's render.
Install
The whole pack installs in one shot:
cd ComfyUI/custom_nodes
git clone https://github.com/walke2019/ComfyUI-GGUF-VLM.git
cd ComfyUI-GGUF-VLM
pip install -r requirements.txt
Restart ComfyUI. Manager users can search the pack title. This node only builds a string, so it runs even without the model-loading dependencies installed - but you'll obviously want at least one working VLM to point it at.
Troubleshooting
If the reverse prompt comes out as tags when you asked for Flux-style natural language, that's a model quirk, not a broken node - some captioners default to tag output regardless of instructions. The template for Flux explicitly requests natural-language prompt structure, so a model that ignores it is telling you it's a tags-first captioner. And if you're getting garbage, check the usual suspects: a Q4 quant will flatten the instruction, and a weak system prompt on the analysis node can override everything the builder worked for.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| target | COMBO | Stable Diffusion | 4 options: Stable Diffusion, Flux, SDXL, Midjourney |
| language | COMBO | English | 2 options: English, 中文 |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| prompt | STRING | — |