Skip to content

Commit

Permalink
Fix initial value for style widgets in custom workflows #1393
Browse files Browse the repository at this point in the history
  • Loading branch information
Acly committed Nov 13, 2024
1 parent 9a85f93 commit 00536f4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ai_diffusion/ui/custom_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 00536f4

Please sign in to comment.