mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
6b79e2b407
- resolve conflicts - remove unused code identified by pyflakes
14 lines
579 B
Python
14 lines
579 B
Python
import invokeai.backend.util.logging as log
|
|
from invokeai.backend.model_management.model_manager import ModelManager
|
|
|
|
|
|
def choose_model(model_manager: ModelManager, model_name: str):
|
|
"""Returns the default model if the `model_name` not a valid model, else returns the selected model."""
|
|
if model_manager.valid_model(model_name):
|
|
model = model_manager.get_model(model_name)
|
|
else:
|
|
model = model_manager.get_model()
|
|
log.warning(f"{model_name}' is not a valid model name. Using default model \'{model['model_name']}\' instead.")
|
|
|
|
return model
|