Gemma3 Model Loader
Loading Gemma 3 in ComfyUI
- model
- processor
This is the front door of the ComfyUI_Gemma3 pack. Gemma3ModelLoader pulls Google's Gemma 3 vision-language model from Hugging Face (or a local folder) and hands you the two things ApplyGemma3 needs: a model and a processor. Everything downstream in the pack depends on this node, and everything that's heavy - the download, the VRAM, the dependency mess - happens here.
How it works
It's a thin wrapper around Hugging Face transformers. Pick a model_id, and on first run from_pretrained downloads the weights into ComfyUI/models/Gemma3/ (its own cache dir, not your checkpoints folder), then loads them with device_map="auto" and returns the model plus its processor. Flip load_local_model on and it skips the download entirely, treating local_gemma3_model_path as a local folder or HF repo id. That's the whole mechanism - no quantization, no fancy options.
The choice that matters
The model_id dropdown defaults to google/gemma-3-27b-it, and that default is a trap for anyone without a serious GPU. The 27B in bf16 is roughly 54 GB of weights. It will not fit a 24 GB card without offloading, and device_map="auto" will happily spill onto your CPU and RAM - which works, and is also painfully slow. Community consensus is that the 27B needs Q4 quantization before it fits comfortably in 24 GB (thread 1lvz9bo: "fits snugly into a single 24GB card"). This node has no quantization path; it loads full precision.
So the honest advice: unless you've got a big card or a RAM-heavy machine you don't mind thrashing, start with google/gemma-3-4b-it (≈8 GB) or google/gemma-3-1b-it (≈2.5 GB). The 4B is a genuinely solid little captioner that still gets the job done. The 12B (≈24 GB) is the compromise for a 24 GB card - but it'll be tight next to a diffusion sampler.
Inputs and outputs
model_id(dropdown): the four official HF ids - 27b (default), 12b, 4b, 1b.load_local_model(BOOLEAN, default false): true to use your own folder instead of downloading.local_gemma3_model_path(STRING, optional): the path or HF id used whenload_local_modelis on.
Outputs are model (MODEL) and processor (PROCESSOR). Both are pack-local types - they only plug into ApplyGemma3. There's nothing else in ComfyUI that consumes them, so don't expect these to reach a KSampler.
Install
ComfyUI Manager should find it - search "Gemma3" or "ComfyUI_Gemma3" - though the README hedges with "on the way", so the manual path is the reliable one:
cd ComfyUI/custom_nodes
git clone https://github.com/leeguandong/ComfyUI_Gemma3.git
pip install -r ComfyUI_Gemma3/requirements.txt
then restart ComfyUI.
The gotcha that costs an afternoon
requirements.txt pins transformers to a dev branch: git+https://github.com/huggingface/[email protected]. That's the pre-release branch Google used for Gemma 3 support, and it's exactly the kind of pin that starts dependency hell. If another node pack needs the released transformers, one of them loses the fight (the KB's comfyui-ecosystem essay covers this pattern in detail). Install this pack, then install or update other LLM-node packs, and watch for transformers conflicts before assuming anything else is broken.
Two more practical notes. Don't hunt for the model in checkpoints or unet - it lives in ComfyUI/models/Gemma3/. And the first run of this node is the slow one; the 5–50 GB download happens here, not in ApplyGemma3. If ComfyUI looks frozen on first load, it's downloading, not dead.
One reputation caveat from the community: leeguandong's packs are functional but occasionally rough around the edges - the sibling ComfyUI_FluxLayerDiffuse is a recurring "doesn't work" topic on r/comfyui. If loading fails, check the transformers version first; that's the number-one suspect.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| model_id | COMBO | google/gemma-3-27b-it | 4 options: google/gemma-3-27b-it, google/gemma-3-12b-it, google/gemma-3-1b-it, google/gemma-3-4b-it |
| load_local_model | BOOLEAN | false | — |
| local_gemma3_model_pathopt | STRING | google/gemma-3-27b-it | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| model | MODEL | — |
| processor | PROCESSOR | — |