ComfyUI Extension: comfyui-gemma4translate-e2b

Authored by jkmq-f

Created

Updated

0 stars

Run ComfyUI workflows without the setup

No installs, no CUDA version roulette, no GPU sitting idle on your bill. Bring a workflow and run it in the browser.

ComfyUI custom node for local translation with Gemma 4 E2B

Looking for a different extension?

Custom Nodes (1)

README

ComfyUI-Gemma4Translate-E2B

Gemma 4 E2B を使ったローカル翻訳用の ComfyUI カスタムノードです。

ComfyUI-Gemma4Translate-E2B.zip

この版は、環境変数ではなくノードUI側で次を設定して workflow に保存できます。

  • local_model_dir
  • offline_mode
  • load_strategy
  • clear_loaded_model

主な挙動

  • モデルは google/gemma-4-E2B-it 固定
  • local_model_dir にフォルダを書けば、その場所を最優先
  • その場所にモデルが無ければ、オンライン時はそこへダウンロードして保存
  • 未入力なら既存の Hugging Face キャッシュを自動探索
  • offline_mode = true のとき、ローカルが無ければエラー
  • load_strategy = reload_every_run がデフォルトで、実行後にモデルを解放
  • load_strategy = keep_loaded にするとロードしたモデルを保持

UIおすすめ設定

毎回HTTP確認を避けたい

  • local_model_dir にローカルモデルのパス
  • offline_mode = true
  • load_strategy = keep_loaded

VRAMを節約したい

  • デフォルトのまま load_strategy = reload_every_run

毎回の再ロードを避けたい

  • load_strategy = keep_loaded

インストール

cd ComfyUI/custom_nodes
unzip ComfyUI-Gemma4Translate-E2B.zip
cd ComfyUI-Gemma4Translate-E2B
python -m pip install "wheel==0.45.1"
python -m pip install "transformers==5.5.0"
python -m pip install -r requirements.txt

Acknowledgements

このプロジェクトは rookiestar28/ComfyUI-TranslateGemma をベースに改変したものです。

主な変更点

  • Gemma 4 E2B 向けに調整
  • local_model_dir などをノードUIから保存可能に変更
  • オフライン運用向けに調整
  • VRAM節約のため、デフォルトで実行後アンロード

起動オプションについて

環境によっては CUDA メモリ確保まわりで不安定になることがあります。
その場合は、ComfyUI を以下のように --disable-cuda-malloc 付きで起動してください。

python main.py --disable-cuda-malloc

互換メモ

このノードは ComfyUI の既存 Python 環境に追加で入れる前提です。

  • Torch は ComfyUI 側のものをそのまま使う
  • 目安として Torch 2.5.x 系 の環境を想定
  • transformers5.5.0 を使う前提
  • bitsandbytes は基本的に Linux + CUDA 向け

Torch をこのノード側の requirements.txt で上書きしないようにしています。 ComfyUI 本体の Torch を壊したくないためです。

推奨インストール

cd ComfyUI/custom_nodes/ComfyUI-Gemma4Translate-E2B
pip install -r requirements.txt

すでに別バージョンの transformers が入っていて不安定な場合は、明示的に次を実行してください。

python -m pip install --upgrade --force-reinstall "wheel==0.45.1"
python -m pip install --upgrade --force-reinstall "transformers==5.5.0"

Run ComfyUI workflows without the setup

No installs, no CUDA version roulette, no GPU sitting idle on your bill. Bring a workflow and run it in the browser.

Learn more