Nodes/comfyui-mixlab-nodes/Chinese Prompt ♾️Mixlab
ComfyUI Node Runs on cloud

Chinese Prompt ♾️Mixlab

Write your prompt in Chinese, get English out

By MixLabPro·Created 3 years ago·Updated 2 months ago· 1,859
Chinese Prompt ♾️Mixlab
    • prompt
    text
    generationoff
    seed100

    Most image models were trained on English captions, so a Chinese prompt gets you mush. This node fixes that the obvious way: you type in Chinese, it translates to English, and hands the English text to your CLIP encoder. Given that Mixlab comes out of shadowcz007's Chinese ComfyUI community, this is a first-class citizen of the pack, not an afterthought.

    What it does under the hood

    Two things, and the second is optional. First it runs your text through a local Helsinki-NLP opus-mt-zh-en translation model - a small, offline machine-translation model, no API, no key. That alone turns "一只戴帽子的猫" into "a cat wearing a hat" and lets a standard SD/SDXL/Flux checkpoint understand you.

    Then, if you flip generation to on, it also pushes the translation through a prompt-expander (text2image-prompt-generator) that pads your short phrase out into a fuller, more descriptive prompt with the modifier-style language these models like. Leave it off and you get a clean, faithful translation and nothing more.

    The inputs

    Only three, and one's optional:

    • text - your prompt, in Chinese. Multiline, so write as much as you want.
    • generation - on expands the translated prompt into something longer and more descriptive; off just translates. If you want tight control over your prompt, keep this off. If you want the node to embellish, turn it on.
    • seed (optional) - only matters when generation is on, since the expansion has some randomness. Same seed, same expanded prompt.

    The output is prompt (a string list) - wire it straight into a CLIP Text Encode.

    Installing it

    Pull the whole pack. ComfyUI Manager is easiest: search mixlab, install comfyui-mixlab-nodes, restart. Or clone it:

    cd ComfyUI/custom_nodes
    git clone https://github.com/shadowcz007/comfyui-mixlab-nodes
    

    then install requirements (install.bat on Windows portable, or pip install -r requirements.txt) and restart.

    The thing everyone hits first

    This node needs two models the pack doesn't bundle, and it will complain about them on startup. You'll see console lines like:

    ## zh_en_model not found: .../models/prompt_generator/opus-mt-zh-en, pls download from https://huggingface.co/Helsinki-NLP/opus-mt-zh-en
    ## text_generator_model not found: .../models/prompt_generator/text2image-prompt-generator, pls download from https://huggingface.co/succinctly/text2image-prompt-generator
    

    That exact warning has tripped up plenty of people since the node shipped. It's not an error - the pack loaded fine - it's just telling you the translation model isn't there yet. Download the two repos to the paths it names:

    You strictly only need the second one if you plan to use generation: on. The translation model (opus-mt-zh-en) is the non-negotiable one.

    Worth knowing

    • The translation model is small and local - it's a real machine-translation model, not an LLM, so don't expect it to interpret idioms or slang. Plain, literal Chinese gets you the cleanest results.
    • If you want smarter translation and you already have an LLM node in play, the pack's ChatGPT node can translate too - but for a quick, offline zh→en pass, this dedicated node is less setup.
    • Missing-model warnings aside, if the whole ComfyUI canvas freezes after adding a Mixlab node, that's a known separate JS conflict with this pack, not this node's fault.
    Category♾️Mixlab/Prompt

    Inputs (3)

    NameTypeDefaultDescription
    textSTRING
    generationCOMBOoff2 options: on, off
    seedoptINT100100–18446744073709550000

    Outputs (1)

    NameTypeDescription
    promptSTRING