Prompt Relay Smart Encode Test
Check your segment syntax before you burn a GPU run
- clip
- parsed_output
This one doesn't generate anything. It's a scratch pad: type your Smart syntax in, get back a plain string showing exactly how the node parsed it, and find out you got the bracket ranges backwards before you've spent five minutes rendering a clip to discover the same thing. If you've read the Prompt Relay Encode (Smart) node's docs and you're not 100% sure whether your [0-50] | [50-150] weights are doing what you think, this is where you go first.
What it's for
Smart syntax has two flavors - inline pipe-separated segments with optional [start-end] or [weight] tags, and block-style newline headers like Scene 1: or Part 2-5: - and it's easy to get the weighting math wrong in your head, especially with range headers where the span of the range is what counts, not the numbers themselves. Scene 2-5: doesn't mean "the fifth scene," it means a segment worth 3 units of weight (5 minus 2). This node exists purely so you can sanity-check that before it's wired into a full model+clip+latent pipeline.
Inputs and outputs that matter
smart_prompt- the exact same field and syntax as the real Smart Encode node. Paste in whatever you're planning to use.normalize_by_tokens(default off) - same toggle as the real node: when on, each segment's weight gets scaled by its actual token count rather than just the bracket/range weight.clip(optional) - connect this if you're testing withnormalize_by_tokenson. Token counting needs an actual tokenizer to count against, which is whatclipsupplies here; if you're just checking that your segments and weights parse the way you expect, you can leave it disconnected.
The single output, parsed_output, is a plain STRING - wire it to a "Show Text" style node or similar to actually read it. There's nothing to sample or preview here; it's diagnostic text, not conditioning.
Installing it
Comes with the pack, no separate install. Search "ComfyUI-PromptRelay" in ComfyUI Manager, or git clone https://github.com/kijai/ComfyUI-PromptRelay into custom_nodes and restart. Same optional word2number dependency as Smart Encode applies here too, if you're testing word-form headers like "Scene eleven:" (pip install word2number) - without it, stick to digit headers.
Common issues
Not knowing what to do with the output. parsed_output is a raw string, not conditioning - you need something to display it, like a text-preview node, or you're just running this in a void. It's meant to be a dead-end diagnostic branch off to the side of your real graph, not part of the pipeline that reaches your sampler.
Testing normalize_by_tokens without clip connected. Since token counting needs a tokenizer, leaving clip unplugged while that toggle is on isn't going to give you a meaningful preview of the token-normalized weights - connect the same CLIP you're using in your real workflow if you actually care about that number.
Forgetting this node exists at all. Given it has zero recorded search impressions so far, most people building Prompt Relay workflows probably just wire straight into the real Smart Encode node and iterate by re-running the whole graph. That works, but if you're debugging a specific syntax question - did that range header actually give segment 2 triple the weight - this node answers it in seconds instead of a full render.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| smart_prompt | STRING | Enter prompt using Smart Syntax:\n1. Inline: 'text one [0-50] | text two [50-100]'\n2. Block: 'Second 1:\ntext one\nSecond 2:\ntext two'\nSyntax is auto-stripped and normalized evenly or proportionally. | |
| normalize_by_tokens | BOOLEAN | false | — |
| clipopt | CLIP | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| parsed_output | STRING | — |