From 66211d9a06f72217fc4aaa324abb3b192a6a30cc Mon Sep 17 00:00:00 2001 From: layerdiffusion <19834515+lllyasviel@users.noreply.github.com> Date: Sat, 7 Sep 2024 01:43:12 -0700 Subject: [PATCH] add a way to add samplers dynamically --- modules/sd_samplers.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/sd_samplers.py b/modules/sd_samplers.py index 77f4b93d..76e82ed5 100644 --- a/modules/sd_samplers.py +++ b/modules/sd_samplers.py @@ -58,6 +58,16 @@ def set_samplers(): for alias in sampler.aliases: samplers_map[alias.lower()] = sampler.name + return + + +def add_sampler(sampler): + global all_samplers, all_samplers_map + all_samplers.append(sampler) + all_samplers_map = {x.name: x for x in all_samplers} + set_samplers() + return + def visible_sampler_names(): return [x.name for x in samplers if x.name not in samplers_hidden]