Nodes/AUN ComfyUI Nodes/Inputs Basic + Prompt Switch
ComfyUI Node

Inputs Basic + Prompt Switch

One node that picks the prompt, loads the checkpoint, and sets the sampler

By loz2754·Created 7 months ago·Updated about 8 hours ago· 5
Inputs Basic + Prompt Switch
    • MODEL
    • CLIP
    • VAE
    • ckpt name
    • sampler
    • scheduler
    • cfg
    • steps
    • latent
    • width
    • height
    • seed
    • batch size
    • text
    • label
    • index
    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
    ckpt_name
    speed_lorafalse
    speed_lora_modelNone
    speed_lora_strength1.00
    clip_skip-1
    sampler
    scheduler
    cfg2.0
    steps10
    width720
    height720
    aspect_ratio
    aspect_modeOriginal
    batch_size1
    seed0
    megapixels1.0
    multiple8

    Normal workflow evolution in ComfyUI: you build a graph, then you add a text switch to cycle prompts, then you realize the prompts want different samplers and seeds, then you're wiring five nodes together just to make a list of presets work. AUNInputsBasicSwitch short-circuits all of that. It fuses a text index switch with the AUN Inputs Basic loader - pick one of up to 20 text slots and the node loads the checkpoint, the latent, and the sampler settings for you, with the switch's text driving the loader directly. No connection between them needed.

    The mechanism is where it gets genuinely nice. Each text slot is scanned for key=value tokens - model, sampler, scheduler, cfg, steps, seed. Found tokens override the matching loader widgets, and are then removed from the text that goes out the text output. So a slot can be:

    sdxl_base_v1.0.safetensors sampler=dpmpp_2m scheduler=karras cfg=4.5 steps=20 seed=42
    A masterpiece, highly detailed
    

    ...and the node loads that checkpoint with dpmpp_2m/karras at CFG 4.5, while the prompt you actually pass to CLIP Text Encode is just "A masterpiece, highly detailed". One slot, self-contained. Any token whose key isn't on the list is left alone in the text.

    Slot selection works like the AUN text switches: mode is Select (fixed index), Increment (step through minimummaximum each run), Random, or Range (from the range string, e.g. 1,2,5-8,12). slot_count controls how many of the 20 text slots show - hidden slots keep their values and stay selectable.

    The outputs are the full Inputs Basic contract: MODEL, CLIP, VAE, latent, plus ckpt name, sampler, scheduler, cfg, steps, width, height, seed, batch size as typed values you can wire into a KSampler - and the switch side: text, label, index. The inputs beyond the text slots are the loader widgets: ckpt_name, clip_skip (-1 is a good default), sampler/scheduler/cfg/steps/seed, and the latent sizing group (width, height, aspect_ratio, batch_size, megapixels, multiple). There's also speed_lora/speed_lora_model/speed_lora_strength if you run a model with a SpeedLoRA.

    Worth knowing: the model= token resolves case-insensitively against your installed checkpoints, and falls back to the ckpt_name widget if nothing matches. And this node has the AUN collapse-connections mode done right - its 13 param/loader outputs converge to a single point while text, label and index stay visible, so you keep prompt-switching at a glance and hide the plumbing.

    Install: ComfyUI Manager (search "AUN"), or cd ComfyUI/custom_nodes && git clone https://github.com/loz2754/AUN-ComfyUI-Nodes, restart. Manual installs that complain about missing piexif/cv2 need pip install -r custom_nodes/AUN-ComfyUI-Nodes/requirements.txt.

    Troubleshooting:

    • A model= token doesn't change the checkpoint → it doesn't match any installed file name; double-check spelling, then fall back to the widget.
    • Tokens vanishing from your prompt output is correct - that's the feature; anything not in the known list stays.
    • In dynamic modes (Increment/Random/Range) the node re-executes every run, so treat those as "roll a new preset" modes.
    CategoryAUN Nodes/Loaders+Inputs

    Inputs (43)

    NameTypeDefaultDescription
    minimumINT11–20Lowest text slot (1-20) that Increment and Random modes may select.
    maximumINT101–20Highest text slot (1-20) that Increment and Random modes may select.
    modeCOMBOSelectHow the active text slot is chosen. Select = use the Index widget; Increment = step through the range each run; Random = random slot within the range; Range = pick from the Range list.
    indexINT11–20The active text slot in Select mode - its text, label, and index are the outputs.
    slot_countINT21–20How many text slots are visible on the node. Hidden slots keep their values and remain selectable.
    rangeSTRING1,2,5-8,12In Range mode: comma-separated slots or ranges to pick from (e.g. 1, 2, 5-8, 12).
    text1STRINGSlot 1The text content for slot 1. Supports key=value tokens (model, sampler, scheduler, cfg, steps, seed) which are extracted and removed, overriding the matching loader widget values.
    text2STRINGSlot 2The text content for slot 2. Supports key=value tokens (model, sampler, scheduler, cfg, steps, seed) which are extracted and removed, overriding the matching loader widget values.
    text3STRINGSlot 3The text content for slot 3. Supports key=value tokens (model, sampler, scheduler, cfg, steps, seed) which are extracted and removed, overriding the matching loader widget values.
    text4STRINGSlot 4The text content for slot 4. Supports key=value tokens (model, sampler, scheduler, cfg, steps, seed) which are extracted and removed, overriding the matching loader widget values.
    text5STRINGSlot 5The text content for slot 5. Supports key=value tokens (model, sampler, scheduler, cfg, steps, seed) which are extracted and removed, overriding the matching loader widget values.
    text6STRINGSlot 6The text content for slot 6. Supports key=value tokens (model, sampler, scheduler, cfg, steps, seed) which are extracted and removed, overriding the matching loader widget values.
    text7STRINGSlot 7The text content for slot 7. Supports key=value tokens (model, sampler, scheduler, cfg, steps, seed) which are extracted and removed, overriding the matching loader widget values.
    text8STRINGSlot 8The text content for slot 8. Supports key=value tokens (model, sampler, scheduler, cfg, steps, seed) which are extracted and removed, overriding the matching loader widget values.
    text9STRINGSlot 9The text content for slot 9. Supports key=value tokens (model, sampler, scheduler, cfg, steps, seed) which are extracted and removed, overriding the matching loader widget values.
    text10STRINGSlot 10The text content for slot 10. Supports key=value tokens (model, sampler, scheduler, cfg, steps, seed) which are extracted and removed, overriding the matching loader widget values.
    text11STRINGSlot 11The text content for slot 11. Supports key=value tokens (model, sampler, scheduler, cfg, steps, seed) which are extracted and removed, overriding the matching loader widget values.
    text12STRINGSlot 12The text content for slot 12. Supports key=value tokens (model, sampler, scheduler, cfg, steps, seed) which are extracted and removed, overriding the matching loader widget values.
    text13STRINGSlot 13The text content for slot 13. Supports key=value tokens (model, sampler, scheduler, cfg, steps, seed) which are extracted and removed, overriding the matching loader widget values.
    text14STRINGSlot 14The text content for slot 14. Supports key=value tokens (model, sampler, scheduler, cfg, steps, seed) which are extracted and removed, overriding the matching loader widget values.
    text15STRINGSlot 15The text content for slot 15. Supports key=value tokens (model, sampler, scheduler, cfg, steps, seed) which are extracted and removed, overriding the matching loader widget values.
    text16STRINGSlot 16The text content for slot 16. Supports key=value tokens (model, sampler, scheduler, cfg, steps, seed) which are extracted and removed, overriding the matching loader widget values.
    text17STRINGSlot 17The text content for slot 17. Supports key=value tokens (model, sampler, scheduler, cfg, steps, seed) which are extracted and removed, overriding the matching loader widget values.
    text18STRINGSlot 18The text content for slot 18. Supports key=value tokens (model, sampler, scheduler, cfg, steps, seed) which are extracted and removed, overriding the matching loader widget values.
    text19STRINGSlot 19The text content for slot 19. Supports key=value tokens (model, sampler, scheduler, cfg, steps, seed) which are extracted and removed, overriding the matching loader widget values.
    text20STRINGSlot 20The text content for slot 20. Supports key=value tokens (model, sampler, scheduler, cfg, steps, seed) which are extracted and removed, overriding the matching loader widget values.
    ckpt_nameCOMBOThe checkpoint model file to load.
    speed_loraBOOLEANfalseEnable or disable SpeedLoRA optimizations.
    speed_lora_modelCOMBONoneThe SpeedLoRA model to apply. Select 'None' to disable SpeedLoRA.
    speed_lora_strengthFLOAT1.000–3Multiplier applied to the selected SpeedLoRA weights.
    clip_skipINT-1-24–-1Number of last layers of CLIP to skip. -1 is a good default.
    samplerCOMBOThe sampling algorithm to use.
    schedulerCOMBOThe noise schedule to use.
    cfgFLOAT2.0-2–100Classifier-Free Guidance scale. Higher values increase prompt adherence.
    stepsINT101–10000Number of sampling steps.
    widthINT72064–8192Image width. Used when 'aspect_ratio' is 'custom'.
    heightINT72064–8192Image height. Used when 'aspect_ratio' is 'custom'.
    aspect_ratioCOMBOSelect a predefined aspect ratio or ratio to automatically set width and height.
    aspect_modeCOMBOOriginalRandom swaps dimensions 50% of the time, Swap forces a swap, Original keeps the original order.
    batch_sizeINT11–64Number of latent images to generate in a batch.
    seedINT0-18446744073709550000–18446744073709550000The random seed for generation.
    megapixelsFLOAT1.00.1–16Target total megapixels used when a ratio is selected.
    multipleINT88–128Nearest multiple to round computed resolution to. Used with ratio.

    Outputs (16)

    NameTypeDescription
    MODELMODEL
    CLIPCLIP
    VAEVAE
    ckpt nameSTRING
    sampler*
    scheduler*
    cfgFLOAT
    stepsINT
    latentLATENT
    widthINT
    heightINT
    seedINT
    batch sizeINT
    textSTRING
    labelSTRING
    indexINT