Instructions to use artokun/gemma4-comfyui-mcp with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use artokun/gemma4-comfyui-mcp with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="artokun/gemma4-comfyui-mcp") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("artokun/gemma4-comfyui-mcp", dtype="auto") - llama-cpp-python
How to use artokun/gemma4-comfyui-mcp with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="artokun/gemma4-comfyui-mcp", filename="12b/model-q4_k_m.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use artokun/gemma4-comfyui-mcp with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf artokun/gemma4-comfyui-mcp:Q4_K_M # Run inference directly in the terminal: llama cli -hf artokun/gemma4-comfyui-mcp:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf artokun/gemma4-comfyui-mcp:Q4_K_M # Run inference directly in the terminal: llama cli -hf artokun/gemma4-comfyui-mcp:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf artokun/gemma4-comfyui-mcp:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf artokun/gemma4-comfyui-mcp:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf artokun/gemma4-comfyui-mcp:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf artokun/gemma4-comfyui-mcp:Q4_K_M
Use Docker
docker model run hf.co/artokun/gemma4-comfyui-mcp:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use artokun/gemma4-comfyui-mcp with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "artokun/gemma4-comfyui-mcp" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "artokun/gemma4-comfyui-mcp", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/artokun/gemma4-comfyui-mcp:Q4_K_M
- SGLang
How to use artokun/gemma4-comfyui-mcp with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "artokun/gemma4-comfyui-mcp" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "artokun/gemma4-comfyui-mcp", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "artokun/gemma4-comfyui-mcp" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "artokun/gemma4-comfyui-mcp", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use artokun/gemma4-comfyui-mcp with Ollama:
ollama run hf.co/artokun/gemma4-comfyui-mcp:Q4_K_M
- Unsloth Studio
How to use artokun/gemma4-comfyui-mcp with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for artokun/gemma4-comfyui-mcp to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for artokun/gemma4-comfyui-mcp to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for artokun/gemma4-comfyui-mcp to start chatting
- Pi
How to use artokun/gemma4-comfyui-mcp with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf artokun/gemma4-comfyui-mcp:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "artokun/gemma4-comfyui-mcp:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use artokun/gemma4-comfyui-mcp with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf artokun/gemma4-comfyui-mcp:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default artokun/gemma4-comfyui-mcp:Q4_K_M
Run Hermes
hermes
- Atomic Chat new
- OpenClaw new
How to use artokun/gemma4-comfyui-mcp with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf artokun/gemma4-comfyui-mcp:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "artokun/gemma4-comfyui-mcp:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
- Docker Model Runner
How to use artokun/gemma4-comfyui-mcp with Docker Model Runner:
docker model run hf.co/artokun/gemma4-comfyui-mcp:Q4_K_M
- Lemonade
How to use artokun/gemma4-comfyui-mcp with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull artokun/gemma4-comfyui-mcp:Q4_K_M
Run and chat with the model
lemonade run user.gemma4-comfyui-mcp-Q4_K_M
List all available models
lemonade list
gemma4-comfyui-mcp
Local, offline LLMs fine-tuned to be ComfyUI experts that drive the full
comfyui-mcp tool surface — 178
tools (113 MCP server tools + 65 live-canvas panel_* tools) — in Gemma 4's
native tool-call format. These are the free, no-API-key backends for the
comfyui-mcp Agent Panel: pick Ollama (local) in the panel and the agent
edits your live graph, generates images/video/audio, manages models and
custom nodes, and runs your workflows — entirely on your GPU.
Quickstart (Ollama, recommended):
ollama pull artokun/gemma4-comfyui-mcp:e4b # default — ~3.5 GB VRAM at q4
# also: :e2b (~2 GB VRAM) :12b (~8 GB VRAM)
Size ladder
Pick by VRAM budget. Every rung is the same data, same recipe — only the base size changes.
| Tag | Rung | Folder | Download (q4) | VRAM (q4) | Status |
|---|---|---|---|---|---|
:e2b |
Gemma 4 E2B (Heretic-ara) | e2b/ |
3.4 GB | ~2 GB | ✅ available |
:e4b |
Gemma 4 E4B (Heretic) | e4b/ |
5.3 GB | ~3.5 GB | ✅ available — the default |
:12b |
Gemma 4 12B (Heretic) | 12b/ |
7.4 GB | ~8 GB | ✅ available |
:26b-a4b |
Gemma 4 26B-A4B, NVFP4 (nvidia) | — | — | — | ⏸ parked (QLoRA+MoE routing interact poorly) |
Each folder ships the GGUF quant(s), the LoRA adapter (r=32 — apply to the base or re-export any quant yourself), the trained chat template, and tokenizer/trainer configs.
What makes these different
A stock model meets comfyui-mcp's ~200-schema catalog cold and burns its context (and your patience) learning it. These models were trained on the tool suite itself:
- Data: 1,055 server-verified tool-use trajectories (e4b/e2b; the earlier
12b rung trained on the initial 772) — synthesized TOUCAN-style against a
live ComfyUI + comfyui-mcp server: task synthesis → real trajectory
generation → server-verified filtering (every outcome checked against
the actual server state, never the model's claims). Grounded in real pack
workflows (krea2 / ideogram / qwen-edit / wan / ltxv) and skills. Fully
open:
artokun/comfyui-mcp-trajectories. - Trimmed-context tool-menu training: each example is rendered with the tools it actually calls plus random distractors (≤24 of the 178), in random order — the model learns to navigate a menu, not memorize positions, and generalizes to the full surface at inference (the xLAM/Toucan/Hermes recipe).
- Teachers: open-weight only. No Anthropic/OpenAI/Google outputs anywhere in the training data (ToS), enforced by a blocklist in the dataset assembly.
- Bases: the Heretic-abliterated Gemma 4 family (Optuna-optimized directional ablation — cleanest abliteration lineage), chosen by a server-verified bake-off over other abliterated variants.
- Recipe: QLoRA r=32 / α=32 on q/k/v/o + MLP projections, 2 epochs, cosine LR 2e-4, seq len 12–16K, loss masked to assistant turns.
Validation
Every rung is validated in llama-server --jinja before release: native
tool-call emission (finish_reason=tool_calls), correct tool selection,
well-formed JSON arguments, and dimension/parameter extraction from
natural-language requests. Final train loss: 0.022 (e4b), 0.021 (e2b);
the 12b rung additionally passed live end-to-end panel runs.
Known behavior: :e2b reasons verbosely before calling — give it
max_tokens ≥ 512 or the call gets truncated mid-thought.
Usage
ComfyUI Agent Panel (the intended home): install
comfyui-mcp, pull a tag, pick
Ollama (local) in the panel's backend picker. :e4b is the built-in
default — zero further config.
Plain Ollama / any OpenAI-compatible client:
ollama pull artokun/gemma4-comfyui-mcp:e4b
# tags ship num_ctx 65536 + temperature 0 + the ComfyUI agent system prompt
llama.cpp:
llama-server -m e4b/model-q4_k_m.gguf --jinja -c 16384
From the adapter (transformers + PEFT): load the base
(AutoModelForImageTextToText — Gemma 4 is the unified multimodal arch),
attach <size>/adapter_model.safetensors, merge_and_unload(). A clean
re-export path (sharded 16-bit + GGUF) ships in
finetune/train/reexport.py.
Repo layout
12b/ e4b/ e2b/ model-q4_k_m.gguf (+q5/q8 where built), LoRA adapter,
chat_template.jinja, tokenizer/trainer configs
finetune/ the COMPLETE pipeline: datagen (task synth + tool-surface
export), train (QLoRA + dataset prep + re-export),
arena (server-verified eval harness), package (Modelfile)
finetune/data/ train/val JSONL (1,055 trajectories) + the 178-tool surface
Limits
Tool calling is the trained strength. Vision is limited at these sizes — the
agent generates but can't visually critique its own outputs — and hard
multi-stage graph composition (multi-output pipelines built in one shot)
remains frontier-model territory. Arena scores for the fine-tuned rungs vs
stock Gemma 4 are queued; the harness is in finetune/arena/.
Credits & license
Bases by p-e-w (Heretic) and coder3101; Gemma 4 by Google DeepMind (Gemma license). Fine-tune, data, and pipeline by @artokun — part of the comfyui-mcp project.
- Downloads last month
- 77
4-bit
5-bit
8-bit
Model tree for artokun/gemma4-comfyui-mcp
Base model
google/gemma-4-12B