From ff645b9069f5c5198e4239c3bcf5de101f2bc585 Mon Sep 17 00:00:00 2001 From: henryruhs Date: Sat, 19 Apr 2025 18:06:44 +0200 Subject: [PATCH] Allow deep nested wording --- facefusion/wording.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/facefusion/wording.py b/facefusion/wording.py index 8cc3c58..a71d020 100755 --- a/facefusion/wording.py +++ b/facefusion/wording.py @@ -341,11 +341,13 @@ WORDING : Dict[str, Any] =\ } -def get(key : str) -> Optional[str]: - if '.' in key: - section, name = key.split('.') - if section in WORDING and name in WORDING.get(section): - return WORDING.get(section).get(name) - if key in WORDING: - return WORDING.get(key) - return None +def get(key: str) -> Optional[str]: + current = WORDING + + for fragment in key.split('.'): + if fragment in current: + current = current.get(fragment) + else: + return None + + return current