Skip to content

Commit 1b1b399

Browse files
authored
Fix crash when attempting to update a model (#4192)
## What type of PR is this? (check all applicable) - [X] Bug Fix ## Have you discussed this change with the InvokeAI team? - [X No, because small fix ## Have you updated all relevant documentation? - [X] Yes ## Description A logic bug was introduced in PR #4109 that caused Web-based model updates to fail with a pydantic validation error. This corrects the problem. ## Related Tickets & Documents PR #4109
2 parents 2b3b77a + 6ed7ba5 commit 1b1b399

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

invokeai/backend/model_management/model_manager.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,9 +595,10 @@ def list_model(
595595
the combined format of the list_models() method.
596596
"""
597597
models = self.list_models(base_model, model_type, model_name)
598-
if len(models) > 1:
598+
if len(models) >= 1:
599599
return models[0]
600-
return None
600+
else:
601+
return None
601602

602603
def list_models(
603604
self,

0 commit comments

Comments
 (0)