From 019aa9beab9be6ccd150cd7b66f9a9d9707f3878 Mon Sep 17 00:00:00 2001 From: "Alex \"mcmonkey\" Goodwin" Date: Mon, 8 May 2023 16:05:13 -0700 Subject: [PATCH] auto-restore mimic mode / cfg mode when loading from metadata for #34 --- scripts/dynamic_thresholding.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/dynamic_thresholding.py b/scripts/dynamic_thresholding.py index 7eba434..b14db74 100644 --- a/scripts/dynamic_thresholding.py +++ b/scripts/dynamic_thresholding.py @@ -62,8 +62,8 @@ class Script(scripts.Script): (mimic_scale, "Mimic scale"), (threshold_percentile, "Threshold percentile"), (mimic_scale_min, "Mimic scale minimum"), - (mimic_mode, "Mimic mode"), - (cfg_mode, "CFG mode"), + (mimic_mode, lambda d: gr.Dropdown.update(value=d.get("Mimic mode", "Constant"))), + (cfg_mode, lambda d: gr.Dropdown.update(value=d.get("CFG mode", "Constant"))), (cfg_scale_min, "CFG scale minimum"), (power_val, "Power scheduler value")) return [enabled, mimic_scale, threshold_percentile, mimic_mode, mimic_scale_min, cfg_mode, cfg_scale_min, power_val]