ComfyUI Node

ScribblePad

Keep five prompt variants in one box, toggle them with Ctrl+/

By mrmrgty·Created 7 months ago·Updated 7 months ago· 0
ScribblePad
    • cleaned_text
    • char_count
    • token_estimate
    text
    comment_prefix//
    comment_modeloose
    token_modelight

    ScribblePad is a text node that treats your prompt like a scratch file. You write into it, comment lines in and out, and it hands the cleaned result to the rest of the graph. The hook is the workflow it unlocks: keep three or four versions of a prompt in one box and flip between them with Ctrl+/ (or Cmd+/ on a Mac), instead of building a separate CLIP Text Encode node for every variant and muting the ones you're not using.

    That's the whole point. Prompt iteration is where ComfyUI is at its clunkiest - every CLIP Text Encode widget is a one-shot text box, so A/B testing a concept means either editing a string you'll want back or littering the canvas with duplicate nodes. ScribblePad makes the prompt a living document: // blonde hair, // red dress, queue, glance at the result, toggle one line, queue again. The author calls it "a small workbench to organize prompts safely," and that's a fair read - it's somewhere between a notes app and a linter for your prompt, weighted toward "get out of the way."

    How it works

    Mechanically it's dead simple, and that's the appeal. The node splits your text into lines and drops any line whose prefix matches comment_prefix - the rest is joined back together untouched. In loose mode (the default) it ignores leading whitespace, so an indented // nope still counts as a comment; strict requires the line to literally start with the prefix. Empty lines are preserved, and the author is explicit about why: the tool never silently drops content you didn't mean to comment out. No model files, no Python dependencies beyond the standard library - this is one of the lightest custom nodes you'll install.

    The fancy editor is CodeMirror 6, but it's not bundled. It loads from the esm.sh CDN (with a jsDelivr fallback) when the node opens, so the smooth editing, dimmed comment lines, and preset panel assume you have internet. If it can't load, you get a plain textarea that still does the comment toggle, so the node never breaks - you just lose the polish.

    Inputs and outputs that matter

    You'll touch exactly four inputs, and really only two of them:

    • text - the multiline buffer you live in. This is the whole product.
    • comment_prefix - the marker, // by default, with #, ;, --, and % as alternatives. Pick one that won't collide with your actual prompt text.
    • comment_mode - loose (default) vs strict.
    • token_mode - light (a fast regex count) vs exact (uses tiktoken if it's installed, falls back to light automatically).

    Outputs: cleaned_text (STRING) is the one that matters - wire it into your CLIP Text Encode or wherever your conditioning starts. char_count and token_estimate are INTs, handy if you're feeding them into a text display or a control node.

    One honest caveat on token_estimate: "exact" uses tiktoken's cl100k_base, which is the GPT-4 tokenizer - not your model's text encoder. It'll get you in the ballpark, and it's a decent "am I writing an essay" sanity check (prompt drift starts creeping in around 75–100 effective tokens even on the new LLM encoders), but don't treat the number as ground truth for any specific model's tokenizer.

    Installing it

    Via ComfyUI Manager, search for "ScribblePad" (pack title: ComfyUI-ScribblePad). Or the manual route:

    cd ComfyUI/custom_nodes
    git clone https://github.com/mrmrgty/ComfyUI-ScribblePad.git ComfyUI_ScribblePad
    

    Then restart ComfyUI. That's it - there's no requirements.txt, no model download, nothing heavy to babysit.

    Common gotchas

    • Presets live inside the pack folder, at custom_nodes/ComfyUI_ScribblePad/user_data/presets.json - deliberately a fixed path, not ComfyUI's user dir. A git pull update won't touch them, but deleting the folder to reinstall wipes your saved prompts. Copy that file out before you nuke anything.
    • The CDN dependency. Air-gapped or flaky network, and you get the plain-textarea fallback. Still functional, just less pretty.
    • Preset saves can fail for reasons you'll see in the error: names are capped at 64 characters, /, \, and .. are rejected, and text is capped at 100 KB - the last one is so generous you'll never hit it with a prompt.
    • The prefix is global, not smart. Paste in a prompt that already uses # while your prefix is // and nothing gets commented. Pick a prefix that isn't already in your text.

    Is this a must-install? No - if you don't iterate on prompts constantly, core CLIP Text Encode is fine and you've already got it. But if A/B testing phrases is half your workflow, this is the rare utility node that earns its place on the canvas. Small, honest about its limits, and it stays out of your way.

    CategoryUtils/Text

    Inputs (4)

    NameTypeDefaultDescription
    textSTRING
    comment_prefixCOMBO//5 options: //, #, ;, --, %
    comment_modeCOMBOloose2 options: loose, strict
    token_modeCOMBOlight2 options: light, exact

    Outputs (3)

    NameTypeDescription
    cleaned_textSTRING
    char_countINT
    token_estimateINT