diff --git a/scripts/controlnet_ui/controlnet_ui_group.py b/scripts/controlnet_ui/controlnet_ui_group.py index 39c47a4f9..4020d1414 100644 --- a/scripts/controlnet_ui/controlnet_ui_group.py +++ b/scripts/controlnet_ui/controlnet_ui_group.py @@ -111,7 +111,9 @@ def set_component(self, component: gr.components.IOComponent): "setting_sd_model_checkpoint": "setting_sd_model_checkpoint", } elem_id = getattr(component, "elem_id", None) - if elem_id in id_mapping: + # Do not set component if it has already been set. + # https://github.com/Mikubill/sd-webui-controlnet/issues/2587 + if elem_id in id_mapping and getattr(self, id_mapping[elem_id]) is None: setattr(self, id_mapping[elem_id], component) logger.debug(f"Setting {elem_id}.") logger.debug(