mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix crash when editing name of model
- fixes a spurious "unknown model name" error when trying to edit the short name of an existing model. - relaxes naming requirements to include the ':' and '/' characters in model names
This commit is contained in:
parent
371edc993a
commit
fc8e3dbcd3
@ -786,8 +786,8 @@ def _get_model_name(existing_names,completer,default_name:str='')->str:
|
||||
model_name = input(f'Short name for this model [{default_name}]: ').strip()
|
||||
if len(model_name)==0:
|
||||
model_name = default_name
|
||||
if not re.match('^[\w._+-]+$',model_name):
|
||||
print('** model name must contain only words, digits and the characters "._+-" **')
|
||||
if not re.match('^[\w._+:/-]+$',model_name):
|
||||
print('** model name must contain only words, digits and the characters "._+:/-" **')
|
||||
elif model_name != default_name and model_name in existing_names:
|
||||
print(f'** the name {model_name} is already in use. Pick another.')
|
||||
else:
|
||||
|
@ -125,7 +125,7 @@ class ModelManager(object):
|
||||
Set the default model. The change will not take
|
||||
effect until you call model_manager.commit()
|
||||
'''
|
||||
assert model_name in self.models,f"unknown model '{model_name}'"
|
||||
assert model_name in self.model_names(), f"unknown model '{model_name}'"
|
||||
|
||||
config = self.config
|
||||
for model in config:
|
||||
|
Loading…
Reference in New Issue
Block a user