From 9a85f93c51dded3e89bb7e06b27cffd1cfca7fd7 Mon Sep 17 00:00:00 2001 From: Acly Date: Wed, 13 Nov 2024 15:55:46 +0100 Subject: [PATCH] Fix missing parameter when using explicit order in custom workflow #1393 --- ai_diffusion/custom_workflow.py | 10 +++++----- ai_diffusion/ui/custom_workflow.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ai_diffusion/custom_workflow.py b/ai_diffusion/custom_workflow.py index 81487c1b5b..271ebad3f0 100644 --- a/ai_diffusion/custom_workflow.py +++ b/ai_diffusion/custom_workflow.py @@ -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 @@ -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): diff --git a/ai_diffusion/ui/custom_workflow.py b/ai_diffusion/ui/custom_workflow.py index 9fe8910891..3455258450 100644 --- a/ai_diffusion/ui/custom_workflow.py +++ b/ai_diffusion/ui/custom_workflow.py @@ -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()