ComfyUI Node

Text Reorder

Same words, shuffled order — the cheap way to explore prompt variation

By CorvaeOboro·Created 8 months ago·Updated 6 days ago· 1
Text Reorder
    • reordered_text
    • section_info
    text
    reorder_modecomma
    seed0
    completely_randomtrue
    distance_constrainedfalse
    max_distance2

    Prompt order matters more than most people admit. Early tags carry more weight with the CLIP encoders behind SDXL-lineage models, so queen, castle, sunset and sunset, castle, queen are not the same image. Text Reorder, from the illumorae pack (CorvaeOboro's randomization toolkit), exploits exactly that: it shuffles the sections of your prompt - by comma, by sentence, or by paragraph - while keeping parenthesis-enclosed blocks (including <lora:...> tags) glued together. The result is variation without new words, ideal for batch exploration when you've already nailed the vocabulary and want to know how order changes the picture.

    This is the pack's stated purpose in miniature: "randomization and image variant exploration." Instead of rolling new seeds and hoping, you get a different reading of the same prompt, which often produces a much wider spread of compositions than a seed change alone.

    How it works

    The node splits your text on the delimiter for the mode you picked - comma, sentence, or paragraph - but it scans ahead so any parenthesized or braced block stays intact as one unit. No orphaned (fruit:1.3) pieces, no lora tags chopped in half. Then it reorders in one of two ways:

    • completely_random (default on) - a seeded full shuffle. Same seed, same order, every run.
    • distance_constrained - each section can only move up to max_distance positions from where it started, so the shuffle is gentle and the prompt keeps roughly its original shape. Good when you want some order sensitivity without losing the sentence's sense.

    The seed input drives both, so you can step through variations deterministically. It also returns section_info - a string describing how many sections it found and what it did with them - which is how you verify the split worked the way you expected.

    Inputs and outputs that matter

    • text - the prompt (multiline).
    • reorder_mode - comma (default), sentence, or paragraph. Commas are the right first choice for tag-style prompts.
    • completely_random / distance_constrained / max_distance - the shuffle personality. Only one of the first two should be on.
    • seed - for reproducible shuffles.

    Outputs: reordered_text (wire this to your CLIP text encode) and section_info.

    Installing it

    ComfyUI Manager → search "illumorae" → install, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/CorvaeOboro/ComfyUI_illumorae
    

    Restart. No models, no extra deps.

    Troubleshooting

    One honest caveat grounded in the KB: on the LLM-encoded 2026 models (Flux, Z-Image, Anima) prompt order is less of a lever than it is on SDXL-lineage models, and (word:1.3) weights get discarded anyway - so this node is at its most useful for Illustrious/NoobAI/Pony-style prompting. If an unknown mode ever sneaks in, the node clamps to comma and prints a warning rather than failing. And remember: reordering changes emphasis, it doesn't fix a weak prompt - garbage in, shuffled garbage out.

    Categoryillumorae

    Inputs (6)

    NameTypeDefaultDescription
    textSTRING
    reorder_modeCOMBOcomma3 options: paragraph, sentence, comma
    seedINT00–18446744073709550000
    completely_randomBOOLEANtrue
    distance_constrainedBOOLEANfalse
    max_distanceINT21–20

    Outputs (2)

    NameTypeDescription
    reordered_textSTRING
    section_infoSTRING