init: first available

This commit is contained in:
uihp
2025-02-07 02:25:44 +08:00
commit f323a35e3e
11 changed files with 248 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
class StringChain:
@classmethod
def INPUT_TYPES(cls) -> dict:
return {
'optional': { 'previous': ('STRING', {'forceInput': True, 'default': '', 'multiline': True}) },
'required': {
'separator': ('STRING', {'default': ', '}),
'string': ('STRING', {'default': '', 'multiline': True}),
}
}
RETURN_TYPES = ('STRING',)
FUNCTION = 'combine'
CATEGORY = 'utils'
def combine(self, string: str, separator: str, previous: str = '') -> tuple[str]:
return (f'{previous}{separator}{string}',) if previous and string else (previous or string,)