Nodes/MKRShift_Nodes/CLIP Text Encode (Prompt)
ComfyUI Node

CLIP Text Encode (Prompt)

The same CLIP Text Encode you know, plus a token count and bookmarks

By criskb·Created 7 months ago·Updated 5 months ago· 0
CLIP Text Encode (Prompt)
  • clip
  • conditioning
  • prompt_text
  • summary_json
prompt_text

If you've used ComfyUI for more than an afternoon, you know CLIP Text Encode: prompt text in, conditioning out. MKRCLIPTextEncodePrompt is that node with three upgrades bolted on - it echoes your prompt text out as a wire, it reports an approximate token count, and it hooks into the pack's prompt-bookmark system. Which makes it the boring-but-useful choice when you're tired of guessing whether your prompt is 74 or 77 tokens.

From MKRShift_Nodes by criskb. Install via ComfyUI Manager (search "MKRShift_Nodes") or git clone https://github.com/criskb/MKRShift_Nodes into custom_nodes/, restart. It's in the Core → Prompt category.

How it works

The mechanism is the same encoding path you already trust - it takes a CLIP model and the prompt_text and produces CONDITIONING. What it adds is a summary_json with char/word counts, an approximate token count, and bookmark metadata from the pack's prompt-bookmark store. The token estimate is approximate - it's a heuristic, not the tokenizer's exact count - but it's accurate enough to save you from clipping the end of a prompt at the 77-token wall.

The two inputs

  • clip (required) - your CLIP model from a checkpoint/diffusion model loader.
  • prompt_text (optional) - the prompt. It's optional in the schema, but an empty prompt produces an empty conditioning, so don't get clever.

Outputs: conditioning (into your sampler), prompt_text (passthrough - handy for fanning the same string to a second encoder without a convert-to-input dance), and summary_json.

Who this is for

If you're running the MKRShift ecosystem, the bookmark integration is the reason to reach for this instead of stock CLIP Text Encode - it's a search alias for "prompt bookmark writer," and it's how saved prompts get re-encoded. If you're not using the pack's bookmarks, it's still a perfectly good drop-in CLIP Text Encode that costs you nothing extra, and the token estimate genuinely helps when you're balancing a long prompt. It's not flashy, and it shouldn't be - a prompt encoder is plumbing, and this one does its job and tells you a useful number on the way out. There's no community drama to report, because there's no community chatter about this node at all; it just works.

CategoryMKRShift Nodes/Core/Prompt

Inputs (2)

NameTypeDefaultDescription
clipCLIP
prompt_textoptSTRING

Outputs (3)

NameTypeDescription
conditioningCONDITIONING
prompt_textSTRING
summary_jsonSTRING