Badge Render Prompt Builder (DAELab)
The prompt that stops GPT-Image from redesigning your artwork
- unmatched_mask
- design_foreground_mask
- prompt
- structure_constraints
- material_semantics
- height_semantics
What it is and why you'd reach for it
Ask GPT-Image-2 for "a premium enamel badge with this design" and you will get a beautiful badge with your design - mostly. The letterforms will be almost your letterforms. The thin separator line will be slightly bolder. Two elements will have swapped vertical order because it thought the composition looked better that way. For a photo, none of that matters. For a badge that has to be manufactured from the artwork, every one of those is a defect.
Badge Render Prompt Builder exists to remove the model's creative latitude from the first render. It assembles a fixed, aggressive constraint block - outline, graphics, text order, colour boundaries and element positions all belong to Image 1, and the camera is dead front-on with no drama - then optionally layers height and material semantics on top. You supply business intent in user_prompt; the node supplies the framing.
How it works
The prompt is three to five paragraphs of hard rules, and the split matters because the node gives each paragraph its own output. The structure block is unconditional and long: front-on, centered, fully in frame, orthographic or near-orthographic, neutral lighting, no crop, preserve every visible character and its order, don't add or remove text, symbols or structure, no studio drama, no depth of field, no perspective change.
If use_height is on, a height paragraph is added and the node does a real check first: it intersects unmatched_mask with design_foreground_mask, computes what fraction of the foreground is unmatched, and raises Height color validation failed if that exceeds unmatched_limit_percent. The default limit is 0.5% - brutally tight, and correct: unmatched foreground pixels are design regions with no assigned height tier, which means the height map is lying about part of the badge. The paragraph that gets emitted also states the legal levels (0.2 through 1.0 plus 0/black as cut-out) and the accepted unmatched ratio, so the model has a number rather than a vibe.
Material semantics come through material_semantics_input (typically from a material prompt node or a region-material node) and only appear when use_material is true. user_prompt is appended last, prefixed as "Additional business intent" - subordinate to the constraints, not competing with them.
Inputs and outputs that matter
The two toggles use_material and use_height are the real controls. unmatched_limit_percent you'll tune once per design and then forget. user_prompt is where "add a subtle laurel at the bottom" goes - and yes, asking for an addition contradicts the "do not add decoration" clause, so phrase user intent as emphasis on what's already in Image 1 rather than as a new element.
Outputs: prompt is the assembled string for the GPT node. structure_constraints, material_semantics and height_semantics are the individual blocks, which is genuinely useful if you're composing a different prompt elsewhere or want to log which constraint fired.
One wiring gotcha that bites everyone once: the prompt talks about Image 1 and Image 2 by position. Image 1 must be the normalized flat design and Image 2 the grayscale height map, in that order, on the native GPT node. Wire them backwards and you get a beautiful grayscale render of a heightmap.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/TeutonicMepheles/ComfyUI-DAELab-Custom-Nodes-Library
Restart ComfyUI. Manager install by pack title works. This one is a classic-style backend node with no browser widgets, so it needs nothing beyond Torch and - because it shares a module with the mask maths - OpenCV, which the pack's requirements.txt doesn't list: pip install opencv-python-headless if it's missing from the menu. The generative side is a separate concern entirely: GPT Image is a closed hosted model, so you're using ComfyUI's API nodes and prepaid credits, or an OpenAI-key node, not a local checkpoint.
Common issues
Height-enabled badge rendering requires unmatched_mask and design_foreground_mask.use_heightis on with nothing wired. Either connect the height layer'sunmatched_maskand the canvas foreground, or switch it off.Height color validation failed: 3.412% … limit is 0.500%. The message tells you exactly what's wrong. Some design colour has no height-layer rule assigned, so add a rule in the height layer node rather than raising the limit - that's the whole point of the check.- The model still reflows the text. At some sizes GPT-Image just won't hold dense small type. Render bigger, or reduce the copy. No prompt fixes that.
- Two prompts, one node. If you're also feeding a material prompt, feed it into
material_semantics_inputrather than pasting it intouser_prompt, or the material block loses its dedicated section.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| use_material | BOOLEAN | true | — |
| use_height | BOOLEAN | true | — |
| unmatched_limit_percent | FLOAT | 0.50–100 | — |
| user_prompt | STRING | — | |
| material_semantics_inputopt | STRING | — | |
| unmatched_maskopt | MASK | — | |
| design_foreground_maskopt | MASK | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| prompt | STRING | — |
| structure_constraints | STRING | — |
| material_semantics | STRING | — |
| height_semantics | STRING | — |