From ad983c99d9a997c12179a4ccb383c5340177060e Mon Sep 17 00:00:00 2001 From: Will Cole <48973146+wcole3@users.noreply.github.com> Date: Fri, 22 Nov 2024 05:00:42 -0500 Subject: [PATCH] Don't duplicate samplers when adding (#2354) fixes #2351 and #1791 --- modules/sd_samplers.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/sd_samplers.py b/modules/sd_samplers.py index 76e82ed5..d99eecad 100644 --- a/modules/sd_samplers.py +++ b/modules/sd_samplers.py @@ -63,9 +63,10 @@ def set_samplers(): 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() + if sampler.name not in [x.name for x in all_samplers]: + all_samplers.append(sampler) + all_samplers_map = {x.name: x for x in all_samplers} + set_samplers() return