diff --git a/invokeai/app/services/model_install/model_install_base.py b/invokeai/app/services/model_install/model_install_base.py index 61cea44763..c333639bda 100644 --- a/invokeai/app/services/model_install/model_install_base.py +++ b/invokeai/app/services/model_install/model_install_base.py @@ -35,7 +35,7 @@ class ModelInstallJob(BaseModel): inplace: bool = Field(default=False, description="Leave model in its current location; otherwise install under models directory") source: ModelSource = Field(description="Source (URL, repo_id, or local path) of model") local_path: Path = Field(description="Path to locally-downloaded model; may be the same as the source") - key: Optional[str] = Field(default=None, description="After model is installed, this is its config record key") + key: str = Field(default="", description="After model is installed, this is its config record key") error_type: str = Field(default="", description="Class name of the exception that led to status==ERROR") error: str = Field(default="", description="Error traceback") # noqa #501 diff --git a/invokeai/app/services/model_install/model_install_default.py b/invokeai/app/services/model_install/model_install_default.py index 5d2afaaf08..0036ea6aa5 100644 --- a/invokeai/app/services/model_install/model_install_default.py +++ b/invokeai/app/services/model_install/model_install_default.py @@ -178,14 +178,15 @@ class ModelInstallService(ModelInstallServiceBase): self._install_queue.put(job) return job - else: # waiting for download queue implementation + else: # here is where we'd download a URL or repo_id. Implementation pending download queue. raise NotImplementedError def list_jobs(self, source: Optional[ModelSource]=None) -> List[ModelInstallJob]: # noqa D102 jobs = self._install_jobs if not source: - return jobs.values() + return list(jobs.values()) else: + source = str(source) return [jobs[x] for x in jobs if source in str(x)] def get_job(self, source: ModelSource) -> ModelInstallJob: # noqa D102 diff --git a/tests/nodes/__init__.py b/tests/aa_nodes/__init__.py similarity index 100% rename from tests/nodes/__init__.py rename to tests/aa_nodes/__init__.py diff --git a/tests/nodes/test_graph_execution_state.py b/tests/aa_nodes/test_graph_execution_state.py similarity index 99% rename from tests/nodes/test_graph_execution_state.py rename to tests/aa_nodes/test_graph_execution_state.py index cc40970ace..395bb46977 100644 --- a/tests/nodes/test_graph_execution_state.py +++ b/tests/aa_nodes/test_graph_execution_state.py @@ -69,6 +69,7 @@ def mock_services() -> InvocationServices: logger=logging, # type: ignore model_manager=None, # type: ignore model_records=None, # type: ignore + model_install=None, # type: ignore names=None, # type: ignore performance_statistics=InvocationStatsService(), processor=DefaultInvocationProcessor(), diff --git a/tests/nodes/test_invoker.py b/tests/aa_nodes/test_invoker.py similarity index 99% rename from tests/nodes/test_invoker.py rename to tests/aa_nodes/test_invoker.py index c775fb93f2..7a12b81940 100644 --- a/tests/nodes/test_invoker.py +++ b/tests/aa_nodes/test_invoker.py @@ -74,6 +74,7 @@ def mock_services() -> InvocationServices: logger=logging, # type: ignore model_manager=None, # type: ignore model_records=None, # type: ignore + model_install=None, # type: ignore names=None, # type: ignore performance_statistics=InvocationStatsService(), processor=DefaultInvocationProcessor(), diff --git a/tests/nodes/test_node_graph.py b/tests/aa_nodes/test_node_graph.py similarity index 100% rename from tests/nodes/test_node_graph.py rename to tests/aa_nodes/test_node_graph.py diff --git a/tests/nodes/test_nodes.py b/tests/aa_nodes/test_nodes.py similarity index 100% rename from tests/nodes/test_nodes.py rename to tests/aa_nodes/test_nodes.py diff --git a/tests/nodes/test_session_queue.py b/tests/aa_nodes/test_session_queue.py similarity index 99% rename from tests/nodes/test_session_queue.py rename to tests/aa_nodes/test_session_queue.py index 768b09898d..b15bb9df36 100644 --- a/tests/nodes/test_session_queue.py +++ b/tests/aa_nodes/test_session_queue.py @@ -12,7 +12,7 @@ from invokeai.app.services.session_queue.session_queue_common import ( prepare_values_to_insert, ) from invokeai.app.services.shared.graph import Graph, GraphExecutionState, GraphInvocation -from tests.nodes.test_nodes import PromptTestInvocation +from tests.aa_nodes.test_nodes import PromptTestInvocation @pytest.fixture diff --git a/tests/nodes/test_sqlite.py b/tests/aa_nodes/test_sqlite.py similarity index 100% rename from tests/nodes/test_sqlite.py rename to tests/aa_nodes/test_sqlite.py