提示词工程节点
A structured-prompt factory with 14 built-in job types
- response
- history
- prompt
PromptEngineeringNode is the pack's most ambitious prompt tool, and the most Chinese-first. Its display name is 提示词工程节点 ("prompt engineering node"), its 14 prompt_type choices are all Chinese (通用/general, 角色扮演/roleplay, 图像生成/image generation, 代码生成/code, 故事创作/storytelling, 营销文案/marketing copy, and more), and it works in two stages: first it builds a structured prompt for the job type using the LangGPT structured-prompt methodology - role, background, task, examples, evaluation, constraints, and so on, assembled as Markdown with XML tags - then it uses that structured prompt to generate your actual final content. You get both pieces, which is the interesting part.
That second stage is where it shines for image work. For 图像生成 it returns the structured prompt, plus the generated content, plus a Markdown history of the whole exchange - three outputs (prompt, history, response). So you can see exactly why it built the prompt it did, which is great for learning how prompt engineering actually works rather than just taking an answer.
The inputs are a grab-bag that reveal the design: input_text (your raw idea), prompt_type (14 roles), model_name (default llama2 - a hint that this was built for local Ollama), base_url (default https://api.openai.com/v1), api_key (blank by default), language (中文/英文), output_format (纯文本/Markdown/HTML/JSON), plus optional is_local (defaults false in the schema but true in the code's defaults - a classic mismatch), temperature, and max_tokens.
Installing it
cd ComfyUI/custom_nodes
git clone https://github.com/yiwangsimple/ComfyUI_GroqChat
restart. No model download for this one - it's an API/local-server node. requirements.txt covers the HTTP bits (httpx, aiohttp via openai's deps).
The honest reality check
This is the most complex node in the pack and also the fiddliest. The default base_url points at OpenAI, but the default model_name is llama2 and the default API key is empty - a combination that fails loudly until you fill in your own values. For a beginner, "I set a base URL, a model, and a key" is three more concepts than the Groq or Gemini nodes need. The README doesn't walk through it, and the source shows the local path hitting Ollama's /api/generate endpoint, so the intended happy path is probably local. If you want this to work, set is_local to True and model_name to something you've pulled in Ollama. Once it clicks, though, it's genuinely useful for turning a vague idea into a well-structured prompt - and watching the intermediate prompt output is a decent prompt-engineering tutorial in itself.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| input_text | STRING | — | |
| prompt_type | COMBO | 通用 | 14 options: 通用, 角色扮演, 图像生成, 文本生成, 代码生成, 对话系统, +8 |
| model_name | STRING | llama2 | — |
| base_url | STRING | https://api.openai.com/v1 | — |
| api_key | STRING | — | |
| language | COMBO | 中文 | 2 options: 中文, 英文 |
| output_format | COMBO | Markdown | 4 options: 纯文本, Markdown, HTML, JSON |
| is_localopt | BOOLEAN | false | — |
| temperatureopt | FLOAT | 0.70–1 | — |
| max_tokensopt | INT | 2000100–4096 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| response | STRING | — |
| history | STRING | — |
| prompt | STRING | — |