Nodes/DemonAlone-nodes-ComfyUI/Sampler Selector From String
ComfyUI Node

Sampler Selector From String

Turn a text value into a real KSampler sampler

By DemonAlone·Created 7 months ago·Updated 22 days ago· 3
Sampler Selector From String
    • sampler_name
    sampler_name_streuler

    ComfyUI's sampler dropdown is a fixed widget - a combo type, not something a loop variable or a text value can normally drive. That's the exact wall you hit if you're building a comparison run: you've got a list of sampler names as strings (say, from this same pack's Dynamic Sampler Selector) and no way to turn "one string, pulled out of a loop" into "a connection the KSampler will actually accept." This node is that conversion step.

    What it does

    One input, sampler_name_str, a plain STRING defaulting to "euler". One output, sampler_name, but typed as the real, full sampler enum - the same list a KSampler's own dropdown offers. Feed it a valid sampler name as text and it comes out the other side as a proper, wireable sampler connection. Feed it something that doesn't match any known sampler, and rather than erroring your whole queue, it falls back to euler - quietly.

    This is the natural partner to the Dynamic Sampler Selector's LIST output: loop over that list, run each string through this node, and you get a real sampler connection per iteration without hand-building ten separate KSampler variants.

    Installing it

    ComfyUI Manager: search DemonAlone-nodes-ComfyUI, install, restart. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/DemonAlone/SimpeStringGenerator_ComfyUI
    

    No extra dependencies or model downloads.

    Where people get burned

    The silent fallback is the thing to know about. Typo a sampler name - "eulera" instead of "euler_ancestral", a stray space, wrong casing - and instead of an error telling you exactly what went wrong, you silently get plain euler. In a comparison run across several samplers, that means one or more of your "different" results might actually all be the same sampler, and nothing in the UI will flag it. If a sweep looks suspiciously uniform, check your spelling before you trust the results.

    It's also worth remembering what this node picks doesn't automatically match your scheduler choice for the model you're running. On flow-matching checkpoints (Flux, Z-Image, and similar), Euler-family samplers on a beta or simple schedule are the safer combination - Karras and exponential schedules are known to fail on that architecture family regardless of which sampler you paired them with.

    Categoryutils

    Inputs (1)

    NameTypeDefaultDescription
    sampler_name_strSTRINGeuler

    Outputs (1)

    NameTypeDescription
    sampler_nameeuler,euler_cfg_pp,euler_ancestral,euler_ancestral_cfg_pp,heun,heunpp2,exp_heun_2_x0,exp_heun_2_x0_sde,dpm_2,dpm_2_ancestral,lms,dpm_fast,dpm_adaptive,dpmpp_2s_ancestral,dpmpp_2s_ancestral_cfg_pp,dpmpp_sde,dpmpp_sde_gpu,dpmpp_2m,dpmpp_2m_cfg_pp,dpmpp_2m_sde,dpmpp_2m_sde_gpu,dpmpp_2m_sde_heun,dpmpp_2m_sde_heun_gpu,dpmpp_3m_sde,dpmpp_3m_sde_gpu,ddpm,lcm,ipndm,ipndm_v,deis,res_multistep,res_multistep_cfg_pp,res_multistep_ancestral,res_multistep_ancestral_cfg_pp,gradient_estimation,gradient_estimation_cfg_pp,er_sde,seeds_2,seeds_3,sa_solver,sa_solver_pece,ddim,uni_pc,uni_pc_bh2