Skip to content

Commit

Permalink
Merge pull request #112 from space-nuko/normalize-model-filenames
Browse files Browse the repository at this point in the history
Escape commas in model filenames
  • Loading branch information
kohya-ss authored Feb 16, 2023
2 parents d0a72e1 + f098335 commit 822f213
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scripts/model_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,10 @@ def get_all_models(paths, sort_by, filter_by):

name = os.path.splitext(os.path.basename(filename))[0]

# Commas in the model name will mess up infotext restoration since the
# infotext is delimited by commas
name = name.replace(",", "_")

# Prevent a hypothetical "None.pt" from being listed.
if name != "None":
full_name = name + f"({model_hash[0:12]})"
Expand Down

0 comments on commit 822f213

Please sign in to comment.