mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
32ad742f3e
* Pull logic for extracting TI triggers into a util function * Remove duplicate regex for ti triggers * Fix linting for ruff * Remove unused imports
9 lines
218 B
Python
9 lines
218 B
Python
import re
|
|
|
|
|
|
def extract_ti_triggers_from_prompt(prompt: str) -> list[str]:
|
|
ti_triggers = []
|
|
for trigger in re.findall(r"<[a-zA-Z0-9., _-]+>", prompt):
|
|
ti_triggers.append(trigger)
|
|
return ti_triggers
|