Nodes/comfyui-hymt2/Hy-MT2 Loader
ComfyUI Node

Hy-MT2 Loader

The half of Hy-MT2 that eats your VRAM — and why that's the point

By aadebuger·Created 3 months ago·Updated 3 months ago· 0
Hy-MT2 Loader
    • model
    model_pathtencent/Hy-MT2-1.8B
    devicecuda:0
    dtypebf16
    force_reloadfalse
    evict_otherstrue

    ComfyUI loads a lot of strange things into a graph, but a translation model probably wasn't on your bingo card. That's exactly what Hy-MT2 Loader is: the first half of the aadebuger/ComfyUI-HyMT2 pack, wrapping Tencent's Hy-MT2 model family - small "fast-thinking" translation models (1.8B, 7B, and a 30B-A3B MoE) that run locally and cover 38 languages.

    Here's why you'd reach for it. LLM-as-a-node is mainstream in ComfyUI now, but almost every local LLM node you'll find is a prompt enhancer or a captioner. Translation is the underrated sibling - translate a prompt into the language your checkpoint's training data likes best, localize captions, or pipe subtitles through a workflow. Because it's local, there's no API key, no per-character pricing, and nothing leaves your machine. That last part matters more than people admit: the pack sits in the same LLM-node category that gave the community its worst security scare (the ComfyUI_LLMVISION malware), and this repo is brand new - one initial commit, zero install history. It's open Apache-2.0 code, so glance at what you're running before the first prompt. Same advice as always, just louder here.

    How it works

    HyMT2Loader does one job: load the model and tokenizer through transformers - from a HuggingFace repo id like tencent/Hy-MT2-1.8B, or from an absolute local path if you want it offline - and hand it to the translate node over a HYMT2_MODEL socket. The mechanism that actually matters is the process-global cache, keyed on (model_path, dtype, device). First load downloads weights into HF_HOME (set export HF_HOME=/path/to/cache if you don't want them in the default spot) and takes a while; every warm load after that is roughly three seconds. The evict_others option (on by default) drops any other cached model before loading - the author's reasoning is honest: a 24 GB card holds one of these, so don't pretend otherwise.

    The inputs that matter

    • model_path - default tencent/Hy-MT2-1.8B (~3.6 GB in bf16). Swap to tencent/Hy-MT2-7B (~14 GB) or tencent/Hy-MT2-30B-A3B (~60 GB bf16) or a local directory.
    • device - cuda:0, cuda:1, or cpu. Unless you're desperate, leave it on CUDA; CPU inference on a translation model is a waiting room.
    • dtype - bf16 is the default and it's the right one. fp16 and fp32 exist if you have a reason.

    force_reload bypasses the cache when you've changed something underneath it. You'll rarely touch it.

    Installing it

    From ComfyUI Manager, search "Hy-MT2" - it's a fresh pack, so if it isn't listed yet, the manual route always works:

    cd ComfyUI/custom_nodes
    git clone https://github.com/aadebuger/ComfyUI-HyMT2.git
    cd ComfyUI-HyMT2
    ./scripts/install_deps.sh
    

    Then restart ComfyUI. The install script installs transformers>=5.6.0, accelerate>=0.30, and tokenizers, then runs a smoke test that fails loudly if anything's missing. It deliberately doesn't pin torch - ComfyUI's venv already ships the right build.

    Where people get burned

    The one real blocker is that transformers>=5.6.0 requirement. It conflicts with nodes that pin transformers==4.57.3 - Qwen3TTS, Sonic, and some VibeVoice forks. If you run any of those in the same instance, the README's recommendation is the sensible one: run Hy-MT2 in a second ComfyUI instance on a different port. Two other failure modes are milder: a "Requires accelerate" error means you skipped the install script, and the 30B-A3B variant simply doesn't fit a 24 GB card in bf16 - the README points you at the FP8 checkpoint or a GGUF build instead. The output socket (model, type HYMT2_MODEL) has exactly one job: into HyMT2Translate, which is the node that actually makes this worth installing.

    CategoryHyMT2

    Inputs (5)

    NameTypeDefaultDescription
    model_pathSTRINGtencent/Hy-MT2-1.8BHF repo id (e.g. tencent/Hy-MT2-1.8B, tencent/Hy-MT2-7B, tencent/Hy-MT2-30B-A3B) or an absolute local path.
    deviceCOMBOcuda:03 options: cuda:0, cuda:1, cpu
    dtypeCOMBObf163 options: bf16, fp16, fp32
    force_reloadoptBOOLEANfalse
    evict_othersoptBOOLEANtrue

    Outputs (1)

    NameTypeDescription
    modelHYMT2_MODEL