Nodes/ComfyUI-Prompt-MZ/MinusZone - CLIPTextEncode(PaliGemma)
ComfyUI Node

MinusZone - CLIPTextEncode(PaliGemma)

PaliGemma's long captions, encoded straight into conditioning

By MinusZoneAI·Created 2 years ago·Updated about a year ago· 138
MinusZone - CLIPTextEncode(PaliGemma)
  • image
  • clip
  • text
  • conditioning
model_name
resolution512
keep_devicefalse

CLIPTextEncode(PaliGemma) is this pack's other transformers-based captioner, and it exists for one specific reason: long captions. While Florence-2 writes a sentence or two, the models here - Google's PaliGemma fine-tuned as SD3 long captioners - produce the verbose, multi-sentence descriptions that Flux-style training loves. Feed it an image, get back a detailed natural-language caption, and if a clip is wired in, a ready-to-use CONDITIONING.

The model dropdown is where the difference lives:

  • paligemma-sd3-long-captioner-v2 (default) - the newer, better-regarded long captioner.
  • paligemma-sd3-long-captioner - the original.

Both are PaliGemma checkpoints loaded via PaliGemmaForConditionalGeneration + PaliGemmaProcessor from transformers, running in fp16 on CUDA when available. First run downloads the weights into ComfyUI/models/minus_zone_models.

The inputs that matter

  • model_name - one of the two long captioners above.
  • resolution - default 512. Resize target before captioning; PaliGemma's native sweet spot is 448-512, and higher costs tokens + time.
  • keep_device - False unloads the model after each call (frees VRAM), True keeps it hot for fast repeated captioning. Iterating on captions? True is the difference between seconds and minutes.

Optional: image and clip. Outputs: text (the caption) and conditioning (null without clip).

How it works

PaliGemma is a small multimodal model (a few B params) fine-tuned specifically to write long, descriptive image captions in the style used for SD3 training data. The node runs it in fp16, captures the generated caption, applies a light cleanup, and - when clip is present - encodes the caption through A1111-style weight scaling into conditioning. The output is genuinely long-form prose, which is the entire point: this is the model you choose when your training set wants natural-language paragraphs, not tag lists.

Installing

Part of ComfyUI-Prompt-MZ:

cd ComfyUI/custom_nodes
git clone https://github.com/MinusZoneAI/ComfyUI-Prompt-MZ

Restart. Needs transformers + torch; the PaliGemma weights are a sizable first-run download into minus_zone_models. If the node errors at import, pip install transformers into the ComfyUI venv.

Troubleshooting

The main traps are shared with the Florence-2 cousin. VRAM: PaliGemma in fp16 eats a few GB; run with keep_device off on smaller cards so it unloads before the sampler needs memory. First-run download stalls are usually network - watch the console, and let it resume rather than restarting ComfyUI. And the biggest conceptual gotcha: these long captions are a Flux-era, natural-language tool. If your target base is Danbooru-tag trained (Illustrious/Pony/NoobAI), verbose prose captions will actively hurt - you want a WD14 tagger, not this. But for a Qwen3-encoder model where captions are a chat turn, a long PaliGemma caption is exactly the right shape.

CategoryMinusZone - Prompt

Inputs (5)

NameTypeDefaultDescription
model_nameCOMBO2 options: paligemma-sd3-long-captioner-v2, paligemma-sd3-long-captioner
resolutionINT512128–18446744073709550000
keep_deviceCOMBOfalse2 options: false, true
imageoptIMAGE
clipoptCLIP

Outputs (2)

NameTypeDescription
textSTRING
conditioningCONDITIONING