Nodes/ComfyUI-Texturaizer/Clip Encode Switch (Texturaizer)
ComfyUI Node

Clip Encode Switch (Texturaizer)

One text-encode node that handles SDXL's dual prompt or falls back to a single one

By LatentSpaceDirective·Created 2 years ago·Updated 8 months ago· 21
Clip Encode Switch (Texturaizer)
  • clip
  • CONDITIONING
text_g
text_l
use_sdxl

SDXL wants two prompt strings (a "G" and an "L" text field feeding its two text encoders); most other models just want one. If your workflow needs to support both without you swapping text-encode nodes every time you switch checkpoints, that's exactly what this node is for - one CLIP Text Encode with a toggle deciding whether it behaves like SDXL's split-prompt version or a normal single-prompt encode.

How it works

SDXL's checkpoint carries two text encoders - CLIP-L and OpenCLIP-bigG - and both process your prompt before their outputs get combined into one conditioning. Most SD 1.5 and non-SDXL setups only have the one encoder, so you write one prompt and it goes straight through. This node's use_sdxl boolean is the switch between those two behaviors: flip it on and the node treats text_g and text_l as SDXL's dual prompt fields; flip it off and it collapses back to a single encode, presumably using just one of the two text fields (the schema doesn't spell out which field wins when SDXL mode is off, so if you're not on SDXL, keep whatever you actually want encoded in text_g to be safe). It's the kind of switch that matters a lot if Texturaizer's Blender side is driving checkpoint selection for you and you don't want to manually rewire your text-encode node every time the model changes underneath you.

The inputs that matter

  • clip - the CLIP model to encode with, from your checkpoint or split loader.
  • text_g - the primary prompt text. On SDXL this is the "G" (global/bigG) field; it's also the field you'd use as your main prompt when use_sdxl is off.
  • text_l - SDXL's secondary "L" prompt field. Only meaningful when use_sdxl is on.
  • use_sdxl - the boolean that decides which of the above matters.

Output is a single CONDITIONING, wired straight into your KSampler's positive or negative slot like any other text encode node's output.

Installing it

ComfyUI Manager → search Texturaizer → Install → restart, or by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/LatentSpaceDirective/ComfyUI-Texturaizer

then restart ComfyUI. Nothing extra to install - this node runs on whatever CLIP model your checkpoint or loader already provides.

Where people get burned

The near-zero impressions on this one tell their own story - it's a niche utility, and worth knowing about mainly if you're chaining it after Texturaizer_ApplyStyleToPrompt, which outputs exactly the PROMPT G / PROMPT L string pair this node's text_g/text_l inputs are shaped for. Used on its own, the main trap is forgetting to flip use_sdxl when you swap checkpoints - leave it on for a non-SDXL model and you're likely wasting the text_l field's contribution (or getting it interpreted in a way you didn't intend), and leave it off for SDXL and you lose the second encoder's contribution to your prompt entirely, which on SDXL checkpoints is a meaningful chunk of prompt adherence.

CategoryTexturaizer

Inputs (4)

NameTypeDefaultDescription
clipCLIP
text_gSTRING
text_lSTRING
use_sdxlBOOLEAN

Outputs (1)

NameTypeDescription
CONDITIONINGCONDITIONING