Nodes/AUN ComfyUI Nodes/Text Index Switch 5 Diffusers
ComfyUI Node

Text Index Switch 5 Diffusers

The diffusers prompt switch with a file picker built into the editor

By loz2754·Created 7 months ago·Updated about 8 hours ago· 5
Text Index Switch 5 Diffusers
    • text
    • label
    • index
    • diffusion_name
    • clip_name
    • vae_name
    • clip_type
    • sampler
    • scheduler
    • cfg
    • steps
    • seed
    minimum1
    maximum10
    modeSelect
    index1
    slot_count2
    range1,2,5-8,12
    text1Slot 1
    text2Slot 2
    text3Slot 3
    text4Slot 4
    text5Slot 5
    text6Slot 6
    text7Slot 7
    text8Slot 8
    text9Slot 9
    text10Slot 10
    text11Slot 11
    text12Slot 12
    text13Slot 13
    text14Slot 14
    text15Slot 15
    text16Slot 16
    text17Slot 17
    text18Slot 18
    text19Slot 19
    text20Slot 20

    If you're running a standalone diffusion UNet - the "diffusers-style" setup where the UNet, CLIP and VAE are separate files instead of one bundled checkpoint - you've already met the annoyance: every prompt change wants its own model combo, and typing exact filenames into key=value text by hand is how mistakes happen. AUNTextIndexSwitch5Diffusers is the Text Index Switch 5 tailored for exactly that world. Same up-to-20-slot switching, same Select/Increment/Random/Range modes, but the tokens it recognizes are the diffusers ones: diffusion_name, clip_name, vae_name, clip_type, plus sampler, scheduler, cfg, steps, seed.

    So a slot can read:

    diffusion_name=sd_xl_base_1.0.safetensors clip_name=clip_l.safetensors clip_type=stable_diffusion sampler=euler scheduler=normal cfg=7 steps=28
    A neon-lit street at night
    

    and you get "A neon-lit street at night" as the clean text output, while each of those tokens comes out on its own typed socket - diffusion_name, clip_name, vae_name and clip_type as STRINGs, cfg as FLOAT, steps and seed as INTs. Tokens on the list are stripped from the text output; anything else is left untouched. Absent tokens fall back to defaults (cfg 2.0, steps 10, seed 0, empty strings for the names).

    The genuinely nice addition here is the editor popup. Double-click a text slot and you get dropdown selectors for the diffusion model, CLIP, VAE, and CLIP type - populated from your installed file lists - so you insert diffusion_name=... by picking from a list instead of hand-typing filenames that are easy to fat-finger. That single feature is why this node exists rather than just "use TextIndexSwitch5 and add tokens".

    Inputs are the standard switch set (minimum, maximum, mode, index, slot_count, range, text1text20); outputs are text, label, index, and the nine extracted values. The label comes from the connected node title, a custom label, or the first line of text.

    One honest caveat: these outputs are strings (file names, clip type), not loaded models. The node picks the recipe; something else has to load it. In practice that means wiring the string outputs into loader nodes that accept names - the AUN Inputs Diffusers family (AUNInputsDiffusers, AUNInputsDiffusersBasic) or diffusers-style loaders where you convert the widget to an input. Don't expect a MODEL socket to appear here.

    Install: ComfyUI Manager (search "AUN"), or cd ComfyUI/custom_nodes && git clone https://github.com/loz2754/AUN-ComfyUI-Nodes, restart. Missing piexif/cv2 after a manual install? pip install -r custom_nodes/AUN-ComfyUI-Nodes/requirements.txt.

    Troubleshooting:

    • The dropdowns in the editor look empty → the node reads your installed file lists at load; if files were added since, restart or reload the workflow.
    • A clip_type token that doesn't match your setup does nothing downstream → it's just a string; make sure the loader you feed it to interprets it.
    • Tokens vanishing from text is correct behavior - that's the whole trick; unknown keys stay.
    CategoryAUN Nodes/Prompts

    Inputs (26)

    NameTypeDefaultDescription
    minimumINT11–20The minimum index for selection (inclusive).
    maximumINT101–20The maximum index for selection (inclusive).
    modeCOMBOSelectSelect mode: Select for fixed index, Increment for cycling through range, Random for random index within range, Range for selecting from a list of indices.
    indexINT11–20Current or target index, constrained by slot_count).
    slot_countINT21–20Number of visible text slots.
    rangeSTRING1,2,5-8,12A comma-separated list of indices or ranges to select from in Range mode (e.g. 1, 2, 5-8, 12).
    text1STRINGSlot 1
    text2STRINGSlot 2
    text3STRINGSlot 3
    text4STRINGSlot 4
    text5STRINGSlot 5
    text6STRINGSlot 6
    text7STRINGSlot 7
    text8STRINGSlot 8
    text9STRINGSlot 9
    text10STRINGSlot 10
    text11STRINGSlot 11
    text12STRINGSlot 12
    text13STRINGSlot 13
    text14STRINGSlot 14
    text15STRINGSlot 15
    text16STRINGSlot 16
    text17STRINGSlot 17
    text18STRINGSlot 18
    text19STRINGSlot 19
    text20STRINGSlot 20

    Outputs (12)

    NameTypeDescription
    textSTRING
    labelSTRING
    indexINT
    diffusion_nameSTRING
    clip_nameSTRING
    vae_nameSTRING
    clip_typeSTRING
    samplerSTRING
    schedulerSTRING
    cfgFLOAT
    stepsINT
    seedINT