Nodes/Prompt PostProcessor/ACB PPP Cleanup Options
ComfyUI Node

ACB PPP Cleanup Options

Kill the double commas and dead parentheses

By acorderob·Created 3 years ago·Updated 17 days ago· 54
ACB PPP Cleanup Options
    • options
    extra_spacestrue
    empty_constructstrue
    extra_separatorstrue
    extra_separators_additionaltrue
    extra_separators_include_eolfalse
    around_breaksfalse
    breaks_with_eolfalse
    around_andsfalse
    ands_with_eolfalse
    around_extranetwork_tagsfalse
    merge_attentiontrue
    remove_extranetwork_tagsfalse

    Once Prompt PostProcessor has rolled your wildcards, evaluated your conditions and relocated your negatives, the leftover text can look like someone sneezed on a keyboard: , , in the middle of nowhere, an empty () where a conditional branch returned nothing, a BREAK doing nothing. The ACB PPP Cleanup Options node is the settings panel for that tidy-up pass. It emits an options object you feed into the cup_options input of ACB Prompt Post Processor - and like the other options nodes, you only need it when the defaults aren't cutting it.

    The switches that matter

    It's a flat list of booleans, all on/off, and most defaults are sensible. The ones a beginner actually touches:

    • extra_spaces (on) - collapse doubled-up whitespace.
    • empty_constructs (on) - delete attention/scheduling/alternation constructs that ended up empty after processing (e.g. ( ) or []).
    • extra_separators (on) and extra_separators_additional (on) - strip repeated commas and separators, including leading/trailing ones at line ends.
    • merge_attention (on) - the clever one. Merges nested attention weights into a single construct, multiplying the values: ((word:1.2):0.9) collapses toward a clean (word:1.08). This is the option that makes send-to-negative output read cleanly.
    • remove_extranetwork_tags (off) - if you ever want to strip every <lora:...> tag out of the result, this is the nuclear button.

    The rest are refinements - extra_separators_include_eol, around_breaks / breaks_with_eol, around_ands / ands_with_eol, around_extranetwork_tags. One honest warning: BREAK and AND aren't natively supported by ComfyUI, so those options only do anything if you're using a text-encoder node that implements them and you've configured the pack to allow them. On stock ComfyUI they're dead switches.

    Wiring it up

    Drop the node, flip what you need, connect optionscup_options on the main node:

    [ ACB PPP Cleanup Options ] --options--> [ ACB Prompt Post Processor ].cup_options
    

    The cleanup also has a companion toggle on the main node itself: do_cleanup turns the whole pass on or off, and cleanup_variables cleans the output variable values too.

    Install

    Same pack as everything else. ComfyUI Manager → search "Prompt PostProcessor", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/acorderob/sd-webui-prompt-postprocessor
    

    Restart ComfyUI. No model downloads; requirements are lark, numpy, ruamel.yaml, pydantic. MIT, actively maintained.

    Common issues

    The usual gotcha is being too aggressive. remove_extranetwork_tags on will silently delete every LoRA from the final prompt - great for experiments, a nasty surprise if you forgot it was on. And if your prompts have meaningful commas (tag-style booru prompts are comma soup by design), extra_separators combined with extra_separators_additional can over-prune; when in doubt, leave additional off and check the processed output in a Preview Text node before blaming the model for missing tags.

    CategoryACB

    Inputs (12)

    NameTypeDefaultDescription
    extra_spacesoptBOOLEANtrueRemove extra spaces
    empty_constructsoptBOOLEANtrueRemove empty constructs
    extra_separatorsoptBOOLEANtrueRemove extra separators
    extra_separators_additionaloptBOOLEANtrueRemove extra separators (additional cases)
    extra_separators_include_eoloptBOOLEANfalseExtra separators options also remove EOLs
    around_breaksoptBOOLEANfalseCleanup around BREAKs
    breaks_with_eoloptBOOLEANfalseSet BREAKs in their own line
    around_andsoptBOOLEANfalseCleanup around ANDs
    ands_with_eoloptBOOLEANfalseSet ANDs in their own line
    around_extranetwork_tagsoptBOOLEANfalseClean up around extra network tags
    merge_attentionoptBOOLEANtrueMerge nested attention constructs
    remove_extranetwork_tagsoptBOOLEANfalseRemove extra network tags

    Outputs (1)

    NameTypeDescription
    optionsPPP_OPTIONS_CUP