Qwen2-VL Prompt Generator
Image in, positive and negative prompts out — with a caveat
- model
- processor
- image
- positive_prompt
- negative_prompt
The idea here is the cleanest in the whole pack: drop in an image, get back a ready-to-use positive prompt and a negative prompt, wire them into your CLIP text encodes, generate. It's the VLM-as-prompt-engineer pattern - an image-driven alternative to typing prompts by hand, useful for img2img where you want to match a reference, or for turning a picture into a starting prompt you then iterate on. Four prompt_style choices (detailed, booru_tags, simple, artistic) and a toggle to include or skip the negative prompt. On paper it's great.
Here's the caveat, and it's a real one: as this pack ships, you cannot actually wire this node to anything in it. Its two required inputs, model and processor, are custom types - QWEN2VL_MODEL and QWEN2VL_PROCESSOR. But the two "QWEN VLM MACHINE" nodes load the model internally and only output text STRINGs; nothing in this pack emits those model/processor types. So unless you have a different node somewhere that provides them, the socket stays empty and the node won't run. You've found the pack's orphan - either the author intended a loader that never shipped, or this is a fragment from an earlier design.
How it works (when it works)
Mechanically it's straightforward. It takes the PIL image, builds a prompt from the selected style template, and asks the model to act as an "expert prompt engineer for Stable Diffusion and Flux." If include_negative is on, it instructs the model to format output as POSITIVE: / NEGATIVE: and splits the reply on that marker - anything before NEGATIVE: becomes positive_prompt, anything after becomes negative_prompt. Sampling is fixed: temperature 0.7, max_tokens capped at 1024 (default 256).
prompt_style-detailed(natural-language description),booru_tags(Danbooru/e621-style tags - right for anime-lineage bases),simple(one or two sentences),artistic(style, lighting, composition, mood).include_negative- whether to ask for a negative prompt at all.max_tokens- budget for the reply; 256 is tight fordetailed, so raise it.
Outputs are two STRINGs, positive_prompt and negative_prompt, which feed a CLIP Text Encode (or the equivalent on whatever base you're on). A quality note: VLMs are decent at describing what's in the image but shaky on multi-subject attribution - who's wearing what, who's doing what - and the model's chat habits can leak "Here is your prompt:"-style scaffolding into the output. Treat the result as a starting point, not a final prompt.
Installing and using it
Same install as everything else in the pack:
cd ComfyUI/custom_nodes
git clone https://github.com/darkpool999/ComfyUI-Qwen2-VL-Nodes
cd ComfyUI-Qwen2-VL-Nodes
pip install -r requirements.txt
Restart, then add the node. The practical recommendation: if you just want image-to-prompt, use the QWEN VLM MACHINE (Safetensors) node with the "Booru Tags" or "Detailed Description" preset instead - it actually runs, loads the model itself, and gives you a single text output you can then route or post-process. The Prompt Generator is only worth the fight if you already have a node producing QWEN2VL_MODEL/QWEN2VL_PROCESSOR values from somewhere else. Given this pack has essentially no community footprint yet, treat it as an unproven extra rather than a workflow staple.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| model | QWEN2VL_MODEL | — | |
| processor | QWEN2VL_PROCESSOR | — | |
| image | IMAGE | — | |
| prompt_style | COMBO | detailed | 4 options: detailed, booru_tags, simple, artistic |
| include_negative | BOOLEAN | true | — |
| max_tokens | INT | 25632–1024 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| positive_prompt | STRING | — |
| negative_prompt | STRING | — |