add an argument that lets user specify folders to scan for weights (#1977)

* add an argument that lets user specify folders to scan for weights

This PR adds a `--weight_folders` argument to invoke.py. Using
argparse, it adds a "weight_folders" attribute to the Args object, and
can be used like this:

```
'''test.py'''
from ldm.invoke.args import Args

args = Args().parse_args()

for folder in args.weight_folders:
    print(folder)
```

Example output:

```
python test.py --weight_folders /tmp/weights /home/fred/invokeai/weights "./my folder with spaces/weight files"
/tmp/weights
/home/fred/invokeai/weights
./my folder with spaces/weight files
```

* change --weight_folders to --weight_dirs
This commit is contained in:
Lincoln Stein 2022-12-16 10:14:49 -05:00 committed by GitHub
parent 2aa5bb6aad
commit de7abce464
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -431,6 +431,12 @@ class Args(object):
'--model',
help='Indicates which diffusion model to load (defaults to "default" stanza in configs/models.yaml)',
)
model_group.add_argument(
'--weight_dirs',
nargs='+',
type=str,
help='List of one or more directories that will be auto-scanned for new model weights to import',
)
model_group.add_argument(
'--png_compression','-z',
type=int,