enable backend switching on-the-fly

This commit is contained in:
Vladimir Mandic
2023-07-11 15:55:02 -04:00
parent 6d277305f6
commit ec99bad021
11 changed files with 86 additions and 45 deletions
+3
View File
@@ -49,7 +49,10 @@ samplers_data_diffusers = [
class DiffusionSampler:
def __init__(self, name, constructor, model, **kwargs):
self.config = {}
self.config = config['All'].copy()
if not hasattr(model, 'scheduler'):
return
for key, value in config.get(name, {}).items(): # diffusers defaults
self.config[key] = value
for key, value in model.scheduler.config.items(): # model defaults