Construct LLM Prompt
Turn your image-generation ask into a prompt an LLM will actually obey
- prompt
The pack's LLM integration is the ambitious half of Sage Utils - a whole chat tab, vision support, and a stack of prompt-building nodes, all pointed at local models running in LM Studio or Ollama. Construct LLM Prompt is the node that builds the text you'd feed such a model: it assembles a structured instruction prompt from a base template plus a row of toggleable constraints, and hands you the finished STRING.
Here's what you get on the inputs. The prompt combo is the base template, and it's a dropdown of curated starting points from the pack's llm_prompts.json config: things like tagging/booru, tagging/danbooru, art_critique/art_critic, description, caption, and more. Pick the job you want the LLM to do. extra_instructions is your free-text addition - whatever specific guidance you want appended verbatim. Then comes the row of booleans that spice the base template: only_output_description (on by default), be_specific, avoid_flowery_language, non_technical, exaggerate_quality, exclude_watermarks, adult_content, erotic_imagery, exclude_sexual, use_vulgar_language... you get the idea. Each one appends a pre-written instruction line to the prompt when toggled on.
Mechanically it's text assembly, not magic. The node picks the selected base prompt, guarantees it ends with proper punctuation, appends each enabled toggle's canned instruction line, then tacks on your extra_instructions. The output is a single prompt string ready to feed the LLM tab, an LLM node, or anything else that speaks to a model. It's opinionated and that's the point: by construction, you get a well-formed instruction instead of the vague one-liner people usually type into a chat box.
Now the honest framing, because you'll hit it fast: the LLM features are the part of Sage Utils the README itself flags as work in progress, and they lean on you having a local model server running. The pack tries to reach LM Studio/Ollama at startup and will log connection warnings when neither is up - harmless noise, but real. Set SAGEUTILS_LOG_LEVEL=WARNING to quiet it. The prompt-construction nodes themselves work fine without a server, though: they're just string building. So you can happily use this node to generate a prompt, copy it, and paste it anywhere - including into an online model, if you're not running one locally.
The sibling node, Construct LLM Prompt Extra, is the same idea for the "detail" instructions (describe mood, include lighting, camera details, materials, and so on). Run this one for the main instruction, that one for the detail layer, and join them if you want both.
Install
ComfyUI Manager → search Sage Utils → install → restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/arcum42/ComfyUI_SageUtils.git
cd ComfyUI_SageUtils && pip install -r requirements.txt
Restart ComfyUI. For the LLM tab to do anything you'll also need LM Studio (load a model, start its local server) or Ollama (ollama pull llama3.2). The node itself has no extra requirements beyond the pack's dynamicprompts dependency.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | COMBO | The base prompt template to construct. | |
| extra_instructions | STRING | Additional instructions to append to the generated prompt. | |
| adult_content | BOOLEAN | false | Adult Content |
| avoid_euphemisms | BOOLEAN | false | Avoid Euphemisms |
| avoid_flowery_language | BOOLEAN | false | Avoid Flowery Language |
| be_specific | BOOLEAN | false | Be Specific |
| erotic_imagery | BOOLEAN | false | Erotic Imagery |
| exaggerate_quality | BOOLEAN | false | Exaggerate Image Quality |
| exclude_sexual | BOOLEAN | false | Exclude Sexual Content |
| exclude_watermarks | BOOLEAN | false | Exclude Watermarks |
| non_technical | BOOLEAN | false | Non-technical Terms |
| only_describe_key_elements | BOOLEAN | false | Describe Key Elements Only |
| only_output_description | BOOLEAN | true | Only Output Description |
| use_vulgar_language | BOOLEAN | false | Use Vulgar Slang and Profanity |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| prompt | STRING | The constructed LLM prompt. |