Skip to content

Commit de7abce

Browse files
authored
add an argument that lets user specify folders to scan for weights (invoke-ai#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
1 parent 2aa5bb6 commit de7abce

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

ldm/invoke/args.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,12 @@ def _create_arg_parser(self):
431431
'--model',
432432
help='Indicates which diffusion model to load (defaults to "default" stanza in configs/models.yaml)',
433433
)
434+
model_group.add_argument(
435+
'--weight_dirs',
436+
nargs='+',
437+
type=str,
438+
help='List of one or more directories that will be auto-scanned for new model weights to import',
439+
)
434440
model_group.add_argument(
435441
'--png_compression','-z',
436442
type=int,

0 commit comments

Comments
 (0)