Prompt Machine
Six boxes instead of one word-salad string
- prompt
Structure your prompt before the sampler does
"Word salad" is the most common failure mode in AI prompting. Subject, style, lighting, mood, composition - all jammed into one string, comma-spliced in whatever order you happened to type them. Prompt Machine's whole argument is that the prompt box shouldn't be one box. It gives you six labeled slots - subject, style, lighting, composition, mood, technical - and joins them for you.
That's useful beyond tidiness, because prompt structure is now a mechanism, not an aesthetic. The modern model generation reads prompts through general-purpose LLMs that bind attributes to subjects based on order and grouping - reordering two sentences can fix which character is holding the cake. Keeping scene elements in separate fields means you can edit one aspect without unwriting the other five, and the slots are dynamic-prompt compatible, so wildcards work in any of them.
How it works
Nothing clever, which is the point. The node takes the six strings, drops the empty ones, and joins the rest with ", ". The order follows slot order, so subject leads - exactly what you want, because earlier tokens get stronger attention on the CLIP-based SDXL lineage. Flip json_output on and it instead emits a JSON object with the six keys (empty fields dropped) - a clean feed for an LLM-rewriting node or an API pipeline that wants structured input. The prompt-engineering evidence behind that: JSON-with-clean-field-separation demonstrably holds composition together on LLM-encoded models, and this node hands you that format for free.
Each slot is autocomplete-enabled if you also use the pack's Prompt Autocomplete node - type # in any box and the tag popup appears, which makes the six-slot workflow far faster than it sounds.
The inputs that matter
- subject - the thing in the frame. Put this first; it gets the strongest attention.
- style, lighting, mood - the adjectives, in whatever order you care about them.
- composition, technical - camera, framing, quality tags.
- json_output - the only non-text input. On = strict JSON, off = comma string.
One output, prompt - wire it to your CLIP Text Encode node's positive input (or into an LLM prompt chain).
The honest caveat
This node doesn't write your prompts for you, and it isn't model-agnostic. On the tag-trained SDXL lineage (Illustrious, Pony, NoobAI), the comma-join output is exactly right. On natural-language models like FLUX or Z-Image, a comma-separated dump of six boxes reads like a list rather than an instruction - those models want sentences. The README acknowledges this by framing the output as "dynamically formatted for FLUX (Natural Language) or SDXL (Comma Separated)", but the practical version is: on FLUX/Z-Image, write your subject slot as a sentence and use JSON mode when you have several characters with several attributes. The framework is the feature; the join is just convenience.
Install
Standard pack install - ComfyUI Manager search "SATA UtilityNode", or:
cd ComfyUI/custom_nodes
git clone https://github.com/SatadalAI/SATA_UtilityNode
then restart. No models, nothing to download.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| subject | STRING | Core hero or subject and physical details (age, hair, eyes, outfit, accessories). Example: 'A young female astronomer with messy raven hair and grey eyes, wearing a fitted leather jacket.' | |
| pose_and_expression | STRING | Body posture, facial expression, action, and primary gestures. Example: 'Leaning over an ancient star map with a subtle smile, holding a brass compass in her right hand.' | |
| secondary_subject | STRING | Supporting characters, companion animals, or secondary focal objects. Example: 'A sleek white robotic cat sitting on the desk beside her, watching the holograms.' | |
| background_and_environment | STRING | Immediate physical surroundings, wider environment, and background setting. Example: 'Inside a high-tech glass dome observatory with scattered parchment maps, overlooking a star-filled galaxy.' | |
| lighting | STRING | Lighting sources, direction, intensity, reflections, shadows, and mood. Example: 'Soft cyan holographic glow illuminating her face, warm golden sunlight streaming through the side window.' | |
| style | STRING | Visual medium, photographic style, aesthetic textures, and dominant color palette. Example: 'Cinematic 35mm film photography, fine grain, shallow depth of field. Deep navy blues and warm amber tones.' | |
| creative_hook | STRING | One surreal, impossible, or striking visual concept. Example: 'Constellations floating like tiny glowing fireflies in the air inside the room.' | |
| technical | STRING | Camera equipment, lens specs, shot type, and framing (Optional). Example: 'Shot on 85mm f/1.4 lens, eye-level medium close-up, sharp focus on subject, soft background bokeh.' | |
| json_output | BOOLEAN | false | Output structured JSON mapping instead of a formatted text paragraph. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| prompt | STRING | — |