Nodes/ComfyUI-PromptWrapper/Randoms Weight Prompt
ComfyUI Node

Randoms Weight Prompt

The weighted slot machine that writes your prompt for you

By clouddreamfly·Created about a year ago·Updated 8 months ago· 4
Randoms Weight Prompt
    • text
    languageChinese
    classify1--
    classify1_weight1.00
    classify2--
    classify2_weight1.00
    classify3--
    classify3_weight1.00
    classify4--
    classify4_weight1.00
    classify5--
    classify5_weight1.00
    classify6--
    classify6_weight1.00
    classify7--
    classify7_weight1.00
    classify8--
    classify8_weight1.00
    seed0
    enabletrue
    input_prompt

    The weighted slot machine for your prompt

    "Randoms Weight Prompt" sounds like it does something complicated. It doesn't. You pick up to eight prompt categories - background, action, clothes, expression, take your pick from 112 of them - and the node rolls a random entry from each category's library, then stitches everything into a ready-to-use prompt. The "Weight" is the part that earns it the name: every slot has a weight slider, so you can decide that the background matters more than the teeth without hand-typing a single set of parentheses.

    It lives in clouddreamfly's ComfyUI-PromptWrapper pack, a Chinese-built prompt toolkit whose README is almost entirely about downloading translation models. Don't let that scare you off. This node - like its scenery sibling in the same pack - wants none of those models. Everything it reads ships inside the repo.

    How it works

    The mechanism is embarrassingly simple, and that's a compliment. The pack bundles one JSONL file per category, in Chinese and English (the action library alone has 529 entries; scenery has 6,000+). Pick a category and the node opens the matching file and grabs line seed % total_lines. Same seed, same category, same pick - every time. Bump the seed and every slot rolls fresh. Each of the eight slots runs on that same seed but against a different file, so you get variety without any randomness you can't reproduce.

    Weights are applied in the syntax ComfyUI already speaks: 1.0 drops the tag in plain, anything else wraps it as (tag:1.35). That's stock CLIP attention weighting, and it's exactly where the "know your checkpoint" caveat below lands.

    The inputs that matter

    • classify1–classify8 - eight dropdowns, 113 options each (112 categories plus -- for "skip this slot"). The categories are booru-flavored: action, age, animal ears, background, clothes, expression, weapon, and a hundred more.
    • classify1_weight–classify8_weight - sliders from 0 to 2, step 0.05, default 1. The reason to use this node instead of the plain Randoms Prompt next to it. Background at 1.3, teeth at 0.7, and the sampler does the arguing for you.
    • seed - drives every pick. This is your variation knob, period.
    • enable - master switch; off means the node only passes through your own text.
    • language - Chinese or English; picks which bundled dictionary to draw from.
    • input_prompt (optional) - a string you can wire in from another node; it's prepended to whatever gets generated.

    The output is a single text string, comma-joined, ready to plug straight into a CLIP Text Encode (positive) node.

    Where people get burned

    The weight syntax only does anything on CLIP-based checkpoints - SDXL, Illustrious, NoobAI, Pony, that lineage. On LLM-encoded models like Anima, Z-Image or Flux 2 Klein, (tag:1.3) isn't honored; the encoder just reads the parentheses and colons as literal characters inside your instruction, which is worse than nothing. Running one of those? Set every weight to 1.0 and let the categories do the work. And even on CLIP models, the sensible range is about 0.5–1.5: above 1.5 you get oversaturation, below 0.5 the concept barely registers.

    Also, when you're debugging an output you don't like, fix the seed. Randomizing the seed and three category slots at once tells you nothing about which change mattered.

    Install

    ComfyUI Manager, search "ComfyUI-PromptWrapper", install, restart. Or the manual route:

    cd ComfyUI/custom_nodes
    git clone https://github.com/clouddreamfly/ComfyUI-PromptWrapper
    

    Then restart ComfyUI. No pip dependencies, no model downloads for this node - the data is bundled in the repo. If the pack's translation nodes later complain about missing models, ignore it; you're not using them.

    CategoryPromptWrapper

    Inputs (20)

    NameTypeDefaultDescription
    languageCOMBOChinese2 options: Chinese, English
    classify1COMBO--113 options: --, action, age, animal, animal ears, animal horn, +107
    classify1_weightFLOAT1.000–2
    classify2COMBO--113 options: --, action, age, animal, animal ears, animal horn, +107
    classify2_weightFLOAT1.000–2
    classify3COMBO--113 options: --, action, age, animal, animal ears, animal horn, +107
    classify3_weightFLOAT1.000–2
    classify4COMBO--113 options: --, action, age, animal, animal ears, animal horn, +107
    classify4_weightFLOAT1.000–2
    classify5COMBO--113 options: --, action, age, animal, animal ears, animal horn, +107
    classify5_weightFLOAT1.000–2
    classify6COMBO--113 options: --, action, age, animal, animal ears, animal horn, +107
    classify6_weightFLOAT1.000–2
    classify7COMBO--113 options: --, action, age, animal, animal ears, animal horn, +107
    classify7_weightFLOAT1.000–2
    classify8COMBO--113 options: --, action, age, animal, animal ears, animal horn, +107
    classify8_weightFLOAT1.000–2
    seedINT00–18446744073709550000
    enableBOOLEANtrue
    input_promptoptSTRING

    Outputs (1)

    NameTypeDescription
    textSTRING