ComfyUI-HY-MT Introduction
ComfyUI-HY-MT adds translation nodes to ComfyUI for Hy-MT2 and Hunyuan Translation 1.5 (HY-MT1.5) models. It lets you translate text inside a ComfyUI workflow, which can be useful when preparing prompts, captions, or other text for creative work in another language. The extension is forked and adapted from the author’s upstream HY-MT project.
The extension provides two nodes: a loader for choosing a local model and a translator for producing translated text. You can choose a model explicitly or let the translator use the first available model.
Example of ComfyUI-HY-MT in ComfyUI
How ComfyUI-HY-MT Works
Think of the extension as a translation step in your workflow:
- Find a model. The extension looks for the local
Hy-MT2-1.8Bmodel first, then checks for older HY-MT1.5 models. - Prepare the request. It formats your text using the model’s translation prompt templates. It uses a Chinese-language template when the input or target involves Chinese or Cantonese; otherwise, it uses an English-language template.
- Generate the translation. The model creates translated text, and the node returns only the newly generated response, without repeating the prompt used to request it.
Models are loaded when needed and cached by their folder path. That means the extension does not need to load every available model at the start of a session.
ComfyUI-HY-MT Features
HY-MT Loader
The HY-MT Loader node, found in the HY-MT category, lets you select a local model from a dropdown. Choose this node when you want control over which available model your workflow uses. Its model output can be passed to the translator.
HY-MT Translator
The HY-MT Translator node, also in the HY-MT category, translates text using the model you provide from the loader. The model connection is optional: without it, the translator automatically loads the first available model. Because the extension searches for Hy-MT2 first, that model takes priority when it is available.
Translation length
The max_new_tokens setting limits how much new text the model can generate. Its default is 512, and its hard cap is 4096. If a translation ends too early, try increasing it. Higher values can take longer and use more memory, so increase the limit gradually if you are working with limited GPU or CPU resources.
ComfyUI-HY-MT Models
| Model | How the extension finds it | When to consider it |
|---|---|---|
| Hy-MT2-1.8B | Looks in models/Hy-MT2-1.8B/ first. | Use it when you have this model available and want the extension’s first-priority option. |
| HY-MT1.5 models | Looks for model subfolders under models/HY-MT1.5/. | Use an available legacy model when you need it for an existing workflow or want to select it explicitly. |
The provided documentation does not identify individual HY-MT1.5 variants or compare the models’ translation quality and speed. For model-specific details, consult the upstream HY-MT project.
Troubleshooting ComfyUI-HY-MT
The model I expect is not in the loader dropdown. What should I check?
- Check that a Hy-MT2 model is in
models/Hy-MT2-1.8B/, or that a HY-MT1.5 model is in its own subfolder undermodels/HY-MT1.5/. - Restart ComfyUI so the extension can scan the available model folders again.
- Open
HY-MT Loaderand check the dropdown.
The translator uses a different model than I expected. Why?
Without a connected loader, the translator uses the first available model. The extension checks for Hy-MT2-1.8B before HY-MT1.5 models. Connect HY-MT Loader to the translator and select a model explicitly when the choice matters to your workflow.
My translation stops before the text is complete. What can I do?
Increase max_new_tokens above its default of 512 and run the translation again. The maximum is 4096. Longer outputs may need more time and memory.
Why might a Hy-MT2 model fail to load?
The original documentation notes that Hy-MT2’s official model card recommends transformers>=5.6.0; an older version may lack APIs the model needs. Check your ComfyUI environment’s transformers version if you encounter a model-loading error. The extension also requires torch to be available.
Does the translator repeat my original text or its instructions in the output?
The node is designed to return only the text generated after its translation prompt, giving you a clean translation string for later workflow steps.
Learn More about ComfyUI-HY-MT
- Upstream HY-MT project: Explore the project from which this ComfyUI extension was forked and adapted.
- ComfyUI-HY-MT workflow image: View the provided visual reference for the nodes.
