Nodes/comfyui-kisekae/๐Ÿ‘˜ Kisekae Debug Prompt
ComfyUI Node

๐Ÿ‘˜ Kisekae Debug Prompt

Read the prompt before you spend the render

By KagejitsuยทCreated 11 days agoยทUpdated 10 days agoยท 0
๐Ÿ‘˜ Kisekae Debug Prompt
  • char
  • clip
  • char
  • text
โ—„templateโ–พโ–บ
โ—„template_textโ–บ
โ—„escape_parenstrueโ–บ
โ—„dedupetrueโ–บ
โ—„include_triggerstrueโ–บ

You've built a chain of six nodes and you're about to find out what it renders by waiting forty seconds for a 2B model at 40 steps. That's an expensive way to discover a placeholder isn't in your template.

๐Ÿ‘˜ Kisekae Debug Prompt renders the character exactly as Kisekae Prompt would, then shows you the report instead of the wire: positive, negative, a per-placeholder breakdown, what got deduped, what got escaped, LoRA status, and a token count.

How it works

It shares its render code with the Prompt node - same template parsing, same escaping, same dedupe, same negative-conflict dropping - so what you see here is what the sampler will see. It takes the character, renders it, then formats a report:

  • POSITIVE / NEGATIVE - the finished strings.
  • PLACEHOLDERS - each placeholder in your template and the items it produced, aligned in a column. This is the fastest way to find out that {scene.lighting} is empty because nobody set lighting, rather than misrendered.
  • DUPLICATES REMOVED - exact repeats that dedupe collapsed.
  • BRACKETS ESCAPED - tag โ†’ escaped tag pairs, so menacing (jojo) โ†’ menacing \(jojo\) is visible rather than mysterious.
  • NEGATIVES DROPPED (also in positive) - negatives that would have fought a positive tag. Worth a glance: it can quietly swallow a negative you meant to keep.
  • LORAS - each LoRA with its section, strengths and resolution status: found, found-elsewhere (โœ“ โ†’ path), ambiguous (โš  3 files match), or โœ— NOT FOUND - left out of the stack.
  • TRIGGERS - the joined trigger words.

Then token counts. With nothing on the clip input you get a rough estimate - words plus punctuation, definitely not a real tokenizer - and the node says so. Connect your actual CLIP (the same one you feed your text encode nodes) and it walks the tokenizers inside it, giving you an exact count per encoder: clip_l and clip_g on SDXL-lineage checkpoints, qwen3_06b on Anima, t5xxl where relevant. For the CLIP pair it also does the arithmetic you'd otherwise do in your head - (n-2)/75 rounded up, i.e. how many 75-token chunks you're occupying. Escapes are stripped before counting, since the tokenizer sees ( not \(.

The inputs and outputs

char is required. template, template_text, escape_parens, dedupe, include_triggers behave identically to the Prompt node - non-empty template_text wins, all three booleans default on. clip is the only optional input, and it's purely for counting; it doesn't affect the rendered text.

Outputs: char (unchanged) and text (the whole report). The report is also shown in the node's display box, which is how most people read it.

Install

Bundled with the pack:

cd ComfyUI/custom_nodes
git clone https://github.com/Kagejitsu/comfyui-kisekae

Or ComfyUI Manager โ†’ search kisekae (Registry: comfyui-kisekae). Restart. No Python dependencies - token counting uses whatever tokenizers ComfyUI already has loaded, so nothing extra to install and it degrades gracefully (skipping an encoder it can't introspect rather than failing the run).

Common issues

"โ‰ˆ N tokens (rough estimate)" and I connected a CLIP. The counts come from the tokenizer objects attached to the CLIP you wired. If you connected a CLIP that hasn't loaded yet, or a custom encoder wrapper without standard tokenizers, it falls back. Wire the same CLIP your encoder nodes use.

Token count is higher than I expected. On SDXL-lineage models you care about the 75-token chunks: two chunks is 150, three is 225, and your pretty prose is a rounding error against an outfit paragraph. On Anima the number is less of a hard limit and more of a budget signal, but it still tells you when a preset is bloated.

A LoRA shows โœ—. The preset's name is a path inside your loras folder. If the file moved, a uniquely-named match elsewhere is substituted; two candidates produce a โš  and the first is used. Exact paths beat guessing.

Where's the prompt going? Nowhere - this node has no positive output on purpose. Use Kisekae Prompt for the real thing; use this for reading. If you want the string in a log, wire text.

Categorykisekae

Inputs (7)

NameTypeDefaultDescription
charKISEKAE_CHARโ€”
templateCOMBOPrompt layout. Add your own .txt files in user/default/kisekae/templates/
template_textSTRINGโ€”
escape_parensBOOLEANtrueEscape brackets inside tags, e.g. menacing \(jojo\), so ComfyUI doesn't read them as emphasis. (tag:1.2) weights are kept.
dedupeBOOLEANtrueRemove exact repeated tags (first one kept)
include_triggersBOOLEANtrueFill {triggers} with LoRA trigger words
clipoptCLIPOptional: connect your text encoder for exact token counts

Outputs (2)

NameTypeDescription
charKISEKAE_CHARโ€”
textSTRINGโ€”