Nodes/comfyui_LLM_party/☁️Mini Long Text Translator
ComfyUI Node

☁️Mini Long Text Translator

Translation with a tone dial, not just a language swap

By heshengtao·Created 2 years ago·Updated 7 days ago· 2,321
☁️Mini Long Text Translator
    • output_str
    input_str
    target_languageEnglish
    tone正式
    degree5
    model_namegpt-4o-mini
    base_url
    api_key
    is_enabletrue

    Machine translation that just swaps words is easy to get for free anywhere. What's harder is translation that also respects register - formal versus casual, the difference between a legal document and a text message - and that's what this node adds on top of the basic job. Mini Long Text Translator, another one of comfyui_LLM_party's "mini-party" nodes, is a fixed-purpose LLM call: hand it text and a target language, and it comes back translated with a tone you control rather than whatever the model defaults to.

    The "Long Text" in the name is the tell that this is meant for more than a sentence - passages long enough that a single naive prompt might struggle to stay coherent or on-tone across the whole thing.

    The inputs and outputs that matter

    • input_str - the text to translate. No default; you have to provide it.
    • target_language (default English) - where it's translating to.
    • tone (default formal) - the register to translate into. It's a free-text field rather than an enum, so you're not locked to a preset list - describe the tone you want directly (casual, professional, playful, whatever fits).
    • degree (default 5, max 10) - a dial next to tone. The schema doesn't spell out exactly what it scales, but paired with tone the obvious reading is how strongly that register gets applied - how far the output leans into "formal" or "casual" rather than staying neutral. If the exact effect matters for your use case, the fastest way to know is running the same text through at a low value and a high value once and comparing, rather than guessing from the field name alone.
    • model_name (default gpt-4o-mini) - which LLM does the translating.
    • base_url / api_key (optional) - leave blank to inherit from config.ini, or set per-node.
    • is_enable - the pack's standard bypass toggle.

    Output: output_str (STRING) - the translated text.

    What it's good for, and what it isn't

    This is a solid, no-setup option for translating a chunk of text with some control over how it reads in the target language - genuinely more useful than a bare word-for-word translator when tone matters (a marketing blurb, a character's dialogue, a formal notice). It's not a specialized translation model, though - under the hood it's a general-purpose LLM being prompted to translate, which means quality tracks whatever model you point model_name at, and idiom-heavy or highly technical text can still trip it up the way any LLM translation can.

    How to install it

    Search comfyui_LLM_party in ComfyUI Manager and install, then restart. Manual route:

    cd ComfyUI/custom_nodes
    git clone https://github.com/heshengtao/comfyui_LLM_party.git
    

    Run pip install -r requirements.txt from inside the pack's folder using ComfyUI's own Python, then restart. This node just makes an LLM API call - no local model or GPU cost of its own.

    Common issues & troubleshooting

    output_str comes back empty or errors. Check credentials first - the standard failure mode across this pack's API-calling nodes: an empty or invalid api_key/base_url, or an unconfigured config.ini, fails before any translation happens.

    Tone doesn't seem to change anything noticeable. Try pushing degree to the extremes (1 versus 10) with the same tone value to actually see its effect - a middling setting on a subtle dial can be hard to distinguish from doing nothing at all in a short sample.

    Long input gets cut off or loses coherence partway through. If you're feeding genuinely long text (well beyond a paragraph or two), you're bound by whatever context window model_name supports - a smaller or cheaper model may not hold the whole passage's context as well as a larger one. Try a stronger model, or split the text into logical sections and translate each separately, if you're seeing quality drop off partway through a long passage.

    Category大模型派对(llm_party)/迷你派对(mini-party)

    Inputs (8)

    NameTypeDefaultDescription
    input_strSTRING
    target_languageSTRINGEnglish
    toneSTRING正式
    degreeINT5
    model_nameSTRINGgpt-4o-mini
    base_urloptSTRING
    api_keyoptSTRING
    is_enableoptBOOLEANtrue

    Outputs (1)

    NameTypeDescription
    output_strSTRING