mirror of
https://github.com/Zyin055/Config-Presets.git
synced 2026-02-20 23:14:04 +00:00
fix for "Use same sampler" sampler dropdown value
The hr_sampler component dropdown has a value called "Use same sampler" which needed a special case for in order to not error. #75
This commit is contained in:
@@ -1209,8 +1209,11 @@ def save_config(config_presets, component_map, config_file_name):
|
||||
new_value = new_setting[i] # this gives the index when the component is a dropdown
|
||||
|
||||
if isinstance(new_value, str) and (component_id == "txt2img_sampling" or component_id == "img2img_sampling" or component_id == "hr_sampler"):
|
||||
if isinstance(new_value, str): #in A1111 1.6.0(?) the sampler is now returned as a string instead of an integer
|
||||
new_setting_map[component_id] = modules.sd_samplers.samplers_map[new_value.lower()]
|
||||
if isinstance(new_value, str): # in A1111 1.6.0(?) the sampler is now returned as a string instead of an integer
|
||||
if new_value == "Use same sampler": # the hr_sampler dropdown has a "Use same sampler" value that doesn't exist in the samplers_map
|
||||
new_setting_map[component_id] = new_value
|
||||
else:
|
||||
new_setting_map[component_id] = modules.sd_samplers.samplers_map[new_value.lower()]
|
||||
elif isinstance(new_value, int):
|
||||
new_setting_map[component_id] = modules.sd_samplers.samplers[new_value].name
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user