quote output, embedding and autoscan directores in invokeai.init (#2827)

This should prevent the errors that users are seeing with spaces in the
file paths
This commit is contained in:
Lincoln Stein 2023-02-27 00:17:37 -05:00 committed by GitHub
commit 650f4bb58c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -712,8 +712,8 @@ def write_opts(opts: Namespace, init_file: Path):
out_file.write(line + "\n")
out_file.write(
f"""
--outdir={opts.outdir}
--embedding_path={opts.embedding_path}
--outdir="{opts.outdir}"
--embedding_path="{opts.embedding_path}"
--precision={opts.precision}
--max_loaded_models={int(opts.max_loaded_models)}
--{'no-' if not opts.safety_checker else ''}nsfw_checker

View File

@ -126,7 +126,7 @@ def install_requested_models(
while line := input.readline():
if not line.startswith(argument):
output.writelines([line])
output.writelines([f'{argument} {directory}'])
output.writelines([f'{argument} "{directory}"'])
os.replace(replacement,initfile)
# -------------------------------------