Nodes/Prompt Palette-F/Prompt Tabs + Translate
ComfyUI Node

Prompt Tabs + Translate

Prompt tabs that translate themselves — English prompt, Japanese tab, no API key

By id-fa·Created about a year ago·Updated 9 days ago· 2
Prompt Tabs + Translate
    • source
    • translated
    • label
    text
    translated
    tabs_data

    Prompt Tabs + Translate is the translation-enabled sibling of PromptTabs, and it solves a very real workflow problem if you work with prompts in more than one language: keeping the English original and the translated version in sync. Each tab holds two independent fields - a source and a translation - both freely editable, and three buttons translate the source into the language you want on the spot. The name is a slight lie in the best way: it doesn't call any paid API and needs no key.

    How it works

    Each tab is a two-pane text area. The buttons are labeled with flags: 🇯🇵 日本語に翻訳, 🇬🇧 英語に翻訳, 🇨🇳 中国語に翻訳. Click one and the source text is translated into that language and dropped into the translated field, which you can then edit by hand - so you get a machine-translation starting point you're free to correct into something a diffusion model will actually follow.

    The important timing detail: translation runs immediately on button click. You don't queue the workflow, you don't wait for execution. This is a frontend/browser-side call - it uses the googletrans library, a thin wrapper around Google Translate's free endpoint. That's the entire Python dependency of the pack, and it's the reason this node exists separately from the pack's local GemmaTranslate node.

    Tab management is identical to the plain PromptTabs: click to switch, + to add, double-click to rename, × to delete (with confirmation; at least one tab remains). A tabs_data widget holds the internal state and is managed by the UI - leave it alone.

    Inputs and outputs

    • text - the active tab's source text (tooltip: "Source text of the currently selected tab.").
    • translated - the active tab's translated text, freely editable.
    • tabs_data - internal storage.

    Outputs: source, translated, and label (the active tab's name). That label output is the same quiet gem as in PromptTabs - wire it into a Save Image prefix and each language's outputs file themselves apart. Wire translated into your CLIP Text Encode and you're generating from the localized prompt while the English original sits safe in the other field.

    Installing it

    Same pack, same dance:

    cd ComfyUI/custom_nodes
    git clone https://github.com/id-fa/ComfyUI-PromptPalette-F prompt-palette-f
    cd prompt-palette-f
    pip install -r requirements.txt
    

    Restart, find it under Prompt Palette-F. Or via ComfyUI Manager, search "Prompt Palette-F." This is the one node in the pack that actually needs its pip dependency - if googletrans didn't install, you'll see a clear "googletrans is not installed…" message in the node instead of a translation.

    Where people get burned

    Two things. First, "free endpoint" means exactly that: no key, but also no SLA. Google Translate's unofficial endpoint occasionally rate-limits or hiccups, and since this is a browser-side call, a flaky network shows up as a failed translation. It's fine for interactive use; don't build a 10,000-prompt batch pipeline on it. Second, remember it translates the source field into the translated field - there's no reverse button, so if you want English→Japanese→back, type it into source and hit the English button. The pack's experimental GemmaTranslate node exists precisely for people who want this same idea running fully locally, no network at all.

    CategoryPrompt Palette-F

    Inputs (3)

    NameTypeDefaultDescription
    textSTRINGSource text of the currently selected tab.
    translatedSTRINGTranslated text of the currently selected tab (freely editable).
    tabs_dataSTRINGInternal tab storage (managed by the UI).

    Outputs (3)

    NameTypeDescription
    sourceSTRING
    translatedSTRING
    labelSTRING