Nodes/ComfyUI-ADIC/图片翻译 API
ComfyUI Node

图片翻译 API

Batch image translation

By jinchanz·Created about a year ago·Updated a day ago· 5
图片翻译 API
    • response
    params
    app_nameNHCI
    api_key
    api_endpoint/open/api/v1/ai/imageTranslate

    This is the flagship of the pack - the README is basically its user manual. ImageTranslateAPI sends a batch of image URLs to an OCR-and-retranslate service that reads the text in each image and returns a new image with the text swapped into your target language. Think: a product screenshot in Chinese, translated to English or Spanish, in one POST. The whole point of ComfyUI-ADIC is to put that service inside a ComfyUI workflow.

    The mechanism is uncomplicated. You hand it a params JSON string shaped like {"params": [{"url": "...", "sourceLanguage": "zh", "targetLanguage": "en"}, ...]}, plus an API key. It POSTs that to the endpoint with Authorization: Bearer <api_key> and an X-App-Name header, waits (timeout is a generous 600s - translation can take a while for big batches), and expects a {success: true, data: [...]} envelope back. Each item in data carries the original URL, the languages, and a resultUrl pointing at the translated image. The node pretty-prints the whole response as the response output string.

    The inputs that matter

    • params - the JSON body. It's forceInput, so build it with the pack's ImageTranslateParamsBuilder rather than hand-typing.
    • api_key - required for Bearer auth; empty and the node refuses to run.
    • api_endpoint - the URL. Default is /open/api/v1/ai/imageTranslate, a relative path, so you must supply the full https://host/... URL or the first run fails with a connection error. The README's Swagger blurb describes it as a POST, application/json, Bearer auth.
    • app_name - sent as X-App-Name, default NHCI; usually left alone.

    Output is a single response STRING - the full API result as indented JSON. Since it's an output node, you can read it right in the UI, or pipe it into ImageTranslateResultExtractor to pull the translated URLs back out programmatically.

    Languages you can actually use

    The README is explicit, and it's more limited than you'd hope: source languages are auto, zh, en, tr (Turkish); targets are es, fr, pt, ko, en. If your language pair isn't in that list, the API will tell you. Translation quality depends on the source image's text legibility - blurry or tiny text comes back garbled, no way around it.

    The traps

    Beyond the relative-path endpoint, the source uses verify=False, so SSL verification is off - fine for an internal service, worth knowing if you're proxying through something untrusted. And the images must be publicly reachable URLs (the README calls this out); the service fetches them server-side, so a localhost image or a signed URL that expires mid-job will fail.

    Installing

    cd ComfyUI/custom_nodes
    git clone https://github.com/jinchanz/ComfyUI-ADIC
    

    Restart ComfyUI, or install via ComfyUI Manager under "ComfyUI-ADIC". The README asks for pip install requests; ComfyUI already has it. No models, no other downloads - you just need a valid API key for the translate service.

    CategoryMalette

    Inputs (4)

    NameTypeDefaultDescription
    paramsSTRING
    app_nameSTRINGNHCI
    api_keySTRING
    api_endpointSTRING/open/api/v1/ai/imageTranslate

    Outputs (1)

    NameTypeDescription
    responseSTRING