allow register_arguments to be nested, fix types, adjust processors

This commit is contained in:
henryruhs
2026-02-17 12:16:11 +01:00
parent 1181307a0e
commit 9486750f38
16 changed files with 945 additions and 559 deletions
+15 -9
View File
@@ -11,17 +11,23 @@ from facefusion.apis.core import create_api
@pytest.fixture(scope = 'module')
def test_client() -> Iterator[TestClient]:
program = ArgumentParser()
args_store.register_argument(
program.add_argument(
'--source-paths',
nargs = '+'),
args_store.register_arguments(
[
program.add_argument(
'--source-paths',
nargs = '+'
)
],
scopes = [ 'api' ]
)
args_store.register_argument(
program.add_argument(
'--output-format',
default = 'mp4',
choices = [ 'mp4', 'mkv', 'webm' ]),
args_store.register_arguments(
[
program.add_argument(
'--output-format',
default = 'mp4',
choices = [ 'mp4', 'mkv', 'webm' ]
)
],
scopes = [ 'api' ]
)
+20 -11
View File
@@ -25,21 +25,30 @@ def before_all() -> None:
@pytest.fixture(scope = 'module')
def test_client() -> Iterator[TestClient]:
program = ArgumentParser()
args_store.register_argument(
program.add_argument(
'--source-paths',
nargs = '+'),
args_store.register_arguments(
[
program.add_argument(
'--source-paths',
nargs = '+'
)
],
scopes = [ 'api' ]
)
args_store.register_argument(
program.add_argument(
'--target-path'),
args_store.register_arguments(
[
program.add_argument(
'--target-path'
)
],
scopes = [ 'api' ]
)
args_store.register_argument(
program.add_argument(
'--execution-providers',
nargs = '+'),
args_store.register_arguments(
[
program.add_argument(
'--execution-providers',
nargs = '+'
)
],
scopes = [ 'api' ]
)
state_manager.init_item('execution_providers', [ 'cpu' ])