Extensions/PLaMo Translate
ComfyUI Extension

PLaMo Translate

Local PLaMo 3 Translate GGUF translation with CPU/CUDA modes and bounded GPU model reuse.

By sugarkwork·Created about 15 hours ago·Updated about 13 hours ago· 0
sugarkwork/comfyui-plamo-translate
Nodes—
On cloudLocal install
Stars0
Updatedabout 13 hours ago
Readme

ComfyUI PLaMo Translate

Tests

A small local translation node for PLaMo 3 Translate GGUF models. Uses the official PFML3 translation format: input language is detected by PLaMo and the selected target language is explicit. This is translation, not prompt expansion.

  • Default: PLaMo 3 Translate 0.8B Q4_K_M, approximately 573 MB of weights.
  • Model dropdown: local PLaMo 3 Translate GGUF files, including other sizes and quantizations. Only 0.8B Q4_K_M has been validated here.
  • 53 output languages, including Japanese, English and both Chinese scripts.
  • CPU mode releases the model after each translation; GPU mode can keep it warm for a bounded idle period. Existing workflows default to CPU.
  • No PyTorch changes. Persistent GPU mode uses pywin32 for Windows process ownership. No downloads during import/model-list refresh. On execution, missing default weights download once; translation itself runs with the native runtime's --offline flag.
  • ComfyUI caches unchanged node inputs. Different text can reuse a warm GPU model without relying on ComfyUI's result cache.

Installation

Requires Python 3.11+, ComfyUI 0.45.0+, and Windows x64 for the supplied runtime. Use the Python environment that runs ComfyUI for all commands below.

Registry package: PLaMo Translate (plamo-translate).

For a direct GitHub installation, clone the repository into ComfyUI/custom_nodes/:

git clone https://github.com/sugarkwork/comfyui-plamo-translate.git
cd comfyui-plamo-translate
python -m pip install -r requirements.txt
python install.py

Manager runs install.py automatically. On Windows x64 it installs only the CPU runtime if missing, without downloading weights or the optional CUDA build. Imports never run installation. For explicit runtime repair/reinstallation:

python install_runtime.py

It downloads the official llama.cpp Windows x64 CPU archive pinned to b12110, verifies its SHA256, and installs only the completion executable and its runtime libraries. Linux/macOS users must supply their own bin/llama-completion; those platforms are not validated by this installer.

For NVIDIA GPU mode on Windows, install the separate CUDA runtime:

python -m pip install -r requirements.txt
python install_runtime.py --cuda

The CUDA 13.4 build and CUDA DLL archives are both pinned to verified SHA256s. They install in bin/cuda/, separate from the CPU runtime and ComfyUI's PyTorch DLLs. The two archives total approximately 593 MB. An appropriate NVIDIA driver is required. To reuse already downloaded official archives, add --archive-dir PATH; verification is still mandatory. GPU mode is tested here on Windows with RTX 5060 Ti and driver 621.01, not on Linux/macOS/AMD.

The default plamo/plamo-3-translate-0.8b-Q4_K_M.gguf option is listed even before download. Executing the node with this option downloads the official 573 MB model if missing. Its revision, byte count and SHA256 are pinned; a temporary file becomes the final model only after verification. Failed or cancelled downloads remove the partial file. The ComfyUI progress bar reports download progress; a blocked network read may take up to 30 seconds to time out.

The destination is plamo/ under the first configured directory named text_encoders (or the first configured encoder root for custom directory names). For example, a D:\models\text_encoders root saves into its plamo subfolder. Existing files are reused without network access. Automatic downloads are limited to this default preset; other local PLaMo GGUF files remain selectable but must be installed manually. Arbitrary model names or URLs cannot trigger a download.

For a manual download instead:

hf download pfnet/plamo-3-translate-0.8b-GGUF plamo-3-translate-0.8b-Q4_K_M.gguf --revision 1cf96ae02133958a20074bfdfab76517bb737d00 --local-dir D:\models\text_encoders\plamo

Restart ComfyUI after installing the node. Add PLaMo Translate (GGUF) from text/translation, choose the model and target language, and connect translated to the receiving prompt/STRING input. Use Preview Any to display the translation without generating an image. Load one of the supplied workflows:

Additional official PLaMo 3 Translate GGUF files can be placed in the same configured text_encoders directories; refresh the model list afterward. They must keep a plamo-3-translate-*.gguf filename. A model outside these registered directories cannot be loaded through the node. Larger models will use more RAM and run slower on CPU; they do not download automatically.

Controls

max_tokens limits output length, not input characters. Increase it for long translations. threads defaults to 4; increasing it is not always faster. context_length covers input and output tokens together and defaults to 4096. Model file size is not total runtime memory. Cancelling ComfyUI terminates only the translation process owned by that execution.

device selects CPU or the NVIDIA GPU assigned to ComfyUI. Physical selection uses its UUID, not an assumed CUDA index. Flash Attention is enabled in CUDA mode. ComfyUI's memory helper is asked to free headroom before loading the model. The external runtime's allocation is not a PyTorch tensor/cache.

keep_alive defaults to 60 seconds and applies only to GPU mode. The timer starts after a real translation and resets on the next real translation. At idle expiry, CPU selection, cancellation/error, model/config change, or ComfyUI exit, the owned runtime stops and releases its VRAM. Set keep_alive=0 to release it after every call, at the cost of loading it again next time. A Windows Job Object also terminates the warm GPU child if ComfyUI is forcibly killed. ComfyUI's cached outputs do not refresh the idle timer. Its general unload-models button does not explicitly stop this external runtime; use CPU mode or wait for its bounded idle timeout.

CPU/per-call text uses a temporary UTF-8 file, not command-line arguments. Warm GPU text uses an authenticated loopback-only native endpoint, with proxies disabled; neither the text nor its ephemeral key is written to disk or exposed on LAN/Tailscale. No persistent prompt cache files are written. Temporary logs are closed on shutdown. Native completion's terminal [end of text] marker is removed from returned strings. Model output is not otherwise rewritten; exact preservation of names, tags, punctuation or prompt syntax is not guaranteed.

Local Measurements

On this PC (2026-11-13), 0.8B Q4_K_M with 4 CPU threads and a 4096-token context translated short prompts in approximately 2.9-3.1 seconds, including process startup and model loading. Japanese/English in both directions, Chinese to English and Japanese to French were checked. The translation process's working set peaked at approximately 840 MiB (sampled every 20 ms); this does not include ComfyUI's own memory. No model process remained afterward. These are short-text measurements, not guarantees for longer inputs or all 53 languages. Other PLaMo sizes/quantizations have not been tested here. The first download is additional time. After a missing model is downloaded, the next execution refreshes its file fingerprint; subsequent unchanged inputs use the normal execution cache.

On 2026-11-14, short changed-text GPU translations measured approximately 0.07 seconds with a warm model, compared with approximately 3 seconds on CPU. New GPU process startup plus translation took approximately 2-4 seconds. Keeping the runtime warm is the speed improvement: per-call GPU loading alone was not faster than CPU (GPU median 3.42 seconds vs CPU median 3.06 seconds). The warm runtime used approximately 0.7-0.9 GB additional VRAM in these tests; whole-device NVML measurements can include activity from other applications. Both idle expiry and forced-parent-exit cleanup were tested. Longer text, larger contexts/models, VRAM contention and cold startup have different costs.

Tests

Run from this repository with ComfyUI on PYTHONPATH:

python -m pytest tests -q --import-mode=importlib --rootdir=..

GitHub Actions checks Python 3.11/3.12 against the real ComfyUI 0.45.0 API using CPU-only PyTorch. Unit tests mock inference/downloads; local CUDA benchmarks are not GPU CI tests.

Licenses And Sources

Original node code: MIT. llama.cpp: MIT; see bin/LICENSE-llama.cpp and the included LLVM OpenMP notice. PLaMo weights are not MIT; they use the PLaMo Community License, including its separate commercial-use conditions. This package does not redistribute model weights. CUDA libraries have NVIDIA's separate terms; runtime binaries are not committed.

  • https://huggingface.co/pfnet/plamo-3-translate-0.8b-GGUF
  • https://github.com/ggml-org/llama.cpp/releases/tag/b12110
  • https://plamo.preferredai.jp/info/plamo-community-license-en