Nodes/ComfyUI-ZoeyTool/Zoey - 纯净翻译器
ComfyUI Node

Zoey - 纯净翻译器

Translate prompts between ZH/EN/JA/KO — local model, Baidu key, or the free Google trick

By liangzoey·Created about a year ago·Updated 3 days ago· 5
Zoey - 纯净翻译器
    • 纯净翻译文本
    • 处理耗时(秒)
    text
    source_langauto
    target_lang英文
    engine内置模型
    api_key
    max_length120

    PureTranslator is the "I need this prompt in another language, right now, and I'm not leaving ComfyUI" node. You're browsing a Chinese workflow and every prompt is in a language you don't read, or you've written a great English prompt and the model you're about to use is clearly happier with Chinese. Paste the text in, pick target language, and you get a translation back on a wire you can route straight into a CLIP Text Encode. No copy-paste through Google Translate tabs, no API key ceremony unless you want one.

    It's from comfyui-ZoeyTool, which pairs it with a much heavier sibling - the HunyuanTranslatorNode that runs a full local Tencent translation LLM. PureTranslator is the light version: ZH/EN/JA/KO only (Chinese, English, Japanese, Korean), which honestly covers the vast majority of "translate this prompt" needs in this ecosystem, because those four languages are where ComfyUI prompts actually live.

    How it works - pick your engine

    Three engines behind one dropdown, and they're very different animals:

    • 内置模型 (built-in model). Runs Helsinki-NLP's opus-mt models locally through the transformers pipeline - the model choice is derived from your source/target pair (e.g. zh→en loads Helsinki-NLP/opus-mt-zh-en). It downloads the checkpoint from Hugging Face on first use, then translates offline. Free, private, but the models are modest, and the code hard-caps your input at about 200 characters, so don't throw a whole article at it.
    • 百度API (Baidu API). Needs an api_key in app_id:secret_key format. Uses Baidu's official translation endpoint, no local model weight. If your text is long or your pair is unusual, this is the robust option - at the cost of a (free-tier) Baidu developer account.
    • 谷歌API(免费) (Google, free). Hits the unofficial translate.googleapis.com web endpoint with no key. It's the same trick free translation scripts have used for years: fast, no setup, and occasionally rate-limited or blocked depending on where your network lives. When it fails, the node returns an error string as your translation text, so read output carefully.

    Outputs are the translated string (纯净翻译文本) plus 处理耗时(秒), a float you can log if you're benchmarking engines. For a prompt-translation loop, wire the string straight into your text encoder and don't look back.

    Installing it

    Part of comfyui-ZoeyTool:

    cd ComfyUI/custom_nodes
    git clone https://github.com/liangzoey/comfyui-ZoeyTool.git
    cd comfyui-ZoeyTool
    pip install -r requirements.txt
    

    Restart ComfyUI, or install via ComfyUI Manager by searching comfyui-ZoeyTool. The built-in engine needs transformers (the pack pulls it in) and downloads the opus-mt checkpoint to the Hugging Face cache on first use - internet required once, then it's local.

    Where people get burned

    The biggest surprise is the 200-character truncation on the built-in engine - long prompts get silently chopped, so either keep inputs short or use the Baidu/Google engines for long text. Second: the "Google API(免费)" option returning 无法连接谷歌服务 or 谷歌翻译API错误 inside the output field isn't a crash, it's the node's way of telling you the endpoint didn't answer - check network, not the workflow. And third, don't expect the Helsinki models to be translation miracles; they're good enough for prompt pivoting, not for legal documents. For quality on obscure language pairs, the Baidu engine with a key is the one you'd actually rely on.

    CategoryZoey Tool/文本处理

    Inputs (6)

    NameTypeDefaultDescription
    textSTRING
    source_langCOMBOauto5 options: auto, 中文, 英文, 日语, 韩语
    target_langCOMBO英文4 options: 英文, 中文, 日语, 韩语
    engineCOMBO内置模型3 options: 内置模型, 百度API, 谷歌API(免费)
    api_keyoptSTRING
    max_lengthoptINT12050–300

    Outputs (2)

    NameTypeDescription
    纯净翻译文本STRING
    处理耗时(秒)FLOAT