Nodes/ComfyUI-DAELab-Custom-Nodes-Library/Badge Height Establish Prompt Builder
ComfyUI Node

Badge Height Establish Prompt Builder

Turning a six-level grayscale map into a manufacturable relief

By TeutonicMepheles·Created 4 months ago·Updated 2 days ago· 0
Badge Height Establish Prompt Builder
  • height_profile
  • prompt
  • height_report
  • structure_prompt
  • base_render_prompt
◄material_semantics—►

What it is and why you'd reach for it

A heightmap is a number per pixel. A badge is a stamped piece of metal with plateaus, shoulders, fillets and cut-outs. The gap between those two things is where most "AI generated 3D-looking badge" attempts fall apart: the model sees a grayscale image, treats it as a picture of relief, and paints you a nice render with fake shading that has no relationship to your five height tiers.

This node closes that gap by translating. It takes the height profile that Badge Height Layer produces - which levels actually matched pixels, how many, which configured levels came up empty - and writes three different prompts about it. The teaching is in the text: nominal Z equals alpha/255, level 1 is 0.2, level 2 is 0.4, up to 1.0 for level 5, and a larger nonzero value must be physically higher. It's the boring, precise version of "make it 3D."

How it works

height_profile is a structured dict straight off the height layer node, so the prompt describes your map, not a generic one. The builder counts matched solid levels, lists the active ones, and puts a concrete statement in the text like "Image 2 contains exactly 3 matched solid height levels."

Then come the rules that make this thing actually useful:

  • Contour priority. Existing narrow linework in Image 1 - the outer rim, internal separator strokes, text outlines - is treated as the highest part of the badge, and any of those contour pixels encoded at a lower height get promoted to the highest active level. This is stated as the only permitted override of Image 2, and it's the rule that makes a badge look struck rather than vacuously extruded.
  • Cut-outs are holes. An active 0.0 category means true through-cut, not a low solid surface. Don't fill, cap, bridge or coat across it.
  • No invented tiers. Use only the active levels; don't renormalize them; don't blur or move boundaries; get the shoulders and fillets inside the existing edges.

The outputs split by purpose. prompt is the neutral grayscale relief proof - achromatic, matte, orthographic, "geometry proof, not a finished badge." structure_prompt is the same contract compressed to geometry, with appearance policy stripped out, for when something else owns the look. base_render_prompt is the money one: it stitches the structure contract together with a hard colour-authority paragraph and an optional material block, producing a complete prompt for one finished coloured front-facing badge on pure white - the kind you feed into the first GPT-Image-2 node.

height_report is diagnostics in plain text: configured / present / configured-but-empty levels, matched pixel counts per layer, unmatched pixels, excluded transparent pixels. When a level you configured produces nothing, this is where you see it.

Inputs and outputs that matter

height_profile - required, and it only comes from the height layer nodes. Optional material_semantics is a string: wire the material prompt node's semantics here and it lands in base_render_prompt's MATERIAL SEMANTICS section, with the colour lock winning over any material instruction that would darken or tint. Leave it empty and you get a deliberately neutral "preserve intrinsic colours, restrained manufactured surface" default.

Outputs: prompt (grayscale proof), height_report, structure_prompt, base_render_prompt. Route them to two separate GPT nodes if you're doing the two-stage generate-then-render flow; they're intentionally not interchangeable.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/TeutonicMepheles/ComfyUI-DAELab-Custom-Nodes-Library

Restart ComfyUI. Manager install by pack title works too. The height-layer module imports OpenCV, which the pack's requirements.txt doesn't declare - pip install opencv-python-headless if the node is missing from the menu.

Common issues

  • Image 1 / Image 2 confusion. The prompts are positional. Image 1 is the flat design, Image 2 is the height map. Wire them reversed and the model will produce a stunning grayscale image of a gradient.
  • "Configured but empty" levels. Your colour-match threshold didn't catch that region, or the colour isn't in the flat artwork at all. Nothing downstream can invent the tier.
  • The proof looks flat. Level 0–1 encodings are visually subtle by design; the grayscale proof is a geometry check, not a beauty pass. Look at normal_preview from Badge Height Locked Base V1 if you want to see the relief the map actually implies.
  • You fed the grayscale proof back as Image 1. Don't. It has no colour authority and the base render will inherit grey.
CategoryDAELab/Badge/Prompt

Inputs (2)

NameTypeDefaultDescription
height_profileBADGE_HEIGHT_PROFILE—
material_semanticsoptSTRING—

Outputs (4)

NameTypeDescription
promptSTRING—
height_reportSTRING—
structure_promptSTRING—
base_render_promptSTRING—