mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
make configure script work properly on empty rootdir
This commit is contained in:
parent
15f8132e17
commit
ddb3f4b02b
@ -671,7 +671,8 @@ def initialize_rootdir(root: Path, yes_to_all: bool = False):
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
with open(root / 'invokeai.yaml','w') as f:
|
||||||
|
f.write('#empty invokeai.yaml initialization file')
|
||||||
|
|
||||||
# -------------------------------------
|
# -------------------------------------
|
||||||
def run_console_ui(
|
def run_console_ui(
|
||||||
@ -827,8 +828,6 @@ def main():
|
|||||||
errors = set()
|
errors = set()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
models_to_download = default_user_selections(opt)
|
|
||||||
|
|
||||||
# We check for to see if the runtime directory is correctly initialized.
|
# We check for to see if the runtime directory is correctly initialized.
|
||||||
old_init_file = config.root_path / 'invokeai.init'
|
old_init_file = config.root_path / 'invokeai.init'
|
||||||
new_init_file = config.root_path / 'invokeai.yaml'
|
new_init_file = config.root_path / 'invokeai.yaml'
|
||||||
@ -841,6 +840,7 @@ def main():
|
|||||||
if not config.model_conf_path.exists():
|
if not config.model_conf_path.exists():
|
||||||
initialize_rootdir(config.root_path, opt.yes_to_all)
|
initialize_rootdir(config.root_path, opt.yes_to_all)
|
||||||
|
|
||||||
|
models_to_download = default_user_selections(opt)
|
||||||
if opt.yes_to_all:
|
if opt.yes_to_all:
|
||||||
write_default_options(opt, new_init_file)
|
write_default_options(opt, new_init_file)
|
||||||
init_options = Namespace(
|
init_options = Namespace(
|
||||||
|
@ -95,6 +95,8 @@ class ModelInstall(object):
|
|||||||
prediction_type_helper: Callable[[Path],SchedulerPredictionType]=None,
|
prediction_type_helper: Callable[[Path],SchedulerPredictionType]=None,
|
||||||
access_token:str = None):
|
access_token:str = None):
|
||||||
self.config = config
|
self.config = config
|
||||||
|
with open('log.txt','w') as file:
|
||||||
|
print(config.model_conf_path,file=file)
|
||||||
self.mgr = ModelManager(config.model_conf_path)
|
self.mgr = ModelManager(config.model_conf_path)
|
||||||
self.datasets = OmegaConf.load(Dataset_path)
|
self.datasets = OmegaConf.load(Dataset_path)
|
||||||
self.prediction_helper = prediction_type_helper
|
self.prediction_helper = prediction_type_helper
|
||||||
|
@ -173,6 +173,7 @@ class addModelsForm(CyclingForm, npyscreen.FormMultiPage):
|
|||||||
rely=-3,
|
rely=-3,
|
||||||
when_pressed_function=self.on_back,
|
when_pressed_function=self.on_back,
|
||||||
)
|
)
|
||||||
|
else:
|
||||||
self.ok_button = self.add_widget_intelligent(
|
self.ok_button = self.add_widget_intelligent(
|
||||||
npyscreen.ButtonPress,
|
npyscreen.ButtonPress,
|
||||||
name=done_label,
|
name=done_label,
|
||||||
@ -529,6 +530,8 @@ class addModelsForm(CyclingForm, npyscreen.FormMultiPage):
|
|||||||
ui_sections = [self.starter_pipelines, self.pipeline_models,
|
ui_sections = [self.starter_pipelines, self.pipeline_models,
|
||||||
self.controlnet_models, self.lora_models, self.ti_models]
|
self.controlnet_models, self.lora_models, self.ti_models]
|
||||||
for section in ui_sections:
|
for section in ui_sections:
|
||||||
|
if not 'models_selected' in section:
|
||||||
|
continue
|
||||||
selected = set([section['models'][x] for x in section['models_selected'].value])
|
selected = set([section['models'][x] for x in section['models_selected'].value])
|
||||||
models_to_install = [x for x in selected if not self.all_models[x].installed]
|
models_to_install = [x for x in selected if not self.all_models[x].installed]
|
||||||
models_to_remove = [x for x in section['models'] if x not in selected and self.all_models[x].installed]
|
models_to_remove = [x for x in section['models'] if x not in selected and self.all_models[x].installed]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user