Save 4 hours! We auto-setup your workflow! Free!

Drop your workflow.json — we handle every dependency, custom node, and model. Just open the link and run.

Auto-Setup Workflow Json (Free) Now!
ComfyUI > Nodes > ComfyUI-HY-MT > HY-MT Translator

ComfyUI Node: HY-MT Translator

Class Name

HY-MT Translator

Category
HY-MT
Author
starsfriday (Account age: 0days)
Extension
ComfyUI-HY-MT
Latest Updated
2026-05-25
Github Stars
0.0K

How to Install ComfyUI-HY-MT

Install this extension via the ComfyUI Manager by searching for ComfyUI-HY-MT
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-HY-MT in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

HY-MT Translator Description

Translates text into a chosen language using an HY-MT model for use in ComfyUI workflows.

HY-MT Translator:

HY-MT Translator uses a language model to translate text into a selected language. It builds a translation request from your text and language choice, generates a response, and returns the generated text for use elsewhere in your workflow. The node chooses between a Chinese-language and an English-language prompt based on the text and destination language. Generation is sampled, so running the same translation more than once can produce different wording. This can help you explore phrasing for captions or prompts, but you should review the result before using it where exact meaning matters.

HY-MT Translator Input Parameters:

text

The text you want translated. This is a required, multiline STRING field with an empty default. The source defines no minimum or maximum character count, but leaving it empty causes the node to stop with an error. You can enter a phrase or a longer passage; the amount of text you provide also affects how much the model must process.

target_language

The language you want the translation to be in. This is a required choice from the node’s LANGUAGE_OPTIONS list, with en | 英语 as the default. The node uses the code before the | separator, such as en in the default choice, when preparing its request. The supplied source does not show the full options list, so other available languages should be taken from the choices displayed in your node.

model

An optional HYMT_MODEL connection for a model supplied by the HY-MT Loader node. There is no stated default model value or numeric range. When connected, the translator expects the supplied value to contain both a tokenizer and a loaded model. When left empty, it obtains a model through its built-in model-loading path instead.

max_new_tokens

The maximum number of tokens the model may generate for the translation. This optional INT setting defaults to 512, has a minimum of 1 and a maximum of 4096, and changes in steps of 1. A token is a piece of text, not necessarily a whole word. A low limit can cut off a longer translation; a higher limit gives the model more room to finish, but permits a longer generation.

temperature

A sampling setting that affects how varied the generated wording may be. This optional FLOAT setting defaults to 0.7, ranges from 0.0 to 2.0, and changes in steps of 0.05. Lower values generally favor more predictable choices, while higher values allow more variation. The node always enables sampling; a temperature of 0.0 may be rejected by the installed generation library, so use a positive value if that happens.

top_p

A sampling setting that limits token choices according to their combined probability. This optional FLOAT setting defaults to 0.6, ranges from 0.0 to 1.0, and changes in steps of 0.01. Lower values narrow the choices available during generation; higher values allow a broader set of choices. For translations where you want less variation, you can try a lower value and compare the resulting wording.

top_k

A sampling setting that limits each generation step to a number of likely next-token choices. This optional INT setting defaults to 20, has a minimum of 1 and a maximum of 100, and changes in steps of 1. Smaller values restrict the model’s choices more strongly; larger values allow more alternatives. It works alongside temperature and top_p, so changing several at once can make it harder to tell which setting affected the result.

repetition_penalty

A setting that adjusts the model’s tendency to repeat generated text. This optional FLOAT setting defaults to 1.05, ranges from 0.5 to 2.0, and changes in steps of 0.01. Values above 1.0 discourage repetition more than the neutral value of 1.0. Raising it too far may also make natural repeated words or phrases less likely, so compare the translation with your source text after changing it.

HY-MT Translator Output Parameters:

translation

A STRING containing the text generated as the translation. The node decodes only the newly generated portion of the model’s response, removes special tokens, and trims whitespace at the beginning and end. You can pass this text to another node or use it as translated copy, but the output is model-generated rather than a verified translation. Check names, details, and intended meaning before publishing or using it as a final prompt.

HY-MT Translator Usage Tips:

  • Enter the complete text you want translated and select the destination language shown in the node. For a short caption, start with the default generation settings and review the result before adjusting them.
  • If a longer passage ends abruptly, increase max_new_tokens within its allowed range. If the source itself is very long, consider translating it in smaller, meaningful sections so you can review each result.
  • When you need more consistent wording, try lowering temperature while keeping it above 0. Change one sampling setting at a time so you can judge its effect; the node samples on every run, so identical settings do not guarantee identical text.
  • Connect a model from HY-MT Loader when you want to supply an already loaded HYMT_MODEL. Otherwise, leave model empty and let the translator use its built-in model-loading path.
  • If the result repeats words or phrases, try a modest increase to repetition_penalty from its default of 1.05, then check that necessary repetition in the original has not been lost.

HY-MT Translator Common Errors and Solutions:

Input text is empty.

  • Explanation: The node stops before translation when text is an empty string.
  • Solution: Enter text in the text field or ensure the connected text source supplies a nonempty string.

Invalid model input. Use the HY-MT Loader node or leave empty.

  • Explanation: The value connected to model could not be unpacked into the tokenizer and loaded model that this node expects.
  • Solution: Connect an HYMT_MODEL output from HY-MT Loader, or disconnect model to use the translator’s built-in model-loading path.

Model-loading error

  • Explanation: If model is left empty, the node must obtain a model through its built-in loading path. The supplied source does not show that loader’s error messages, so the exact message will depend on what failed.
  • Solution: Read the full error shown by your workflow, check that the required model is available to your installation, or try connecting a working HY-MT Loader output.

Out-of-memory error during generation

  • Explanation: Loading or running the model may exceed the memory available on the device, particularly with longer text or a high max_new_tokens limit. The exact error wording depends on the device and software environment.
  • Solution: Try a shorter passage or a lower max_new_tokens value. If you use a connected model, check that your system has enough memory to run it.

Error mentioning temperature or sampling values

  • Explanation: The node passes its sampling settings directly to the model’s generation method. Some generation-library versions may reject a value such as temperature set to 0.0 while sampling is enabled.
  • Solution: Set temperature to a positive value, such as its default of 0.7, and restore the other sampling settings to their defaults before testing again.

Chat-template or tokenizer error

  • Explanation: The node formats its request using the tokenizer’s chat template. A connected tokenizer that does not support the expected template may fail before translation begins; the exact message depends on the tokenizer.
  • Solution: Use a tokenizer and model supplied together by a compatible HY-MT Loader output, or leave model empty to use the node’s built-in loading path.

HY-MT Translator Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-HY-MT
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

HY-MT Translator