FunUI Prompt Markup
Attention Weights That Actually Work on an LLM Encoder
- clean
- markup
- status
If you came from SDXL, you know (word:1.4). If you've since moved to a model with a language-model text encoder - H3, Flux 2, Z-Image, anything Qwen- or Gemma-backed - you've also learned that weighting is dead: the encoder wrapper disables it, and worse, your parentheses get passed into the prompt as literal punctuation. Your emphasis did nothing and added noise.
FunUI Prompt Markup is the pack's answer to that, and it's the most technically interesting node in the whole set. It parses the markup out of your prompt, gives you back clean text for the encoder, and hands the intent to a second node that applies it where weighting still means something: attention.
What it actually does
One left-to-right pass strips three kinds of markup, so every span indexes the same clean string (doing them one after another shifted the offsets, which is a bug you'd never find by eye):
(phrase:1.5)or[phrase:1.5]- weight. Applied as a logit bias oflog(w)on that phrase's key positions.softmax(logits + log w)multiplies that key's share of attention by w, which is what a weight was always supposed to mean. Scaling embeddings wouldn't work here: on an LLM encoder the rows are contextual hidden states with no per-word magnitude to turn up.[phrase@2-4]or[phrase:1.5@2-4]- timed phrase. Only the video rows inside that window see it, weighted; outside the window it's masked off from video entirely, while text and audio rows keep the plain untimed bias. On a five-second clip, this is how you make "rain" exist in seconds 2 through 4 and not before.[phraseA|phraseB], optionally:0.8- blend. Row-by-row(1-s)*A + s*Bconditioning, default strength 0.5.
There are sane clamps, which is the difference between a toy and a tool: bias is capped at ±6, a weight at or below 0.001 becomes a −30 mask instead of log(0) feeding you NaNs, and overlapping spans add with headroom so (word:2.0) still means 2.0 rather than 3.5.
Inputs and outputs
One input, and it's just your prompt:
- text - multiline, and it's the same text you'd otherwise paste into the encoder.
Three outputs:
- clean - the prompt with the markup removed. This is what you wire into your text encode. If you skip it, you're back to punctuation soup.
- markup - a
FUNUI_MARKUPobject. It's meaningless on its own; it goes into FunUI Apply Prompt Markup, which is the node that installs the bias on the model and touches up the conditioning. This one node alone changes nothing but your text. - status - a count of what it found, e.g.
1 weighted, 1 timed, orno markup.
Installing it
The pack install covers it:
cd ComfyUI/custom_nodes
git clone https://github.com/digital-garbage/FunUI
cd FunUI && pip install -r requirements.txt
Manager: search FunUI. Restart ComfyUI. No models, no extra deps - this node is pure string work. (The pack page still says olivv-cs/ComfyUI-FunPack; the project is now digital-garbage/FunUI. Same code, new name.)
Practical note: this only does something on a model whose module can map words to positions in the token stream - that's the H3 path the pack is built around. Applying markup on a model nobody has written that mapping for gets you a status saying it wasn't applied, and a prompt that went in without it. Silent no-ops are exactly what the pack's status outputs are there to prevent, so read them.
Where people get burned
Expecting weights to stack like CLIP. ((word)) on an LLM encoder was never going to work, and it still won't - you write (word:1.5). Practical range 0.5–1.5; past about 1.5 you're fighting the clamp and the model's own judgement.
Timing ranges that don't match your frame count. The window is in seconds of video, so a [rain@8-12] on a four-second clip will simply never fire.
Turning on FunUI Enhance Prompt at the same time. The enhancer's log warns about it for a reason: an LLM rewriting your prompt reads [rain@2-4] as text and either drops it or describes it. Enhance first, then markup - not the other way round.
Forgetting that "not applied" is a real outcome. Check the status string on Apply Prompt Markup. If the text encoder isn't one the model module can place words in, the prompt still goes through - just without your weighting, and the picture looks like the markup did nothing.
Reading this as a universal feature. It's a fix for a specific 2026 problem: LLM-encoded models that dropped weighting. On SDXL lineage, keep using CLIP weights - they already work, and this plumbing isn't the shortest path.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| clean | STRING | — |
| markup | FUNUI_MARKUP | — |
| status | STRING | — |