图片翻译参数构建器
Stop hand-writing the JSON the translate node needs
- params_json
Every pack has its glue, and this is the glue. ImageTranslateParamsBuilder exists for one reason: the ImageTranslateAPI node needs its batch request as a JSON string with an exact shape, and nobody wants to type that by hand - or, worse, debug a malformed string at 1am. Give this node up to three image URLs with their language settings, and it hands you back a ready-to-go params_json.
Mechanically it's as simple as a node gets: it collects your up to three (url, sourceLanguage, targetLanguage) triples, skips the ones with no URL, and serializes them into the API's expected format:
{"params": [{"url": "https://example.com/1.jpg", "sourceLanguage": "zh", "targetLanguage": "en"}]}
What comes out of the single params_json output wires straight into ImageTranslateAPI.params (which is forceInput, so the two nodes snap together nicely).
Inputs you'll touch
url1- required; the only mandatory field. This node does nothing useful with an emptyurl1.source_language1-""(unspecified / auto),zh,en, ortr. Blank means "don't send it" - the API then auto-detects.target_language1-es,fr,pt,ko, oren; defaulten. This is the one you'll change most.url2/source_language2/target_language2andurl3/ ... - a second and third image, same options, all optional.
That's the whole node. Three images is the ceiling; if you need more, either chain two builders (the API accepts multiple params blocks) or feed the JSON in directly via ImageTranslateAPI.
Why you'd reach for it
Honestly, it's a nicety rather than a necessity - you could paste JSON straight into the API node. But it saves the two most common failure classes: wrong key names (the API wants camelCase sourceLanguage, not source_language) and invalid JSON from a stray quote. It also keeps the workflow self-documenting: the languages are visible dropdowns instead of buried in a blob of text.
Worth one caveat: the API's supported source languages (auto/zh/en/tr) and targets (es/fr/pt/ko/en) are hard limits of the service, not of this node - picking a combo the service doesn't support gets you an error downstream, not here.
Installing
cd ComfyUI/custom_nodes
git clone https://github.com/jinchanz/ComfyUI-ADIC
Restart ComfyUI, or find "ComfyUI-ADIC" in ComfyUI Manager. No dependencies beyond what the pack already needs (requests), no model downloads. The README's only documentation of this node is the short "参数构建器" section, but its behavior is simple enough that what you just read covers it.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| url1 | STRING | — | |
| source_language1opt | COMBO | 4 options: , zh, en, tr | |
| target_language1opt | COMBO | en | 6 options: , es, fr, pt, ko, en |
| url2opt | STRING | — | |
| source_language2opt | COMBO | 4 options: , zh, en, tr | |
| target_language2opt | COMBO | en | 6 options: , es, fr, pt, ko, en |
| url3opt | STRING | — | |
| source_language3opt | COMBO | 4 options: , zh, en, tr | |
| target_language3opt | COMBO | en | 6 options: , es, fr, pt, ko, en |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| params_json | STRING | — |