Nodes/Unified Conditioning Merge (with timestep ranges)/CLIP Text Encode SDXL (Cutoff Region Enhanced)
ComfyUI Node

CLIP Text Encode SDXL (Cutoff Region Enhanced)

Cutoff prompt isolation in one node — plugin-free, unless you want the original

By RandyHaylor·Created 4 months ago·Updated 3 months ago· 1
CLIP Text Encode SDXL (Cutoff Region Enhanced)
  • clip
  • latent
  • conditioning
  • upscaled_conditioning
  • reference_full_prompt
upscaled_conditioning_multiplier1.00
section_count3
join_separator,
mask_token
strict_mask1.00
start_from_masked1.00
support_a1111_style_embedding_texttrue
remove_text_for_unsupported_embeddingstrue
filter_known_a1111_embedding_tags_not_installed_locallytrue
zoom1.00
offset_x0.00
offset_y0.00
section_1_text
section_1_isolatetrue
section_1_weight1.00
section_1_clipPass L+G
section_2_text
section_2_isolatetrue
section_2_weight1.00
section_2_clipPass L+G
section_3_text
section_3_isolatetrue
section_3_weight1.00
section_3_clipPass L+G
section_4_text
section_4_isolatetrue
section_4_weight1.00
section_4_clipPass L+G
section_5_text
section_5_isolatetrue
section_5_weight1.00
section_5_clipPass L+G
section_6_text
section_6_isolatetrue
section_6_weight1.00
section_6_clipPass L+G
section_7_text
section_7_isolatetrue
section_7_weight1.00
section_7_clipPass L+G
section_8_text
section_8_isolatetrue
section_8_weight1.00
section_8_clipPass L+G
section_9_text
section_9_isolatetrue
section_9_weight1.00
section_9_clipPass L+G
section_10_text
section_10_isolatetrue
section_10_weight1.00
section_10_clipPass L+G
section_11_text
section_11_isolatetrue
section_11_weight1.00
section_11_clipPass L+G
section_12_text
section_12_isolatetrue
section_12_weight1.00
section_12_clipPass L+G
section_13_text
section_13_isolatetrue
section_13_weight1.00
section_13_clipPass L+G
section_14_text
section_14_isolatetrue
section_14_weight1.00
section_14_clipPass L+G
section_15_text
section_15_isolatetrue
section_15_weight1.00
section_15_clipPass L+G
section_16_text
section_16_isolatetrue
section_16_weight1.00
section_16_clipPass L+G

Two subjects in one prompt, and their attributes smear into each other - the girl picks up the background's moody lighting, the background picks up her hair. That's prompt context bleeding, and it's the reason the Cutoff algorithm exists. Cutoff measures each phrase's influence on the global CLIP embedding, then confines that influence back to the phrase's own tokens so regions don't contaminate each other.

This node is a single-node prompt builder that implements Cutoff from scratch, self-contained, under MIT license. That's the important part: you don't need the ComfyUI_Cutoff plugin for the default behavior. The author reimplemented the algorithm in cutoff_per_stream_isolation.py specifically so it can run independently per CLIP stream - something the original plugin can't do.

How it works

The node has a section_count you can expand or collapse (1..16). Each section gets:

  • section_N_text - the prompt chunk.
  • section_N_isolate (default on) - registers the section as a Cutoff region with region_text == target_text == section text. Off, and the section is still in the prompt but isn't isolated.
  • section_N_weight (-10..10) - with isolate on, it's the Cutoff region weight; with isolate off, the text gets wrapped in (text:weight) attention syntax instead.
  • section_N_clip - Pass L+G (default) / Pass L / Pass G / Classic. This is the stream-routing trick. Pass L sends the section only to CLIP-L and encodes the empty prompt for CLIP-G - using CLIP-G's natural empty embedding, not a zero-masked tensor, which would be out-of-distribution. Sections sharing a choice are grouped into one encoding pass, then emitted as a multi-entry (combine-style) conditioning.

Classic is the one mode that routes through the actual BlenderNeko ComfyUI_Cutoff plugin - it is the upstream plugin's code, so it reproduces its exact behavior, and it requires ComfyUI_Cutoff installed. The other three modes have no external dependency.

Size metadata, because it's an SDXL node

Like the rest of the enhanced encoder family, it bundles the crop-zoom math: an optional latent input determines target W/H (defaults to 1024×1024), and zoom/offset_x/offset_y compute the SDXL size/crop fields on every output entry. There's also upscaled_conditioning_multiplier (min 1.0, default 1.0), which scales the target W/H for a second upscaled_conditioning output - matching a hires-fix latent upscale so the upscale-stage sampler sees target sizes that reflect the larger working resolution. The author reports this gives a subtle but real bump in fine detail and sharpness, most visible on photoreal models and with more second-stage steps.

Outputs: conditioning (final, through Cutoff), upscaled_conditioning (same prompt, upscaled metadata), and reference_full_prompt (STRING - the joined text CLIP actually encoded; wire to ShowText).

Install

ComfyUI Manager → search "Unified Conditioning", or:

cd ComfyUI/custom_nodes
git clone https://github.com/RandyHaylor/unified-conditioning-combine-with-timestep-range.git unified-conditioning-merge

Restart ComfyUI; it's under unified-conditioning-merge. No models, no pip deps. Only if you want Classic mode, also install ComfyUI_Cutoff.

Troubleshooting

  • Classic errors if ComfyUI_Cutoff isn't installed - that's the expected dependency, not a bug.
  • Empty sections are skipped even inside the active range, so leaving slots blank is safe.
  • If a section seems to have no effect, check section_N_isolate - isolation off makes it plain text.
  • Use reference_full_prompt to confirm the prompt you think you built is the one that got encoded.
Categoryunified-conditioning-merge

Inputs (78)

NameTypeDefaultDescription
clipCLIP
upscaled_conditioning_multiplierFLOAT1.00
section_countINT31–16
join_separatorSTRING,
mask_tokenSTRING
strict_maskFLOAT1.000–1
start_from_maskedFLOAT1.000–1
support_a1111_style_embedding_textBOOLEANtrue
remove_text_for_unsupported_embeddingsBOOLEANtrue
filter_known_a1111_embedding_tags_not_installed_locallyBOOLEANtrueList can be modified in custom node folder: known_a1111_embedding_names_to_filter_when_not_installed_locally.txt
zoomFLOAT1.001–100
offset_xFLOAT0.00-1–1
offset_yFLOAT0.00-1–1
section_1_textSTRING
section_1_isolateBOOLEANtrue
section_1_weightFLOAT1.00-10–10
section_1_clipCOMBOPass L+G4 options: Pass L+G, Pass L, Pass G, Classic
section_2_textSTRING
section_2_isolateBOOLEANtrue
section_2_weightFLOAT1.00-10–10
section_2_clipCOMBOPass L+G4 options: Pass L+G, Pass L, Pass G, Classic
section_3_textSTRING
section_3_isolateBOOLEANtrue
section_3_weightFLOAT1.00-10–10
section_3_clipCOMBOPass L+G4 options: Pass L+G, Pass L, Pass G, Classic
section_4_textSTRING
section_4_isolateBOOLEANtrue
section_4_weightFLOAT1.00-10–10
section_4_clipCOMBOPass L+G4 options: Pass L+G, Pass L, Pass G, Classic
section_5_textSTRING
section_5_isolateBOOLEANtrue
section_5_weightFLOAT1.00-10–10
section_5_clipCOMBOPass L+G4 options: Pass L+G, Pass L, Pass G, Classic
section_6_textSTRING
section_6_isolateBOOLEANtrue
section_6_weightFLOAT1.00-10–10
section_6_clipCOMBOPass L+G4 options: Pass L+G, Pass L, Pass G, Classic
section_7_textSTRING
section_7_isolateBOOLEANtrue
section_7_weightFLOAT1.00-10–10
section_7_clipCOMBOPass L+G4 options: Pass L+G, Pass L, Pass G, Classic
section_8_textSTRING
section_8_isolateBOOLEANtrue
section_8_weightFLOAT1.00-10–10
section_8_clipCOMBOPass L+G4 options: Pass L+G, Pass L, Pass G, Classic
section_9_textSTRING
section_9_isolateBOOLEANtrue
section_9_weightFLOAT1.00-10–10
section_9_clipCOMBOPass L+G4 options: Pass L+G, Pass L, Pass G, Classic
section_10_textSTRING
section_10_isolateBOOLEANtrue
section_10_weightFLOAT1.00-10–10
section_10_clipCOMBOPass L+G4 options: Pass L+G, Pass L, Pass G, Classic
section_11_textSTRING
section_11_isolateBOOLEANtrue
section_11_weightFLOAT1.00-10–10
section_11_clipCOMBOPass L+G4 options: Pass L+G, Pass L, Pass G, Classic
section_12_textSTRING
section_12_isolateBOOLEANtrue
section_12_weightFLOAT1.00-10–10
section_12_clipCOMBOPass L+G4 options: Pass L+G, Pass L, Pass G, Classic
section_13_textSTRING
section_13_isolateBOOLEANtrue
section_13_weightFLOAT1.00-10–10
section_13_clipCOMBOPass L+G4 options: Pass L+G, Pass L, Pass G, Classic
section_14_textSTRING
section_14_isolateBOOLEANtrue
section_14_weightFLOAT1.00-10–10
section_14_clipCOMBOPass L+G4 options: Pass L+G, Pass L, Pass G, Classic
section_15_textSTRING
section_15_isolateBOOLEANtrue
section_15_weightFLOAT1.00-10–10
section_15_clipCOMBOPass L+G4 options: Pass L+G, Pass L, Pass G, Classic
section_16_textSTRING
section_16_isolateBOOLEANtrue
section_16_weightFLOAT1.00-10–10
section_16_clipCOMBOPass L+G4 options: Pass L+G, Pass L, Pass G, Classic
latentoptLATENT

Outputs (3)

NameTypeDescription
conditioningCONDITIONING
upscaled_conditioningCONDITIONING
reference_full_promptSTRING