Nodes/MediaForge/πŸ€„ Convert Chinese (OpenCC)
ComfyUI Node

πŸ€„ Convert Chinese (OpenCC)

Simplified β†’ traditional Chinese subtitles, with Taiwan's actual vocabulary

By leon80148Β·Created 4 months agoΒ·Updated 2 months agoΒ· 0
πŸ€„ Convert Chinese (OpenCC)
    • converted_text
    • saved_path
    β—„profiles2twp (η°‘β†’ηΉε°η£θ©žεΊ«)β–Ί
    β—„textβ–Ί
    β—„input_pathβ–Ί
    β—„filename_prefixβ–Ί

    MF_ConvertChinese converts between simplified and traditional Chinese, and it's the rare node with a genuinely niche superpower: it runs on OpenCC, whose profiles don't just swap character forms - they swap vocabulary. The default profile, s2twp, converts simplified to traditional with Taiwan wording: 俑息 becomes θ³‡θ¨Š, ηΆ²η΅‘ becomes ηΆ²θ·―. That's the difference between subtitles a Taiwanese viewer finds natural and subtitles that read like a mainland transcript wearing a traditional-font costume.

    Where it lives in a workflow: after translation, before burning. MediaForge's AI chain produces SRT as a string (MF_TranslateSubtitle.translated_srt); if that translation came out in simplified Chinese and your audience is Taiwanese, this node is the normalization step between the translator and MF_BurnSubtitle. It also works on plain text, and it can read an SRT file directly from disk.

    How it works

    OpenCC does character-level mapping, which is exactly what makes it safe for subtitles: the SRT timestamps and index lines pass through untouched because only the text content changes. There's no LLM and no chance of "the AI rewrote my timing." Paste text or wire a STRING in, pick a profile, and you get text back - or set filename_prefix and it writes output/<prefix>_NNNNN.srt (it decides .srt vs .txt by whether the content contains --> timestamps).

    The inputs that matter

    • profile - the four OpenCC presets: s2twp (simplified β†’ traditional, Taiwan vocab - the default, and the one you want for Taiwanese audiences), s2t (plain simpβ†’trad, no vocab swap), tw2sp (Taiwan traditional β†’ simplified), t2s (plain tradβ†’simp).
    • text - paste text or wire it from an upstream STRING.
    • input_path (optional) - read from a file instead; used only when text is empty. Auto-detects encoding (UTF-8 / GBK / BIG5 / UTF-16) via charset-normalizer.
    • filename_prefix (optional) - non-empty writes a saved file; empty = in-memory only.

    Outputs: converted_text (STRING) and saved_path (STRING, empty if no prefix given).

    Install

    Part of MediaForge. The opencc-python-reimplemented backend is a pure-Python, zero-C++ OpenCC port and it's in the pack's requirements.txt, so ComfyUI Manager (or a manual pip install -r requirements.txt) installs it automatically - no extra step:

    cd ComfyUI/custom_nodes
    git clone https://github.com/leon80148/comfyui_MediaForge.git
    # restart ComfyUI
    

    Common issues

    The main trap is expecting traditional Chinese viewers to be fine with any traditional conversion - they're not; s2t produces grammatically mainland phrasing in traditional glyphs, which reads off. If your audience is Taiwan/HK, use s2twp. For non-UTF-8 SRT files, the encoding auto-detection needs charset-normalizer - it's in requirements.txt, but if you see a decode error, that's the dependency to check. And remember input_path is ignored while text is non-empty - empty the text field to switch to file mode.

    CategoryMediaForge/Subtitle

    Inputs (4)

    NameTypeDefaultDescription
    profileCOMBOs2twp (η°‘β†’ηΉε°η£θ©žεΊ«)4 options: s2twp (η°‘β†’ηΉε°η£θ©žεΊ«), s2t (η°‘β†’ηΉι€šη”¨), tw2sp (繁台灣→簑), t2s (ηΉι€šη”¨β†’η°‘)
    textSTRINGβ€”
    input_pathoptSTRINGβ€”
    filename_prefixoptSTRINGβ€”

    Outputs (2)

    NameTypeDescription
    converted_textSTRINGβ€”
    saved_pathSTRINGβ€”