MOSS 字幕样式 · T8star-Aix
ASS styling without hand-editing a Style line
- MOSS 字幕样式
- 样式 JSON
If you've ever hand-edited an ASS subtitle file, you know the joy of a Style: line with fifteen colon-separated fields where one typo silently breaks every subtitle. T8_MOSS_SubtitleStyle is the node that builds that line for you. It's part of the MOSS Transcribe Diarize pack's export pipeline: it centralizes resolution, font, layout, outline, shadow, and per-speaker coloring into a single typed object you can reuse across as many T8_MOSS_SubtitleExport nodes as you like. Change the style once, every exporter picks it up.
There's not a lot of magic here - and that's the point. It's a clean configuration surface on top of a format that otherwise reads like a 1990s config file. You set it up once, and it feeds the ASS exporter.
The inputs that matter
- video_width / video_height - your output resolution, 1920×1080 by default. The ASS script resolution lives here, so set it to match your video or the subtitle text will scale wrong.
- font_size -
0means auto, derived from resolution. Set a fixed number if you want it locked. Auto is genuinely fine for most work. - font_name -
Noto Sans CJK SCby default, which is a solid choice for mixed CJK/Latin text. If you're rendering on a machine that doesn't have it installed, the player will fall back to something and it may look off - check your font availability. - alignment - ASS alignment, 1–9 (the numpad layout: 2 is bottom-center, the default and the one you'll almost always want).
- margin_v - vertical margin in pixels (default 56).
- speaker_colors - on by default; each speaker gets a distinct color so you can tell voices apart at a glance. This is the feature that makes diarization visible in the output.
- primary_color / outline_color / back_color - ASS
&Hcolors. And here's the trap: ASS uses BGR order, not RGB.&H00FFFFFFis white (it reads as00alpha +BBGGRR),&H00000000is black,&H64000000is semi-transparent black. If your colors come out swapped, you're pasting RGB hex into a BGR field. - outline (default 3) and shadow (default 1) - stroke and shadow width. If your subtitles disappear against white video, bump the outline.
Outputs: the MOSS 字幕样式 object (wire it into T8_MOSS_SubtitleExport) and a 样式 JSON dump if you want to inspect or share the exact values.
Installing it
Same pack, same steps:
cd ComfyUI/custom_nodes
git clone https://github.com/T8mars/Comfyui-MOSS-Transcribe-Diarize-T8.git comfyui-MOSS-Transcribe-Diarize-T8
cd comfyui-MOSS-Transcribe-Diarize-T8
pip install -r requirements.txt
python scripts/check_transformers.py # requires Transformers >= 5.5.0
python scripts/download_models.py --comfyui-root ..\..
Restart ComfyUI and it's there with the other eight nodes. Note it does not require the model - it's pure styling, so it works even if the model download failed.
Gotchas
- BGR colors, every time. The
&Hfields are ASS-native BGR. Swapped-looking colors are almost always this. There's no RGB→BGR conversion on the way in, which is correct for ASS but easy to forget. - Resolution drives font auto-sizing. If you set
font_sizeto auto (0) and yourvideo_width/heightdon't match the actual video, the scale will be subtly off. Set resolution first, then decide whether auto-size is right. - It's a config object, not an exporter. It produces no subtitles itself. If you wire it to a preview expecting SRT output, you'll get style JSON instead - that's the wrong node for that job. Pair it with
T8_MOSS_SubtitleExport. - Structure validation is real. The pack validates style fields (no stray commas or newlines that would corrupt the ASS Style line), so a bad value errors at the node instead of corrupting the file downstream.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| font_name | STRING | Noto Sans CJK SC | — |
| font_size | INT | 00–512 | — |
| alignment | INT | 21–9 | — |
| margin_v | INT | 560–2160 | — |
| speaker_colors | BOOLEAN | true | — |
| primary_color | STRING | &H00FFFFFF | — |
| outline_color | STRING | &H00000000 | — |
| back_color | STRING | &H64000000 | — |
| outline | INT | 30–20 | — |
| shadow | INT | 10–20 | — |
| video_width | INT | 192016–16384 | — |
| video_height | INT | 108016–16384 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| MOSS 字幕样式 | T8_MOSS_SUBTITLE_STYLE | — |
| 样式 JSON | STRING | — |