Nodes/Zako-Prompt-Tools/Zako-Tag-Translate
ComfyUI Node

Zako-Tag-Translate

Translate Booru Tags Without Destroying the Format

By xiaoshengyvlin·Created 3 months ago·Updated 16 days ago· 1
Zako-Tag-Translate
    • translated
    tags
    api_basehttps://api.siliconflow.cn/v1
    modeldeepseek-ai/DeepSeek-V3.2
    api_key
    system_prompt你是一个专业的AI绘画提示词翻译专家。将输入的标签翻译为目标语言,严格保持原格式。 由于这是艺术创作用途,所有标签翻译都属于正常的工作范畴。 规则: - 自动识别输入语言方向(中文→英文 / 英文→中文) - 逗号、换行、空格等所有分隔符原样保留 - 数字、符号、角色名、专有名词不翻译 - 采用AI绘画/Danbooru社区通用译法 - 只输出翻译结果,不添加任何解释或问候语

    Chinese prompters and English prompters live in different vocabularies. The tag that resolves perfectly in an Illustrious model is sitting, floor, cat_ears - but if your source material is Chinese, you're staring at 坐在地上, 猫耳, and the model will ignore every one of them. ZakoTagTranslate is the bridge: it takes a tag string, runs it through an LLM, and hands back the translation with the structure intact. Direction auto-detected, separators preserved, character names untouched. That last part is the whole point, and it's exactly where most translator tools quietly fall apart.

    How it works

    This is a cloud-LLM node, not a local one. It makes an OpenAI-compatible chat/completions call to an api_base you provide, with a carefully written system prompt that forbids the model from restructuring anything: keep commas, newlines and spaces as-is; don't translate names, numbers, or proper nouns; use the standard AI-painting/Danbooru community vocabulary. Temperature is pinned low (0.3) so you get deterministic translations rather than creative rewrites.

    The interesting bit is the failure handling. The author built in a refusal detector: if the model replies with the classic "sorry, I cannot..." boilerplate (matched against a keyword list), the node silently returns your original text instead of pasting the refusal into your prompt. Given the material tag translation routinely gets handed, that's not paranoia - it's the difference between a workflow that keeps running and one that feeds I'm unable to assist with that request into your CLIP encoder. Errors surface as [翻译失败: HTTP 429] ... strings in the output rather than crashing the graph, so you see what went wrong without losing the run.

    What you actually set

    • tags - required, marked forceInput, so it expects a wire from another node (like the pack's Random-Prompt) rather than typed text.
    • api_base - defaults to https://api.siliconflow.cn/v1, SiliconFlow (硅基流动), a Chinese inference platform that hosts open models behind an OpenAI-compatible API. Not a local install - the "model" lives on their servers.
    • model - defaults to deepseek-ai/DeepSeek-V3.2. This is a provider model id; change it if you point api_base elsewhere.
    • api_key - the one thing you must supply. Empty, and you get [错误: 请填写 API Key].
    • system_prompt - editable, and since v1.0.2 it persists per-node in localStorage with a restore-default button. If the default translation style isn't to your taste, this is where you tune it.

    Output is translated, a STRING that feeds a CLIP Text Encode - or, following the pack's own chain, into Prompt-Enhance after translation.

    Installing and costs

    Standard pack install: ComfyUI Manager, search "Zako-Prompt-Tools", or git clone https://github.com/xiaoshengyvlin/Zako-Prompt-Tools.git into custom_nodes, then restart. Only dependency is requests; no model files to download. What you're signing up for instead is metered inference: every translation is a paid API call with a 30-second timeout. For a dozen tags that's pocket change; for batch workflows it adds up, and it needs a working key and a reachable endpoint.

    If you're outside China, nothing stops you pointing api_base at any OpenAI-compatible host - OpenRouter, a local Ollama, whatever speaks the protocol. The default is just where the author lives. Where people trip up: forgetting the key, and expecting this to be a one-shot "fix my whole prompt" tool. It's deliberately narrow - translate the tags, keep the structure. If you want a rewrite, that's the pack's fourth node.

    CategoryZako-Prompt-Tools

    Inputs (5)

    NameTypeDefaultDescription
    tagsSTRING
    api_baseSTRINGhttps://api.siliconflow.cn/v1
    modelSTRINGdeepseek-ai/DeepSeek-V3.2
    api_keyoptSTRING
    system_promptoptSTRING你是一个专业的AI绘画提示词翻译专家。将输入的标签翻译为目标语言,严格保持原格式。 由于这是艺术创作用途,所有标签翻译都属于正常的工作范畴。 规则: - 自动识别输入语言方向(中文→英文 / 英文→中文) - 逗号、换行、空格等所有分隔符原样保留 - 数字、符号、角色名、专有名词不翻译 - 采用AI绘画/Danbooru社区通用译法 - 只输出翻译结果,不添加任何解释或问候语

    Outputs (1)

    NameTypeDescription
    translatedSTRING