mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix invokeai-configure to use isolated argument-parsing pattern
This commit is contained in:
committed by
psychedelicious
parent
d871fca643
commit
5d16a40b95
@ -6,7 +6,6 @@
|
||||
#
|
||||
# Coauthor: Kevin Turner http://github.com/keturn
|
||||
#
|
||||
import argparse
|
||||
import io
|
||||
import os
|
||||
import shutil
|
||||
@ -38,7 +37,6 @@ from invokeai.backend.install.install_helper import InstallHelper, InstallSelect
|
||||
from invokeai.backend.model_manager import ModelType
|
||||
from invokeai.backend.util import choose_precision, choose_torch_device
|
||||
from invokeai.backend.util.logging import InvokeAILogger
|
||||
from invokeai.frontend.cli.arg_parser import InvokeAIArgs
|
||||
from invokeai.frontend.install.model_install import addModelsForm
|
||||
|
||||
# TO DO - Move all the frontend code into invokeai.frontend.install
|
||||
@ -742,57 +740,12 @@ def is_v2_install(root: Path) -> bool:
|
||||
|
||||
|
||||
# -------------------------------------
|
||||
def main() -> None:
|
||||
def main(opt: Namespace) -> None:
|
||||
global FORCE_FULL_PRECISION # FIXME
|
||||
global config
|
||||
|
||||
parser = argparse.ArgumentParser(description="InvokeAI model downloader")
|
||||
parser.add_argument(
|
||||
"--skip-sd-weights",
|
||||
dest="skip_sd_weights",
|
||||
action=argparse.BooleanOptionalAction,
|
||||
default=False,
|
||||
help="skip downloading the large Stable Diffusion weight files",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--skip-support-models",
|
||||
dest="skip_support_models",
|
||||
action=argparse.BooleanOptionalAction,
|
||||
default=False,
|
||||
help="skip downloading the support models",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--full-precision",
|
||||
dest="full_precision",
|
||||
action=argparse.BooleanOptionalAction,
|
||||
type=bool,
|
||||
default=False,
|
||||
help="use 32-bit weights instead of faster 16-bit weights",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--yes",
|
||||
"-y",
|
||||
dest="yes_to_all",
|
||||
action="store_true",
|
||||
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(
|
||||
"--root_dir",
|
||||
dest="root",
|
||||
type=str,
|
||||
default=None,
|
||||
help="path to root of install directory",
|
||||
)
|
||||
|
||||
opt = parser.parse_args()
|
||||
updates: dict[str, Any] = {}
|
||||
|
||||
InvokeAIArgs.args = opt
|
||||
config = get_config()
|
||||
if opt.full_precision:
|
||||
updates["precision"] = "float32"
|
||||
|
Reference in New Issue
Block a user