mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
add --no-interactive mode
This commit is contained in:
parent
19b6c671a6
commit
fbfffe028f
@ -7,6 +7,7 @@
|
|||||||
# Coauthor: Kevin Turner http://github.com/keturn
|
# Coauthor: Kevin Turner http://github.com/keturn
|
||||||
#
|
#
|
||||||
print('Loading Python libraries...\n')
|
print('Loading Python libraries...\n')
|
||||||
|
import argparse
|
||||||
import clip
|
import clip
|
||||||
import sys
|
import sys
|
||||||
import transformers
|
import transformers
|
||||||
@ -17,7 +18,6 @@ import zipfile
|
|||||||
import traceback
|
import traceback
|
||||||
import getpass
|
import getpass
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from urllib import request
|
from urllib import request
|
||||||
from tqdm import tqdm
|
from tqdm import tqdm
|
||||||
from omegaconf import OmegaConf
|
from omegaconf import OmegaConf
|
||||||
@ -500,29 +500,39 @@ def download_safety_checker():
|
|||||||
|
|
||||||
#-------------------------------------
|
#-------------------------------------
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
parser = argparse.ArgumentParser(description='InvokeAI model downloader')
|
||||||
|
parser.add_argument('--interactive',
|
||||||
|
dest='interactive',
|
||||||
|
action=argparse.BooleanOptionalAction,
|
||||||
|
default=True,
|
||||||
|
help='run in interactive mode (default)')
|
||||||
|
opt = parser.parse_args()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
introduction()
|
if opt.interactive:
|
||||||
print('** WEIGHT SELECTION **')
|
introduction()
|
||||||
choice = user_wants_to_download_weights()
|
print('** WEIGHT SELECTION **')
|
||||||
if choice != 'skip':
|
choice = user_wants_to_download_weights()
|
||||||
models = select_datasets(choice)
|
if choice != 'skip':
|
||||||
if models is None:
|
models = select_datasets(choice)
|
||||||
if yes_or_no('Quit?',default_yes=False):
|
if models is None:
|
||||||
sys.exit(0)
|
if yes_or_no('Quit?',default_yes=False):
|
||||||
print('** LICENSE AGREEMENT FOR WEIGHT FILES **')
|
sys.exit(0)
|
||||||
access_token = authenticate()
|
print('** LICENSE AGREEMENT FOR WEIGHT FILES **')
|
||||||
print('\n** DOWNLOADING WEIGHTS **')
|
access_token = authenticate()
|
||||||
successfully_downloaded = download_weight_datasets(models, access_token)
|
print('\n** DOWNLOADING WEIGHTS **')
|
||||||
update_config_file(successfully_downloaded)
|
successfully_downloaded = download_weight_datasets(models, access_token)
|
||||||
print('\n** DOWNLOADING SUPPORT MODELS **')
|
update_config_file(successfully_downloaded)
|
||||||
download_bert()
|
else:
|
||||||
download_kornia()
|
print('\n** DOWNLOADING SUPPORT MODELS **')
|
||||||
download_clip()
|
download_bert()
|
||||||
download_gfpgan()
|
download_kornia()
|
||||||
download_codeformer()
|
download_clip()
|
||||||
download_clipseg()
|
download_gfpgan()
|
||||||
download_safety_checker()
|
download_codeformer()
|
||||||
postscript()
|
download_clipseg()
|
||||||
|
download_safety_checker()
|
||||||
|
postscript()
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print('\nGoodbye! Come back soon.')
|
print('\nGoodbye! Come back soon.')
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user