Nodes/ComfyUI_BadgerTools/NovelToFizz-badger
ComfyUI Node

NovelToFizz-badger

The 'Fizz' formatter for long texts (if your copy actually has it)

By AbyssBadger0·Created 3 years ago·Updated 2 years ago· 8
NovelToFizz-badger
    • STRING
    • INT
    text

    First, an honest heads-up: NovelToFizz-badger is registered in the ComfyUI registry, but as of this writing it's not in the pack's shipped source. I cloned the repo, grepped every file, checked the git history and the open pull requests - nothing. So after a fresh install you may open the node menu and simply not find it. If that happens, you're not going crazy; it's the pack's own documentation lagging its registry listing. Everything below is what the node is supposed to do, based on its schema and its clearly-related sibling StringToFizz-badger.

    So what's "Fizz"? Look at StringToFizz, which is in the source, and the picture snaps into focus. That node takes a multiline text, splits it on newlines, and reformats each non-empty line into an indexed "key":"value" pair - producing output like:

    "0":"line one",
    "1":"line two",
    "2":"line three"
    

    A JSON-object body without the opening and closing braces, plus the total line count as a second output. That's the Fizz format: a compact, index-keyed text blob you can hand to something that wants numbered entries.

    NovelToFizz is the same operation aimed at longer input - a "novel", as the name says (the author's README is in Chinese; this is a personal toolbox published with minimal documentation). Its schema is identical to StringToFizz: one text input (multiline STRING) in, two outputs out - a STRING (the indexed Fizz text) and an INT (the line count).

    Where would you actually use this? If you're feeding prompt variations, subtitle lines, or any list of strings into a tool that consumes keyed text - or into an automation layer that wants to know how many entries it just got. The INT output doubles as a loop bound, so you can iterate over the entries downstream without counting them by hand.

    Two caveats beyond the "may not exist yet" thing. The output is almost JSON but not valid JSON - there are no outer braces, and if a line contains a double quote it won't be escaped, which will break any strict parser. If you genuinely need JSON, wrap the output in braces yourself and cross your fingers on quoting. And remember the format only includes non-empty lines, so the line count and your original line count can differ.

    Installation is standard regardless:

    cd ComfyUI/custom_nodes
    git clone https://github.com/AbyssYuan0/ComfyUI_BadgerTools
    

    or search ComfyUI_BadgerTools in ComfyUI Manager, then restart. If the node shows up for you, great - treat it as StringToFizz with a longer-text name. If it doesn't, StringToFizz-badger does the same job and is actually guaranteed to be on your machine.

    Categorybadger

    Inputs (1)

    NameTypeDefaultDescription
    textSTRING

    Outputs (2)

    NameTypeDescription
    STRINGSTRING
    INTINT