Qwen2提示词
No API key, no cloud, free prompt expansion
- STRING
The name is a promise that holds: Qwen2_prompt runs a Qwen2.5 instruct model on your machine and uses it to turn a rough idea into a rich, structured prompt. No API key, no subscription, no cloud round-trip, no censorship layer between you and the text. Type "a girl in a rainy street" into the box, pick a style, and the model writes you a proper cinematic prompt that would take you ten minutes of staring at a blank field to produce.
This is the local-LLM prompt enhancement pattern that went from novelty to routine over the last couple of years, and the reasons people run it locally instead of hitting an API are still the good ones: it's uncensored, it's offline, and it's free per call. The pack it ships in, AIGCZero/ComfyUI-tools_zero, is a Chinese-first grab bag from a developer who mostly posts on Bilibili; the README is nearly empty, so treat this as a "read the source before you trust it" install - the community has been burned by exactly this category of node before.
What it does
You get a prompt_type dropdown with seven jobs: 建筑扩写 (architecture), 电商扩写 (e-commerce), 创意扩写 (creative), 详细扩写 (detailed), two video-prompt modes (多段运镜 = multi-segment camera moves, 快速运镜 = fast cuts), and 智能扩写 (smart expansion). Each one is a hand-written system template in Chinese that tells the model exactly what structure to emit - subject, scene, motion, lighting, composition, style - so you don't get chat-like rambling back. If none of those fit, the optional system_prompt input overrides the whole template system; it even accepts {user_input} as a placeholder.
The model choices are the real Qwen2.5 lineup: 3B, 7B and 14B Instruct, plus the official -bnb-4bit pre-quantized versions. There's a separate quantization dropdown (none / 4bit / 8bit) that only applies when the model name isn't already quantized. The default is Qwen2.5-7B-Instruct-bnb-4bit, and honestly that's the sane pick for most people: 7B fits in roughly 5GB of VRAM alongside a diffusion model, and it writes prompts considerably better than 3B. The keep_model_loaded toggle (default off) decides whether the model stays in VRAM between runs - leave it off unless you're doing a batch loop, because you want that VRAM back before the sampler runs.
Output is a single STRING - wire it into your CLIP Text Encode, or the video text encoder if you used a video mode.
How it works
On first use it downloads the model from HuggingFace into ComfyUI/models/LLM/ via snapshot_download - that's a multi-gigabyte first run, not a small one. Loading uses device_map="auto" with bitsandbytes for the quantized paths, and the node is unusually defensive about VRAM: it detects OOM, calls ComfyUI's own /free endpoint to unload models, waits, and retries once before giving you a clear Chinese error message telling you to re-run.
Installing it
ComfyUI Manager → search "ComfyUI-tools_zero", or:
cd ComfyUI/custom_nodes
git clone https://github.com/AIGCZero/ComfyUI-tools_zero
Then restart. The pack's requirements.txt pulls transformers>=4.36, bitsandbytes (Windows/Linux), and mlx_lm on macOS. Bitsandbytes needs a CUDA-compatible build, which is where most install friction lives.
Where people get burned
The first run downloads a model - budget for it and don't panic when the queue sits there. On a 8–12GB card, the 7B bnb-4bit default is about your ceiling; the 14B will push you into the "please re-run the node" error even after the auto-clean, so don't fight it. One honest quirk: the temperature slider is passed to the tokenizer's decode step, not to generate(), so it largely doesn't control generation the way you'd expect - treat it as cosmetic and use seed for reproducibility. And remember the output_language dropdown: if it's set to 中文 you'll get Chinese prompts back, which is a feature if your base model likes them and a surprise if it doesn't.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| user_input | STRING | — | |
| prompt_type | COMBO | 建筑扩写 | 7 options: 建筑扩写, 电商扩写, 创意扩写, 详细扩写, 视频提示词(多段运镜), 视频提示词(快速运镜), +1 |
| model | COMBO | Qwen2.5-7B-Instruct-bnb-4bit | 5 options: Qwen2.5-3B-Instruct, Qwen2.5-3B-Instruct-bnb-4bit, Qwen2.5-7B-Instruct, Qwen2.5-7B-Instruct-bnb-4bit, Qwen2.5-14B-Instruct-bnb-4bit |
| quantization | COMBO | none | 3 options: none, 4bit, 8bit |
| keep_model_loaded | BOOLEAN | false | — |
| temperature | FLOAT | 0.70–1 | — |
| seed | INT | -1-1–99999 | — |
| max_new_tokens | INT | 512128–2048 | — |
| output_language | COMBO | english | 2 options: english, 中文 |
| system_promptopt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |