From 00536f49a80b6508974291aa966d4699b94fdf71 Mon Sep 17 00:00:00 2001 From: Acly Date: Wed, 13 Nov 2024 16:20:07 +0100 Subject: [PATCH] Fix initial value for style widgets in custom workflows #1393 --- ai_diffusion/ui/custom_workflow.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ai_diffusion/ui/custom_workflow.py b/ai_diffusion/ui/custom_workflow.py index 3455258450..e7ab3eb109 100644 --- a/ai_diffusion/ui/custom_workflow.py +++ b/ai_diffusion/ui/custom_workflow.py @@ -318,8 +318,9 @@ def value(self): @value.setter def value(self, value: str): - if style := Styles.list().find(value): - self._style_select.value = style + if value != self.value: + if style := Styles.list().find(value): + self._style_select.value = style CustomParamWidget = ( @@ -788,7 +789,8 @@ def _update_current_workflow(self): self._params_widget = None if len(self.model.custom.metadata) > 0: self._params_widget = WorkflowParamsWidget(self.model.custom.metadata, self) - self._params_widget.value = self.model.custom.params + self._params_widget.value = self.model.custom.params # set default values from model + self.model.custom.params = self._params_widget.value # set default values from widgets self._params_widget.value_changed.connect(self._change_params) self._params_scroll.setWidget(self._params_widget)