ComfyUI Node

Is Text In Text (Soze)

A plain substring check that returns true/false

By SozeInc·Created 2 years ago·Updated 3 months ago· 10
Is Text In Text (Soze)
    • BOOLEAN
    find_text
    search_text
    case_sensitivefalse

    The display name - "Is Text In Text" - is more honest about what this does than the class name, and it's what you'll actually see if you search for it in the node menu. It answers one question: does find_text appear anywhere inside search_text? Returns a plain BOOLEAN.

    How it works

    By default the check is case-insensitive, so "Cat" and "cat" are treated the same. Flip case_sensitive on if you need an exact-case match - useful when you're checking for something like an exact trigger word where capitalization actually matters.

    The inputs and output that matter

    • find_text - the substring you're looking for.
    • search_text - the text to search within.
    • case_sensitive (optional, off by default) - require exact-case matching.

    Output is a single BOOLEAN, ready to feed into a Switch or any conditional gate elsewhere in your graph - for instance, only applying a particular LoRA or negative-prompt block if the user's prompt mentions a specific subject.

    Where it fits

    This is the simplest possible way to make a workflow branch on prompt content without hand-parsing text. Say you want to automatically strengthen a portrait-focused LoRA whenever the word "portrait" shows up in the prompt, but leave it out otherwise - wire your prompt string into search_text, "portrait" into find_text, and route the resulting BOOLEAN into a Switch that picks between two LoRA strength values (or two LoRA loaders entirely). No manual toggling required; the graph reads the prompt and decides for itself.

    Installing it

    ComfyUI Manager: search ComfyUI_Soze. Manual: cd ComfyUI/custom_nodes && git clone https://github.com/SozeInc/ComfyUI_Soze.git, pip install -r ComfyUI_Soze/requirements.txt, restart. Pure string handling, nothing else needed.

    Common issues

    The one real trap here is the field naming: find_text and search_text look symmetric enough that it's easy to swap them by accident - you're checking whether find_text is inside search_text, not the reverse. If your check always comes back False and you're confident the word is there, that's the first thing to verify. Beyond that, remember this is a substring check, not a whole-word match - searching for "cat" inside "concatenate" will return True, which is occasionally surprising the first time you hit it.

    If you need a yes/no answer plus a specific value depending on which way it goes - not just a bare boolean to gate a Switch - this pack's Text Contains (Return String) does the same substring check but hands back one of two strings you choose instead of True/False. Reach for this node when a Switch downstream is exactly what you want; reach for its sibling when you'd otherwise need a Switch feeding two hardcoded string nodes just to get a value out.

    Categorystrings

    Inputs (3)

    NameTypeDefaultDescription
    find_textSTRING
    search_textSTRING
    case_sensitiveoptBOOLEANfalse

    Outputs (1)

    NameTypeDescription
    BOOLEANBOOLEAN