diff --git a/facefusion/apis/endpoints/state.py b/facefusion/apis/endpoints/state.py index 322b16b6..ba121c3c 100644 --- a/facefusion/apis/endpoints/state.py +++ b/facefusion/apis/endpoints/state.py @@ -34,9 +34,12 @@ async def set_state(request : Request) -> JSONResponse: 'message': translator.get('invalid_state_key', 'facefusion.apis') }, status_code = HTTP_400_BAD_REQUEST) __api_args__[key] = value - state_manager.set_item(key, value) if __api_args__: + + for key, value in __api_args__.items(): + state_manager.set_item(key, value) + __api_args__ = args_helper.extract_api_args(state_manager.get_state()) return JSONResponse(state_manager.collect_state(__api_args__), status_code = HTTP_200_OK) diff --git a/tests/test_api_state.py b/tests/test_api_state.py index 4210ba1e..5d150590 100644 --- a/tests/test_api_state.py +++ b/tests/test_api_state.py @@ -132,6 +132,7 @@ def test_set_state(test_client : TestClient) -> None: }) set_state_body = set_state_response.json() + assert set_state_body.get('execution_providers') is None assert set_state_body.get('invalid') is None assert set_state_response.status_code == 400