mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
add --default_only arg to configure_invokeai.py for CI use
Added a --default_only argument that limits model downloads to the single default model, for use in continuous integration. New behavior - switch - --yes --default_only Behavior ----- -------------- -------- <not set> <not set> interactive download --yes <not set> non-interactively download all recommended models --yes --default_only non-interactively download the default model
This commit is contained in:
parent
563196bd03
commit
212fec669a
@ -197,6 +197,14 @@ def recommended_datasets()->dict:
|
|||||||
datasets[ds]=True
|
datasets[ds]=True
|
||||||
return datasets
|
return datasets
|
||||||
|
|
||||||
|
#---------------------------------------------
|
||||||
|
def default_dataset()->dict:
|
||||||
|
datasets = dict()
|
||||||
|
for ds in Datasets.keys():
|
||||||
|
if Datasets[ds].get('default',False):
|
||||||
|
datasets[ds]=True
|
||||||
|
return datasets
|
||||||
|
|
||||||
#---------------------------------------------
|
#---------------------------------------------
|
||||||
def all_datasets()->dict:
|
def all_datasets()->dict:
|
||||||
datasets = dict()
|
datasets = dict()
|
||||||
@ -646,7 +654,7 @@ def download_weights(opt:dict) -> Union[str, None]:
|
|||||||
precision = 'float32' if opt.full_precision else choose_precision(torch.device(choose_torch_device()))
|
precision = 'float32' if opt.full_precision else choose_precision(torch.device(choose_torch_device()))
|
||||||
|
|
||||||
if opt.yes_to_all:
|
if opt.yes_to_all:
|
||||||
models = recommended_datasets()
|
models = default_dataset() if opt.default_only else recommended_datasets()
|
||||||
access_token = authenticate(opt.yes_to_all)
|
access_token = authenticate(opt.yes_to_all)
|
||||||
if len(models)>0:
|
if len(models)>0:
|
||||||
successfully_downloaded = download_weight_datasets(models, access_token, precision=precision)
|
successfully_downloaded = download_weight_datasets(models, access_token, precision=precision)
|
||||||
@ -808,6 +816,9 @@ def main():
|
|||||||
dest='yes_to_all',
|
dest='yes_to_all',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
help='answer "yes" to all prompts')
|
help='answer "yes" to all prompts')
|
||||||
|
parser.add_argument('--default_only',
|
||||||
|
action='store_true',
|
||||||
|
help='when --yes specified, only install the default model')
|
||||||
parser.add_argument('--config_file',
|
parser.add_argument('--config_file',
|
||||||
'-c',
|
'-c',
|
||||||
dest='config_file',
|
dest='config_file',
|
||||||
|
Loading…
Reference in New Issue
Block a user