Nodes/ComfyUI_Anytext/Translator Loader
ComfyUI Node

Translator Loader

Load a local translation model for your prompts

By zmwv823·Created 2 years ago·Updated about a year ago· 103
Translator Loader
    • model
    • model_dir
    model_nameutrobinmv/t5_translate_en_ru_zh_small_1024
    weight_dtypeauto
    Auto_Download_Pathtrue

    AnyText was built by a Chinese research team and a lot of its natural workflow is in Chinese - but the SD 1.5 checkpoints underneath understand English prompts best. UL_TranslatorLoader loads a local, offline translation model so you can write your prompt in one language and feed the model another, without leaving ComfyUI or calling any external API. It pairs with UL_Translator, which does the actual translating; this node just gets the model into memory.

    The key word is local. Everything runs on your machine - no key, no cloud, no per-request billing. That's the right design for a node that might run on every generation.

    How it works

    You pick a model from the dropdown and the node downloads (on first use) and loads it, returning a TRANSLATE_MODEL handle plus the directory it landed in. The options span a few families: the small, fast utrobinmv/t5_translate_en_ru_zh_small_1024 (English/Russian/Chinese), Alibaba's iic/nlp_csanmt_translation_* models for Chinese↔English, botisan-ai/mt5-translate-zh-yue for Cantonese, and Meta's facebook/nllb-200-* series (the 600M distilled up to the 3.3B) for broad multilingual coverage. Bigger models translate better and cost more VRAM and download time - the usual trade.

    The inputs and outputs that matter

    • model_name - which translator to load. The default utrobinmv/t5_translate_en_ru_zh_small_1024 is the lightweight, sensible starting point. Step up to an NLLB model if you need languages beyond EN/RU/ZH or want higher quality.
    • weight_dtype (default auto) - precision. auto is fine; the fp8 options exist but a translator this small rarely needs them.
    • Auto_Download_Path (BOOLEAN, default on) - let the node fetch the model into the standard path automatically. Turn it off if you've placed the model manually and want it read from your own location.

    Outputs: model (TRANSLATE_MODEL) into UL_Translator, and model_dir (STRING) so you can see where it was cached.

    How to install it

    ComfyUI Manager, search ComfyUI_Anytext, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/zmwv823/ComfyUI_Anytext
    

    then restart. Models auto-download to ComfyUI/models/prompt_generator (e.g. the T5 model lands in a models--utrobinmv--t5_translate_en_ru_zh_small_1024 folder). China-based users can pull the same models from hf-mirror.com or ModelScope if HuggingFace is slow.

    Common issues & troubleshooting

    First run hangs on download. These models are fetched on demand. The T5 small one is quick; the NLLB 3.3B is several gigabytes. If a cloud runner can't reach HuggingFace, download the model on a box that can and place it in models/prompt_generator, then set Auto_Download_Path off.

    Which model should I pick? For AnyText's Chinese→English case, the default T5 or the nlp_csanmt_translation_zh2en model are both aimed right at it. Only reach for the large NLLB models if you need languages outside that range - they're heavier for no benefit on a zh→en job.

    It loaded but nothing translates. This node only loads the model. The translation happens in UL_Translator, which takes this node's model output. Make sure that wire is connected.

    CategoryUL Group/Data Process

    Inputs (3)

    NameTypeDefaultDescription
    model_nameCOMBOutrobinmv/t5_translate_en_ru_zh_small_10248 options: utrobinmv/t5_translate_en_ru_zh_small_1024, iic/nlp_csanmt_translation_zh2en, iic/nlp_csanmt_translation_en2zh, iic/nlp_csanmt_translation_en2zh_base, botisan-ai/mt5-translate-zh-yue, facebook/nllb-200-distilled-600M, +2
    weight_dtypeCOMBOautoFor t5、nllb.
    Auto_Download_PathBOOLEANtrueDownload to `ComfyUI\models\prompt_generator` or huggingface cache dir. 下载模型到`ComfyUI\models\prompt_generator`或者缓存到huggingface缓存路径。

    Outputs (2)

    NameTypeDescription
    modelTRANSLATE_MODEL
    model_dirSTRING