diff --git a/invokeai/backend/util/test_utils.py b/invokeai/backend/util/test_utils.py index a64919ca4b5..609790b8a40 100644 --- a/invokeai/backend/util/test_utils.py +++ b/invokeai/backend/util/test_utils.py @@ -33,7 +33,7 @@ def install_and_load_model( This is intended as a utility function for tests. Args: - mm2_model_manager (ModelManagerServiceBase): The model manager + model_manager (ModelManagerServiceBase): The model manager model_path_id_or_url (Union[str, Path]): The path, HF ID, URL, etc. where the model can be installed from if it is not already installed. model_name (str): The model name, forwarded to ModelManager.get_model(...). diff --git a/tests/backend/ip_adapter/test_ip_adapter.py b/tests/backend/ip_adapter/test_ip_adapter.py index 87b696c5342..c2d6a161c2f 100644 --- a/tests/backend/ip_adapter/test_ip_adapter.py +++ b/tests/backend/ip_adapter/test_ip_adapter.py @@ -48,10 +48,10 @@ def build_dummy_sd15_unet_input(torch_device): ], ) @pytest.mark.slow -def test_ip_adapter_unet_patch(model_params, model_installer, torch_device): +def test_ip_adapter_unet_patch(model_params, mm2_model_manager, torch_device): """Smoke test that IP-Adapter weights can be loaded and used to patch a UNet.""" ip_adapter_info = install_and_load_model( - model_installer=model_installer, + model_manager=mm2_model_manager, model_path_id_or_url=model_params["ip_adapter_model_id"], model_name=model_params["ip_adapter_model_name"], base_model=model_params["base_model"], @@ -59,7 +59,7 @@ def test_ip_adapter_unet_patch(model_params, model_installer, torch_device): ) unet_info = install_and_load_model( - model_installer=model_installer, + model_manager=mm2_model_manager, model_path_id_or_url=model_params["unet_model_id"], model_name=model_params["unet_model_name"], base_model=model_params["base_model"], diff --git a/tests/conftest.py b/tests/conftest.py index bb8afd1d8de..d105c017741 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -2,7 +2,7 @@ # without needing to explicitly import them. (https://docs.pytest.org/en/6.2.x/fixture.html) -# We import the model_installer and torch_device fixtures here so that they can be used by all tests. Flake8 does not +# We import the torch_device fixture here so that it can be used by all tests. Flake8 does not # play well with fixtures (F401 and F811), so this is cleaner than importing in all files that use these fixtures. import logging import shutil @@ -32,6 +32,7 @@ from invokeai.app.services.video_records.video_records_sqlite import SqliteVideoRecordStorage from invokeai.app.services.workflow_records.workflow_records_sqlite import SqliteWorkflowRecordsStorage from invokeai.backend.util.logging import InvokeAILogger +from invokeai.backend.util.test_utils import torch_device # noqa: F401 from tests.backend.model_manager.model_manager_fixtures import * # noqa: F403 from tests.fixtures.sqlite_database import create_mock_sqlite_database # noqa: F401 from tests.test_nodes import TestEventService