Files

3.8 KiB
Raw Permalink Blame History

INSTALL_NOTES — ComfyUI-HyMT2

Field-log entries from installing on a dual-RTX-3090 / Py 3.13 / torch 2.11 host.

1. transformers version pin (⚠️ likely blocker)

The Hy-MT2 model card says transformers >= 5.6.0. This is the deal-breaker for many existing custom_nodes, including but not limited to:

  • Qwen3TTS (locks transformers==4.57.3)
  • Sonic / certain VibeVoice forks
  • A few older Llava-style multimodal packs

Before upgrading, freeze your current state:

. /mnt/modelall/ComfyUI/.venv/bin/activate
uv pip freeze | grep -E "transformers|tokenizers|huggingface_hub" \
  > /mnt/modelall/tmp/tf_before_hymt2.txt

Then either:

Option A — upgrade and accept the casualties

./scripts/install_deps.sh
# restart ComfyUI
# test HyMT2 — confirm working
# test other packs you care about

Option B — isolate Hy-MT2 in its own ComfyUI install

If you can't afford to break the Qwen3TTS / VibeVoice packs in the main install, the cleanest path is a second ComfyUI checkout with its own venv and only this pack inside. Hy-MT2 1.8B is ~3.6 GB in bf16 so it shares a GPU comfortably with another ComfyUI process.

Rollback

. /mnt/modelall/ComfyUI/.venv/bin/activate
uv pip install transformers==4.57.3 --force-reinstall
# inspect frozen file to restore any other affected packages

2. Python 3.13 wheel overrides

./scripts/install_deps.sh already passes a --override for the wheels that don't build on Py 3.13 with old version pins:

sentencepiece>=0.2.0
pyyaml>=6.0.2
huggingface_hub>=0.26

Mirrors v2.0 §2.3 / §3 mode D.

3. HF cache + tmp paths

Set these before launching ComfyUI:

export HF_HOME=/mnt/modelall/hf_cache
export TMPDIR=/mnt/modelall/tmp

The 1.8B safetensors snapshot is ~3.6 GB and the tokenizer/config are small — the main / partition will not fill up unless you also forget to move HF_HOME away from its default ~/.cache.

4. trust_remote_code

The Hy-MT2 architecture is hunyuan_v1_dense, which is registered through the model repo's own python files. Both AutoTokenizer.from_pretrained and AutoModelForCausalLM.from_pretrained are called with trust_remote_code=True in nodes/runtime.py. You will see the prompt:

A new version of the following files was downloaded ...

once per snapshot revision. This is expected.

5. VRAM (1.8B specifically)

In bf16 the model is ~3.6 GB. The model + KV cache + a 4 K-token context fit into roughly 6–8 GB on a 24 GB card, so we do not need the v2.0 §8.2 "CPU-context construction" trick. The runtime still prints cuda_alloc and free after load — keep an eye on the log if you load alongside other heavy nodes.

6. Empty NODE_CLASS_MAPPINGS check

After install, confirm the nodes registered:

curl -s http://10.8.0.12:8188/object_info | python3 -c "
import json, sys
d = json.load(sys.stdin)
for n in ['HyMT2Loader', 'HyMT2Translate']:
    print(f'  {n}: {\"✓\" if n in d else \"✗\"}')"

If both show ✗ but ComfyUI startup log shows the banner, you probably have a stale .bak directory under custom_nodes/ shadowing this pack (v2.0 §4). Move any *.bak* directories out of custom_nodes/:

mkdir -p /mnt/modelall/tmp/node_backups
mv /mnt/modelall/ComfyUI/custom_nodes/*.bak* \
   /mnt/modelall/tmp/node_backups/ 2>/dev/null || true

And clear pycache for this pack before restarting:

find /mnt/modelall/ComfyUI/custom_nodes/ComfyUI-HyMT2 -name __pycache__ \
    -type d -exec rm -rf {} + 2>/dev/null
find /mnt/modelall/ComfyUI/custom_nodes/ComfyUI-HyMT2 -name "*.pyc" -delete

7. apply_chat_template return shape

We call apply_chat_template(..., return_tensors="pt", return_dict=True) which works on transformers >= 4.45. The Hy-MT2 chat template is shipped inside the repo's tokenizer_config.json, so no template arg is needed client-side.