mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(config): add flag to indicate if args were parsed
This flag acts as a proxy for the `get_config()` function to determine if the full application is running. If it was, the config will set the root, do HF login, etc. If not (e.g. it's called by an external script), all that stuff will be skipped.
This commit is contained in:
@ -34,9 +34,11 @@ class InvokeAIArgs:
|
||||
"""
|
||||
|
||||
args: Optional[Namespace] = None
|
||||
did_parse: bool = False
|
||||
|
||||
@staticmethod
|
||||
def parse_args() -> Optional[Namespace]:
|
||||
"""Parse CLI args and store the result."""
|
||||
InvokeAIArgs.args = _parser.parse_args()
|
||||
InvokeAIArgs.did_parse = True
|
||||
return InvokeAIArgs.args
|
||||
|
Reference in New Issue
Block a user