Nodes/ComfyUI Smart Model Loader/CLIP Text Encode (Advanced)
ComfyUI Node

CLIP Text Encode (Advanced)

Krea2 tap balancing, actually explained

By r-vage·Created 29 days ago·Updated 3 days ago· 2
CLIP Text Encode (Advanced)
  • clip
  • conditioning
text
rebalance_presetnone
per_layer_weights1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.5, 5.0, 1.1, 4.0, 1.0
multiplier1.00
renormalizetrue
krea2_only_multiplierfalse

This is the pack's "I understand your fancy new model" node. CLIP Text Encode (Advanced) [Eclipse] takes a plain prompt, encodes it, and then gives you two dials the stock encoder doesn't have: a global multiplier for overall prompt strength, and per-layer rebalancing for Krea 2's multi-layer tap architecture. If you're not running Krea 2, you still get a handy prompt-strength multiplier out of it.

Here's the mechanism, grounded in the source. A CLIP embedding for a model like Krea 2 isn't one monolithic vector - the feature dimension is split into 12 layer taps, each carrying different semantic weight. When you pick a rebalance_preset, the node multiplies each tap by a fixed gain vector:

  • balanced - boosts the late taps up to 5x (that's the [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.5, 5.0, 1.1, 4.0, 1.0] preset).
  • detail - dampens early taps, hammers late ones up to 6x. More aggressive, for when you want fine detail emphasized.
  • subtle - gentle late-tap boost, up to 2x.
  • uniform - a flat 1.0 across the board, i.e. no rebalancing.
  • custom - you supply per_layer_weights as 12 comma-separated floats.

Then renormalize (on by default) rescales the altered tensor's RMS back to the original, so you get the rebalancing without accidentally cranking the overall prompt volume. The multiplier is the separate global knob on top: >1.0 amplifies the whole conditioning, <1.0 weakens it. And krea2_only_multiplier is the polite option - the multiplier applies only when the model actually is Krea 2, so you can leave a multiplier in the graph without it wrecking a normal SDXL workflow.

For non-Krea 2 models the node is smart about it: if the conditioning dimension isn't divisible by your weight count, it logs a warning and falls back to a uniform scale, so the layer math never silently corrupts a normal model. The multiplier still applies.

If this rebalancing concept sounds familiar, that's because it is: Krea 2 shipped the same day a dedicated ComfyUI-ConditioningKrea2Rebalance node appeared in the community, and it quickly became the standard way to shape Krea 2 output. This encoder is this pack's in-graph version of that idea - same adjustment, no extra pack.

Inputs

  • clip and text - as any encoder.
  • rebalance_preset - none / balanced / detail / subtle / uniform / custom.
  • per_layer_weights - active only on custom; 12 floats for Krea2, commas or semicolons accepted.
  • multiplier, renormalize, krea2_only_multiplier - described above.

Output: one conditioning socket, same as the basic encoder.

Installing

cd ComfyUI/custom_nodes
git clone https://github.com/r-vage/ComfyUI_SmartModelLoader.git
cd ComfyUI_SmartModelLoader
python -m pip install -r requirements.txt

or ComfyUI Manager → ComfyUI Smart Model Loader, restart.

Where people trip

  • "per_layer_weights is empty" - you set custom but left the field blank. It needs at least 2 numbers; for Krea2, 12.
  • Everything looks identical to stock - with preset none and multiplier 1.0, that's exactly what it is. This node earns its keep only when you use its knobs.
  • Overdone detail - detail at 6x on late taps is a lot. If output gets crunchy or text-heavy artifacts appear, back off to balanced or subtle before blaming the model.
Category🌒 Smart Model Loader/ Conditioning

Inputs (7)

NameTypeDefaultDescription
clipCLIPThe input CLIP model used to tokenize and encode the prompt.
textSTRINGThe text prompt to be converted into conditioning embeddings.
rebalance_presetCOMBOnoneSelect a layer-gain rebalancing profile for Krea2 multi-layer tap models. 'none' disables rebalancing. 'balanced' boosts late taps up to 5x. 'detail' dampens early taps and aggressively boosts late taps up to 6x. 'subtle' gently boosts late taps up to 2x. 'uniform' applies a flat 1.0. 'custom' uses 'per_layer_weights'.
per_layer_weightsSTRING1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.5, 5.0, 1.1, 4.0, 1.0Comma-separated float gains (e.g. 12 values for Krea2) applied to individual layer outputs. Active only when preset = 'custom'.
multiplierFLOAT1.00-1000–1000Global strength multiplier applied to the conditioning embedding tensor. Values > 1.0 amplify prompt influence; < 1.0 reduce it.
renormalizeBOOLEANtrueWhen enabled, rescales the altered conditioning tensor's RMS to match the original, keeping the overall prompt strength/volume constant after layer weighting.
krea2_only_multiplierBOOLEANfalseWhen enabled, the global multiplier is only applied to Krea2 models. For standard models, the multiplier is ignored (treated as 1.0).

Outputs (1)

NameTypeDescription
conditioningCONDITIONINGA conditioning containing the embedded text used to guide the diffusion model.