Nodes/RunNode Prompter/RunNode Translator
ComfyUI Node

RunNode Translator

A plain Chinese↔English prompt translator that auto-detects the direction

By SF-Runnode·Created 8 months ago·Updated 4 months ago· 0
RunNode Translator
    • translation
    promptprompt
    advanced_optionsauto
    seed100
    apiBaseUrl
    apiKey
    model

    The simplest node in the RunNode Prompter pack, and unapologetically so. It's a translator: paste in Chinese, get English out - or the other way around - and it figures out which direction to go by itself. If your text contains CJK characters it translates to English; if it doesn't, it translates to Chinese. There's no image input, no video, no model dropdown, no gimmick. It's the tool you drop in when you're mid-workflow and realize the prompt you're about to feed a model is in the wrong language.

    It works exactly the way you'd guess a ComfyUI LLM node works these days. Clean the control characters out of the input, detect the translation direction, split anything longer than 400 characters into sentence-chunks so each request stays small, and send each chunk to an OpenAI-compatible chat endpoint with a system prompt that tells the model to be a professional translation assistant - keep the meaning, keep it natural, return only the translation. The chunks come back and get re-joined into one string. advanced_options overrides the auto-detection when it gets it wrong: force_english or force_chinese.

    Inputs are the short version of the pack's standard set:

    • prompt - required, the text to translate.
    • advanced_options - auto, force_english, or force_chinese.
    • apiBaseUrl, apiKey, model - the endpoint, credential, and model. seed exists on the node but is never used; ignore it.

    The translation output is a plain STRING, so it feeds any text input - a CLIP Text Encode, a display node, or another text-transforming node in your chain.

    The "built for a Chinese-speaking user" tell is everywhere in the source: the system prompts and error strings are in Chinese (a missing key returns 错误:请提供API密钥), and the sample config points at an internal endpoint (llm-oneapi.bytebroad.com) that only means something inside the org that made this. So the practical setup: supply your own apiBaseUrl and apiKey, or set the COMFYUI_RN_API_KEY / COMFYUI_RN_BASE_URL environment variables, and ignore the defaults. If you leave everything blank the code falls back to OpenAI's own endpoint with gpt-4o-mini and no key, which is how you end up with a confusing auth error.

    Install is the pack's standard: ComfyUI Manager → search "RunNode Prompter", or

    cd ComfyUI/custom_nodes
    git clone https://github.com/SF-Runnode/ComfyUI_rn_prompter
    

    then restart. No model files, no heavy dependencies - just the openai Python SDK, which the pack never declares in a requirements.txt. If ComfyUI fails to load it, pip install openai in your venv fixes it. Two small quirks to expect: the node re-runs on every queue (its IS_CHANGED returns the current time), so each run costs an API call, and the pack has essentially zero community footprint - no comfy.icu impressions, no Reddit threads - so this is a small, probably-internal tool rather than a maintained public project. It does one job and does it fine; just point it at your own endpoint before you trust it.

    CategoryRunNode/rn_prompter

    Inputs (6)

    NameTypeDefaultDescription
    promptSTRINGprompt
    advanced_optionsCOMBOauto3 options: auto, force_english, force_chinese
    seedoptINT1000–18446744073709550000
    apiBaseUrloptSTRING
    apiKeyoptSTRING
    modeloptSTRING

    Outputs (1)

    NameTypeDescription
    translationSTRING