小珠光文本框
The text box that turns '1280x720' into 一二八零乘以七二零
- text
- text_zh_num
Here's a problem you only have if you prompt in Chinese: diffusion models with Qwen-style LLM encoders read Chinese text, but they read digits badly. "1280x720" as raw ASCII is a sequence of characters a model has seen mostly in code and filenames; "一二八零乘以七二零" is how a Chinese speaker actually says it. XiaozhuguangTextBox (小珠光文本框) is a text box with a genuinely weird trick: besides passing your text through unchanged, it converts the numbers in it into spoken-form Chinese. It exists because the pack author clearly got tired of prompting "1个女孩,身高188cm" and watching the model mangle the numbers.
The mechanism is a small rule engine in Python that rewrites digits while leaving everything else alone. It has four behaviors, and they matter because each exists to avoid the classic failure of naive number-to-Chinese converters - reading every digit as a serial number. It reads:
- Products / resolutions -
1280x720(or×,*,X) becomes 一二八零乘以七二零, digit-by-digit with the multiplication spelled out. - Numbers with units - a digit followed by a whitelisted unit (个, 岁, cm, kg, ℃, %, and so on) gets the full reading: 12岁 → 十二岁, 188cm → 一百八十八厘米. It even converts common English abbreviations (cm → 厘米, kg → 千克).
- Ordinals - 第12章 → 第十二章, 第1名 → 第一名.
- Everything else - bare numbers, model codes, serials read digit-by-digit (型号1280 → 型号一二八零), so you don't mispronounce a code as a quantity.
Newer versions added whole-date-time recognition: 2023.4.16 21:08 → 二零二三年四月十六日九点零八分, which is a rabbit hole the author clearly enjoyed.
Inputs and outputs are minimal:
- text - your multiline input.
- text (output) - the original, unchanged, for nodes that want raw text.
- text_zh_num (output) - the number-to-Chinese version.
Two outputs is the design's saving grace: you don't have to choose. Feed text_zh_num to the Chinese-prompting encoder and text anywhere that needs the literal string.
The honest framing: this is a Chinese-language convenience node. If your prompts are English, this does nothing useful for you - English numbers were never the problem and the rewrite rules are Chinese-specific. If you prompt in Chinese with a Qwen-encoded model (or MiniMax, or any of the Chinese-first video models), it's the difference between spelling out "1280x720" and letting a model guess what those characters mean. That's a real quality lever for a small, self-contained node.
Install: ComfyUI Manager → ComfyUI-xiaozhuguang → restart, or git clone into custom_nodes. No models, no dependencies. It's a one-file utility that solves one specific, annoying problem - and for the people who have that problem, it's exactly the node they needed.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |
| text_zh_num | STRING | — |