Nodes/zer0 Comfy Utilities/Prompt Minimizer And Splitter Node (zer0)
ComfyUI Node

Prompt Minimizer And Splitter Node (zer0)

A node that optimizes whitespace in a prompt and optionally chunks the prompt tag-wise by token count with a specified prompt separator.

By zer0thgear·Created 2 years ago·Updated 2 years ago· 1
Prompt Minimizer And Splitter Node (zer0)
    • Optimized Prompt
    • Chunked Prompt
    • Token Count (Unoptimized)
    • Token Count (Optimized)
    input_string
    encoding_typegpt-4o
    token_count75
    separator BREAK
    Categorytext utility

    Inputs (4)

    NameTypeDefaultDescription
    input_stringSTRING
    encoding_typeCOMBOgpt-4oThe encoding type to use for tokenization
    token_countoptINT75The maximum prompt length before needing to be broken
    separatoroptSTRING BREAK The separator to use when chunking the prompt

    Outputs (4)

    NameTypeDescription
    Optimized PromptSTRINGThe prompt after stripping whitespace
    Chunked PromptSTRINGThe prompt after stripping whitespace and splitting
    Token Count (Unoptimized)INTThe token count of the unoptimized prompt
    Token Count (Optimized)INTThe token count of the optimized prompt