Skip to content

Commit 9ad9e91

Browse files
authored
Detect invalid model names when migrating 2.3->3.0 (#3623)
A user discovered that 2.3 models whose symbolic names contain the "/" character are not imported properly by the `migrate-models-3` script. This fixes the issue by changing "/" to underscore at import time.
2 parents 0981a7d + 307a01d commit 9ad9e91

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

invokeai/backend/install/migrate_to_3.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ def unique_name(self,name,info)->str:
7676
Create a unique name for a model for use within models.yaml.
7777
'''
7878
done = False
79+
80+
# some model names have slashes in them, which really screws things up
81+
name = name.replace('/','_')
82+
7983
key = ModelManager.create_key(name,info.base_type,info.model_type)
8084
unique_name = key
8185
counter = 1

0 commit comments

Comments
 (0)