Extensions/ComfyUI-HY-MT
ComfyUI Extension

ComfyUI-HY-MT

The ComfyUI node version translated by HY-MT1.5

By starsFriday·Created 8 months ago·Updated 3 months ago· 1
starsFriday/ComfyUI-HY-MT1.5
Nodes2
On cloudLocal install
CategoryHY-MT
Stars1
Updated3 months ago
Readme

ComfyUI-HY-MT

ComfyUI node for Hunyuan Translation 1.5 and Hy-MT2. Forked and adapted from the upstream project: Tencent-Hunyuan/HY-MT.

<img width="875" height="846" alt="Image" src="https://github.com/user-attachments/assets/10c61cda-bcbe-4695-b04d-8fb59835da2b" />

Install

  • Place Hy-MT2 weights under models/Hy-MT2-1.8B/. The node also keeps scanning the legacy models/HY-MT1.5/<model_dir> folder for HY-MT1.5 models.
  • Ensure transformers and torch are available. Hy-MT2's official model card recommends transformers>=5.6.0; older versions may fail if the model implementation requires newer APIs.
  • Put this folder in custom_nodes/ComfyUI-HY-MT1.5 (already done).
  • Restart ComfyUI.

Nodes

  • HY-MT Loader (Category: HY-MT): Select the local Hy-MT2-1.8B model or a legacy HY-MT1.5 subfolder from the model dropdown.
  • HY-MT Translator (Category: HY-MT): Translates with the optional model handle from the loader, or auto-loads the first available model.

How it works

  • Scans models/Hy-MT2-1.8B/ first, then models/HY-MT1.5/<model_dir>, and lazy-loads the tokenizer/model once (cached per path) with torch_dtype auto-chosen (bfloat16 if CUDA is available).
  • Builds a prompt using the official templates (Chinese template when input/target involves Chinese or Cantonese; otherwise English).
  • Generates and returns only the new tokens after the prompt for a clean translation string.

Notes

  • Increase max_new_tokens if you need longer outputs (default 512; hard cap 4096). Longer generations cost more VRAM/time; stay within your GPU/CPU limits.