Nodes/ComfyUI-SKLoRA-Manager/SK Prompt Matrix Sampler V1
ComfyUI Node

SK Prompt Matrix Sampler V1

One line, one dimension, one pick per run

By sinvks·Created 8 months ago·Updated 3 months ago· 13
SK Prompt Matrix Sampler V1
    • string
    text_input
    pick_count0
    sort_modeSequential (顺序)
    input_sep|
    output_sep,
    seed0

    If you've ever set up a row of LoRA comparisons by hand-editing a prompt twenty times, this is the node that fixes the copy-paste. SK Prompt Matrix Sampler V1 takes a block of text where each line is a dimension and |-separated words inside a line are the options, then samples one option per line and joins them into a single prompt. The idea: encode your test grid once, then let the seed shuffle the variations for you.

    Read that as sampler, not matrix - that distinction matters. It returns one string per execution, not a fan-out of every combination like A1111's classic prompt matrix. The "matrix" is the space of possible prompts; each run draws one point from it. You drive the exploration by re-running with different seeds, which is honestly a better fit for LoRA comparison anyway: bake a couple of LoRA trigger phrases into the options, keep the seed, and every run is a deterministic candidate.

    How it works. It splits your text into non-empty lines, decides how many lines to use (pick_count, where 0 means all of them), then for each chosen line picks one option from the |-separated candidates. In Sequential mode it takes the first N lines in order and picks one word from each; in Random mode it draws N distinct lines and a random word from each. Every pick flows through a random.Random(seed), so the same seed reproduces the same prompt exactly.

    Inputs that matter. The defining one is text_input - it's a wired input (forceInput), so your matrix text comes from another node rather than a widget on this node. If you want the text typed directly on the node, that's what V2 is for. Then:

    • pick_count (default 0) - how many lines to sample; 0 = all, and anything over the line count gets capped to it.
    • sort_mode - Sequential (first N lines) or Random (distinct random lines).
    • input_sep (default |) - the per-line option separator.
    • output_sep (default , ) - how the picked words get joined.
    • seed - reproducibility. Change it, get a different draw.

    Output. A single string - the sampled prompt. Straight into a CLIPTextEncode.

    Installing. ComfyUI Manager (search "SK LoRA Manager") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/sinvks/ComfyUI-SKLora-Manager.git
    pip install -r requirements.txt
    

    Restart and it's live. No models, no extra downloads.

    Where people trip. Because text_input is a forced wire input, dropping the node and typing into it does nothing - you have to feed it from another text source. And don't expect a batch of images per run; you get one prompt, and you iterate by changing the seed. That's the design, and once you stop expecting the A1111 behavior it's a genuinely clean little node.

    Category🪄 SK LoRA Manager/Prompt

    Inputs (6)

    NameTypeDefaultDescription
    text_inputSTRING
    pick_countINT00–100选取的行/段数,默认为0,表示选取所有
    sort_modeCOMBOSequential (顺序)默认为Sequential(按行/段顺序组合),Random表示按随机顺序组合
    input_sepSTRING|输入文本的分隔符
    output_sepSTRING, 输出文本的分隔符
    seedINT00–18446744073709550000

    Outputs (1)

    NameTypeDescription
    stringSTRING