ComfyUI Node

SliderPrompt

SliderPrompt

By chenbaiyujason·Created 2 years ago·Updated 2 years ago· 0
SliderPrompt
    • POSITIVE_PROMPT_FORMATTER
    • NEGATIVE_PROMPT_FORMATTER
    pos_format_stringa {medium} of a {word} {subject}
    neg_format_stringa {medium} of a {word} {subject}

    Every time SliderLatent or SliderLatentPooled builds a sample prompt, it works from a format string. SliderPrompt is the box you edit that string in. It takes two template fields and hands them to the direction-finder as typed PROMPT_FORMATTER outputs, so you can reshape the whole direction search without touching Python.

    The two inputs are pos_format_string and neg_format_string, both defaulting to a {medium} of a {word} {subject}, and both multiline. The outputs - POSITIVE_PROMPT_FORMATTER and NEGATIVE_PROMPT_FORMATTER - plug into SliderLatent's optional positive_formatter and negative_formatter sockets. Mechanically it's trivial: the node wraps each string in a tiny formatter object, and the direction-finder calls str.format(medium=…, word=…, subject=…) on it every iteration. {word} is where target_word and opposite_word land.

    The placeholders are fixed

    This is the one thing that will silently waste your time. The template only understands three names: {medium}, {word}, and {subject}. Drop {word} and both the positive and negative samples encode the same text - which means the direction comes out as a zero vector and your slider does nothing, with no error to tell you why. Drop {medium} or {subject} and you lose the randomization that makes the average direction robust. If you want different phrasing, keep the three placeholders and rearrange the sentence around them - something like a {subject} {word}, {medium} is fine.

    One box each, on purpose

    The positive and negative templates default to being identical because the only difference that matters is which word gets plugged into {word} - the target on one side, the opposite on the other. The separate negative box exists for when you want structurally different sentences per side, not because they're expected to differ out of the box.

    Alongside SliderObjectIn, this is one of the two optional "shape the search" helpers in the pack, and like that node it's fully skippable - unwired, the direction-finder uses its own default template. It exists because the author wanted to tune phrasing and vocabulary without editing source, and honestly, for a pack this small that's the right call. Install is the pack standard: Manager → search "ComfyUI-CLIPSlider-SC", or clone https://github.com/chenbaiyujason/ComfyUI-CLIPSlider-SC into custom_nodes and restart. The README is inherited from the original RhizoNymph project and doesn't document this node at all, so the shipped workflow JSON is the real reference for how SliderPrompt feeds the two SliderLatent nodes.

    Categoryconditioning

    Inputs (2)

    NameTypeDefaultDescription
    pos_format_stringSTRINGa {medium} of a {word} {subject}
    neg_format_stringSTRINGa {medium} of a {word} {subject}

    Outputs (2)

    NameTypeDescription
    POSITIVE_PROMPT_FORMATTERPROMPT_FORMATTER
    NEGATIVE_PROMPT_FORMATTERPROMPT_FORMATTER