Nodes/CRT-Nodes/String Splitter (CRT)
ComfyUI Node

String Splitter (CRT)

Turn one block of text into the shots of your video

By PGCRT·Created 2 years ago·Updated a day ago· 132
String Splitter (CRT)
    • string_1
    • string_2
    • string_3
    • string_4
    • string_5
    • string_6
    • string_7
    • string_8
    • string_9
    • string_10
    • string_11
    • string_12
    • string_13
    • string_14
    • string_15
    • string_16
    • string_17
    • string_18
    • string_19
    • string_20
    • string_21
    • string_22
    • string_23
    • string_24
    • string_25
    • string_26
    • string_27
    • string_28
    • string_29
    • string_30
    • string_31
    • string_32
    • string_33
    • string_34
    • string_35
    • string_36
    • string_37
    • string_38
    • string_39
    • string_40
    • string_41
    • string_42
    • string_43
    • string_44
    • string_45
    • string_46
    • string_47
    • string_48
    • string_49
    • string_50
    • string_51
    • string_52
    • string_53
    • string_54
    • string_55
    • string_56
    • string_57
    • string_58
    • string_59
    • string_60
    • string_61
    • string_62
    • string_63
    • string_64
    textParagraph 1... Paragraph 2...
    split_count2
    split_symbol
    strip_whitespacetrue

    Storyboard-style workflows are built on a simple idea: write all your shot descriptions in one text box, one paragraph each, and feed each paragraph to its own generation. The boring-but-essential step in the middle is splitting that blob of text into discrete strings you can route to different samplers or conditioning. That's this node. It splits a single multiline string into up to 64 separate STRING outputs, either on blank lines or on a custom separator you provide.

    It looks intimidating because the node always shows a wall of outputs - string_1 through string_64. Don't panic. You only use the ones you set, and a split_count widget controls how many are active.

    How it works

    Default behavior: it splits your text on empty lines (one or more blank lines act as the boundary), so each paragraph becomes its own output. If you set split_symbol to something like --- or |, it splits on that instead - handy when your paragraphs themselves contain blank lines for formatting.

    Two behavioral details are worth internalizing:

    • strip_whitespace (default on) trims each part so you don't get stray newlines gumming up your prompts.
    • Empty parts are dropped entirely. Split by blank lines, and two blank lines in a row won't hand you an empty string - the parts are compacted.

    The split_count input (1–64) says how many of those outputs you're actually using, which also keeps unused outputs from carrying stale values from a previous run.

    Inputs and outputs

    • text - the blob to split (multiline).
    • split_count - how many outputs are active.
    • split_symbol - custom separator; empty = split on blank lines.
    • strip_whitespace - clean up each part.

    Outputs are string_1 through string_64, each a STRING. Feed the first few into your prompt encoders and leave the rest unconnected.

    Installing it

    CRT-Nodes install as usual: ComfyUI Manager → CRT-Nodes, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/PGCRT/CRT-Nodes.git
    pip install -r requirements.txt
    

    Restart; it's under CRT/Text.

    Where people get burned

    The numbering is the trap. Because empty parts are dropped, part N of your input is not guaranteed to be output string_N - a leading blank line or a double blank line shifts everything by one, and if you've hardwired paragraph three to string_3 you'll silently get paragraph two. If your outputs are misaligned, count your blank lines. Also, keep split_count honest: it's easy to leave it at 2 while you've written five paragraphs and wonder why three are missing - bump it and reconnect.

    CategoryCRT/Text

    Inputs (4)

    NameTypeDefaultDescription
    textSTRINGParagraph 1... Paragraph 2...
    split_countINT21–64
    split_symbolSTRINGA custom character or string to split by. If empty, splits by empty lines.
    strip_whitespaceBOOLEANtrueRemove leading/trailing whitespace from each split part

    Outputs (64)

    NameTypeDescription
    string_1STRING
    string_2STRING
    string_3STRING
    string_4STRING
    string_5STRING
    string_6STRING
    string_7STRING
    string_8STRING
    string_9STRING
    string_10STRING
    string_11STRING
    string_12STRING
    string_13STRING
    string_14STRING
    string_15STRING
    string_16STRING
    string_17STRING
    string_18STRING
    string_19STRING
    string_20STRING
    string_21STRING
    string_22STRING
    string_23STRING
    string_24STRING
    string_25STRING
    string_26STRING
    string_27STRING
    string_28STRING
    string_29STRING
    string_30STRING
    string_31STRING
    string_32STRING
    string_33STRING
    string_34STRING
    string_35STRING
    string_36STRING
    string_37STRING
    string_38STRING
    string_39STRING
    string_40STRING
    string_41STRING
    string_42STRING
    string_43STRING
    string_44STRING
    string_45STRING
    string_46STRING
    string_47STRING
    string_48STRING
    string_49STRING
    string_50STRING
    string_51STRING
    string_52STRING
    string_53STRING
    string_54STRING
    string_55STRING
    string_56STRING
    string_57STRING
    string_58STRING
    string_59STRING
    string_60STRING
    string_61STRING
    string_62STRING
    string_63STRING
    string_64STRING