🐵 GF JsonTranslate
Batch-translate a JSON file's title fields — with a catch
- translated_json_path
🐵 GF JsonTranslate is the batch sibling of GF Deep Translate in the same pack. Where that node translates whatever text you hand it, this one points at a JSON file on disk, translates the string values it cares about, and writes a translated copy next to the original under {filename}-{target_lang}.json.
The catch first, because it decides whether this node is for you
This node does not translate every string in your JSON. It recursively walks the whole structure - nested dicts, lists, objects inside objects - and translates only the values that live under a key literally named "title". Everything else sails through untouched. If your interesting text sits in description, caption, or any other key, this node will not touch it. That's the single most common reason someone runs it and wonders why nothing changed.
Where it does shine: captioning and dataset tools that export JSON where each entry's human-readable text lives in a title field. Point it at that file, pick auto source and your target language, and walk away.
How it works
It reads the file as UTF-8 JSON, recursively collects every title string, then translates them in parallel - 25 worker threads hammering deep-translator's Google endpoint. Failures fail open: if one translation throws, the original text is kept instead of the node crashing. When it finishes, it writes the new file to the same folder as the input.
The inputs that matter:
input_path- absolute path to your JSON file.source_lang- defaults toauto(Google detects it).target_lang- defaults toen; there's also anoneoption that leaves text untouched, handy if you're toggling the node on and off in a workflow.fancy_mode- defaults to true, pretty-printing the output with 4-space indents. Flip it off for a compact, single-line JSON.
Output: translated_json_path, a STRING with the path to the new file. Wire it into a show-text node to see where it landed.
Installing it
Same pack as GF Deep Translate - ComfyUI Manager, search "GF_translate". Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/gorillaframeai/GF_translate
restart ComfyUI, and let it install the single pip dependency, deep-translator. No models, no GPU, no API key - just network access to Google Translate.
Gotchas
If the input file doesn't exist, or won't decode as UTF-8, the node silently returns None - no error, no file, just nothing. And because everything goes through that same free Google endpoint, a batch job with lots of title fields can hit rate limits. The fail-open behavior means you might end up with a file where some strings are still in the original language and no warning anywhere. Spot-check the output before you trust it in a dataset.
Small pack, one-file MIT codebase, no registry reputation to speak of - perfectly fine for what it does, just don't assume it does more than "title fields get translated."
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| input_path | STRING | — | |
| source_lang | COMBO | auto | 135 options: auto, afrikaans, albanian, amharic, arabic, armenian, +129 |
| target_lang | COMBO | en | 135 options: afrikaans, albanian, amharic, arabic, armenian, assamese, +129 |
| fancy_mode | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| translated_json_path | STRING | — |