Nodes/ComfyUI_JinaCLIP_SDXL_Adapter/Jina Text Encode (SDXL) (Advanced)
ComfyUI Node

Jina Text Encode (SDXL) (Advanced)

Jina Text Encode (SDXL) (Advanced) — the lab bench for prompt weighting science

By lRemixl·Created 5 months ago·Updated 3 months ago· 0
Jina Text Encode (SDXL) (Advanced)
  • jina_model
  • jina_adapter
  • CONDITIONING
  • info
textmasterpiece, (best quality:1.2)
weighting_modecomfy
custom_dtypeauto
Padding_ModeNearest-77
format_texttrue
cross_attention_masktrue
unmask_sink_paddingfalse
max_seq_length_string512

The Advanced version of the Jina text encoder is where you go when the standard node mostly works but you want to poke at how your prompt weights are applied. The README is refreshingly honest about what this tier is for: "Advanced nodes included for testing." This is the lab bench. If you just want good prompts with Jina CLIP v2, use the standard Jina Text Encode (SDXL) and don't look back - the advanced node's defaults are tuned to reproduce it. But if you've ever wondered whether Comfy's empty-prompt weighting actually fits a model that wasn't trained on it, this is your knob.

Everything downstream is the same: both encoders feed the loaded Jina model through the adapter, project to SDXL's 2048-dim sequence + 1280-dim pooled, and emit a CONDITIONING for your KSampler. The advanced node layers five extra controls on top of that pipeline.

The inputs that matter

  • weighting_mode (comfy default) - how (word:1.3) syntax gets translated into the embeddings. comfy does the empty-prompt trick (encode blank, then empty + (diff × weight)), which is what the standard node does and the safest bet. A1111 just multiplies the embedding by the weight directly. comfy++ applies weights in contiguous spans - it encodes each weighted stretch and scales it as a block, which sidesteps the empty-prompt assumption but is slower. skip disables weighting entirely so (word:1.3) stays literal text. Genuinely useful for A/B-ing: same prompt, four interpretations, pick the one that matches the image you wanted.
  • custom_dtype (auto default) - the dtype of the returned conditioning. Note auto means fp32 here, not bf16 - the encoder is deliberately conservative about precision. Drop to fp16/bf16 to shave VRAM and see if you can tell the difference.
  • format_text (true default) - a text-cleaning pass: pulls @tags out of your prompt into a prefix and collapses doubled commas/whitespace. Leave it on; it's harmless and makes Danbooru-style tag soup parse more cleanly.
  • unmask_sink_padding (false default) - whether the sink/BOS padding tokens stay masked in cross-attention. This is an edge-case toggle for people debugging why their padding isn't behaving; the default false is correct.
  • max_seq_length_string (512 default, or 1024) - the hard tokenizer truncation limit. 1024 lets you feed genuinely long prompts before anything gets cut.
  • Padding_Mode and cross_attention_mask - same as the standard node; keep padding in step with the adapter loader's max_seq_length.

Outputs: CONDITIONING and info (token counts + embedding shapes). Same wiring as the standard node - positive and negative both need their own instance.

What to actually try

Two experiments are worth the setup. First, flip weighting_mode between comfy and comfy++ on a prompt with a heavily weighted keyword - the difference in adherence tells you which family your mental model of "weighting" actually belongs to. Second, drop custom_dtype to bf16 and compare against fp32: Jina's own loader defaults to bf16, so the adapter is happy to run leaner, and if you can't see the difference you just freed a chunk of VRAM for the same conditioning. The unmask_sink_padding and format_text toggles are the ones you'll rarely touch - they're there because testing surfaces edge cases, not because you're supposed to live on them.

Install

Same pack, same rules:

cd ComfyUI/custom_nodes
git clone https://github.com/lRemixl/ComfyUI_JinaCLIP_SDXL_Adapter

Restart, and confirm the base model is in models/llm/ and the adapter in models/llm_adapters/ (both are separate downloads; the pack itself has no requirements.txt beyond the usual transformers/safetensors/einops that ship with ComfyUI). Load the adapter with the Advanced adapter loader using the README's settings - positional embeddings on, max_seq_length 539, attention pooling on - and this node will slot straight in where your CLIP encoder used to sit. It's more knobs than you need most days, but when the standard node leaves you wondering why a weight isn't landing, these are the knobs that answer it.

Categoryllm_sdxl/jina/advanced

Inputs (10)

NameTypeDefaultDescription
jina_modelJINA_MODEL
jina_adapterJINA_ADAPTER
textSTRINGmasterpiece, (best quality:1.2)
weighting_modeCOMBOcomfy4 options: comfy, A1111, comfy++, skip
custom_dtypeCOMBOauto4 options: auto, bf16, fp16, fp32
Padding_ModeCOMBONearest-774 options: none, Nearest-77, 539, 1078
format_textBOOLEANtrue
cross_attention_maskBOOLEANtrue
unmask_sink_paddingBOOLEANfalse
max_seq_length_stringCOMBO5122 options: 512, 1024

Outputs (2)

NameTypeDescription
CONDITIONINGCONDITIONING
infoSTRING