Skip to content

Commit

Permalink
Fix missing parameter when using explicit order in custom workflow #1393
Browse files Browse the repository at this point in the history
  • Loading branch information
Acly committed Nov 13, 2024
1 parent 72fe928 commit 9a85f93
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions ai_diffusion/custom_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,14 +243,14 @@ class ParamKind(Enum):

class CustomParam(NamedTuple):
kind: ParamKind
full_name: str
name: str
default: Any | None = None
min: int | float | None = None
max: int | float | None = None
choices: list[str] | None = None

@property
def name(self):
def display_name(self):
_, name = self._split_order(self._split_name()[-1])
return name

Expand All @@ -260,9 +260,9 @@ def group(self):
return group_name

def _split_name(self):
if "/" in self.full_name:
return self.full_name.rsplit("/", 1)
return "", self.full_name
if "/" in self.name:
return self.name.rsplit("/", 1)
return "", self.name

@staticmethod
def _split_order(s: str):
Expand Down
2 changes: 1 addition & 1 deletion ai_diffusion/ui/custom_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ def __init__(self, params: list[CustomParam], parent: QWidget | None = None):
group_widgets = []
current_group = (p.group, expander, group_widgets)
layout.addWidget(expander, layout.rowCount(), 0, 1, 4)
label = QLabel(p.name, self)
label = QLabel(p.display_name, self)
widget = _create_param_widget(p, self)
widget.value_changed.connect(self._notify)
row = layout.rowCount()
Expand Down

0 comments on commit 9a85f93

Please sign in to comment.