Ir para o conteúdo
Node packVerificadoExterno
Fonte aberta

comfyui_toriigate_T8

支持本地comfyui直接调用模型

Mantenedor@T8marsB · adoptionnota

Perfil do pacote

Status
Verificado
Publicador
@T8mars
Fonte
GitHub

README

comfyui_toriigate_T8

中文 | English

这是 ToriiGate-0.5 的 ComfyUI 自定义节点 T8 版本。这个版本保留原有 Transformers 节点,同时新增了 llama-cpp-python 本地 GGUF 直连模式: 不需要手动启动 llama-server,节点可以直接扫描并加载 ComfyUI/models/LLM 下的本地模型。

基于以下项目改造:

主要改动

  • ToriiGate Llama.cpp Vision Generate 默认使用 local_gguf 本地运行模式。
  • 节点会自动扫描 ComfyUI/models/LLM 目录下的 .gguf 模型。
  • 普通 GGUF 模型和 mmproj 视觉投影模型会分成两个下拉框选择。
  • 自动忽略 0 字节 GGUF 占位文件,避免把未下载完成的模型列入下拉框。
  • 默认优先选择 ToriiGate-0.5-Q8_0.gguf 和 ToriiGate-0.5-Q8_0.mmproj.gguf。
  • 已适配 ComfyUI Nodes 2.0 的下拉菜单、开关和设置持久化。
  • 仍保留外部 llama-server 的 OpenAI 兼容 API 模式,可切换为 api_server。
  • 修复文本 API 节点中 actual_temperature 未定义的问题。

安装

把仓库克隆到 ComfyUI/custom_nodes:

cd ComfyUI/custom_nodes
git clone https://github.com/T8mars/comfyui_toriigate_T8.git

安装或更新后重启 ComfyUI。

也可以在 ComfyUI 节点管理器 / Registry 中搜索:

toriigate-t8

模型放置位置

把 GGUF 模型放到:

ComfyUI/models/LLM/

推荐默认文件名:

ComfyUI/models/LLM/ToriiGate-0.5-Q8_0.gguf
ComfyUI/models/LLM/ToriiGate-0.5-Q8_0.mmproj.gguf

模型下载地址:

节点会递归扫描 ComfyUI/models/LLM:

  • local_model_path:列出文件名不包含 mmproj 的 .gguf 文件。
  • local_mmproj_path:列出文件名包含 mmproj 的 .gguf 文件。

如果上面两个 ToriiGate 文件存在,它们会自动排在下拉框第一项。

节点说明

ToriiGate Grounding Builder

用于生成 ToriiGate 所需的提示词文本。可选择官方常用格式,例如 long_thoughts_v2、json、short、漫画相关格式等。

ToriiGate Llama.cpp Vision Generate

推荐使用的 GGUF 图片反推节点。

常用参数:

  • runtime:默认 local_gguf,直接在 ComfyUI 内加载本地 GGUF;切到 api_server 时使用外部 llama-server。
  • local_model_path:从 ComfyUI/models/LLM 自动扫描出的主 GGUF 模型。
  • local_mmproj_path:从 ComfyUI/models/LLM 自动扫描出的视觉投影 GGUF。
  • chat_handler:默认 auto 即可,会优先使用可用的 Qwen 视觉 handler。
  • keep_model_alive:连续生成时建议开启;关闭后每次生成结束释放本地模型。
  • n_gpu_layers:默认 -1,让 llama.cpp 尽可能把层卸载到 GPU。
  • n_ctx:上下文长度,默认 8192。
  • max_new_tokens:默认 1024,适合生成完整的 long_thoughts 类提示词;前端会记住用户手动设置的值,避免运行或切换 tab 后回落到 64。

ToriiGate Llama.cpp Text Generate

文本生成辅助节点。也支持 local_gguf,并从 ComfyUI/models/LLM 自动列出 本地 GGUF 模型。

ToriiGate Captioner

原始 Transformers/PyTorch 本地节点,加载 Hugging Face 原始模型格式,不支持 GGUF。

本地 GGUF 模式

默认模式为:

runtime = local_gguf

默认加载:

models/LLM/ToriiGate-0.5-Q8_0.gguf
models/LLM/ToriiGate-0.5-Q8_0.mmproj.gguf

这些是相对 ComfyUI 根目录的路径,实际指向:

<ComfyUI>/models/LLM/ToriiGate-0.5-Q8_0.gguf
<ComfyUI>/models/LLM/ToriiGate-0.5-Q8_0.mmproj.gguf

本地模式要求启动 ComfyUI 的 Python 环境中安装了较新的 llama-cpp-python,并且支持 Qwen 视觉/mmproj。

可用下面命令检查:

python -c "import llama_cpp, llama_cpp.llama_chat_format as f; print(llama_cpp.__version__); print(hasattr(f, 'Qwen3VLChatHandler'))"

输出里第二行是 True 时,本地视觉 GGUF 模式可用。

外部 API 模式

如果你想继续使用单独启动的 llama-server,把节点的 runtime 改为:

api_server

示例启动命令:

llama-server.exe ^
  --model ToriiGate-0.5-Q8_0.gguf ^
  --mmproj ToriiGate-0.5-Q8_0.mmproj.gguf ^
  --port 8080 ^
  -b 2048 -ub 1024 -fa on -fit on -fitt 1024 -ngl 999

节点里的 server_url 填:

http://127.0.0.1:8080

API 模式会请求:

http://127.0.0.1:8080/v1/chat/completions

如果你的服务没有这个 OpenAI 兼容接口,就会出现 HTTP 404。此时建议直接使用 默认的 local_gguf 模式。

Python 依赖

原始 Transformers 节点需要:

pip install -r requirements.txt

本地 GGUF 模式需要 llama-cpp-python。不同显卡和后端的安装方式不同, 很多 ComfyUI 整合包已经内置这个依赖。如果你的 ComfyUI Python 不能 import llama_cpp,请把 llama-cpp-python 安装到启动 ComfyUI 的同一个 Python 环境中。

推荐按自己的 CUDA / 平台版本手动选择对应 wheel:

requirements.txt 只保留节点通用依赖,不会强制安装某个具体版本或某个 特定后端的 llama-cpp-python。

常见问题

Nós neste pacote

Nós 4
  • ToriiGate_Captioner
  • ToriiGate_GroundingBuilder
  • ToriiGate_LlamaCppTextGenerate
  • ToriiGate_LlamaCppVisionGenerate

Fontes

3 fontes
GitHubPrimárioVersão main
github.com/T8mars/comfyui_toriigate_T8

Verificado 5 de nov.

GitHubFonteVersão c53111b9e2ca39c4d37ff38db920e4f229cc50cc
github.com/T8mars/comfyui_toriigate_T8

Verificado 5 de out.

GitHubFonte
github.com/T8mars/comfyui_toriigate_T8

Verificado 25 de out.

Trechos de fonte

2 trechos

Source context: Repo T8mars/comfyui_toriigate_T8

Source context: Repo T8mars/comfyui_toriigate_T8