(config) move configure_invokeai script to the config module for easier importing

This commit is contained in:
Eugene Brodsky 2023-01-13 04:09:48 -05:00
parent 071a438745
commit 88526b9294
4 changed files with 15 additions and 10 deletions

View File

@ -210,6 +210,10 @@ class InvokeAiInstance:
Configure the InvokeAI runtime directory
"""
from messages import introduction
introduction()
from ldm.invoke.config import configure_invokeai
configure_invokeai.main()

View File

View File

@ -66,14 +66,6 @@ Config_preamble = '''# This file describes the alternative machine learning mode
# was trained on.
'''
#---------------------------------------------
def introduction():
print(
'''Welcome to InvokeAI. This script will help download the Stable Diffusion weight files
and other large models that are needed for text to image generation. At any point you may interrupt
this program and resume later.\n'''
)
#--------------------------------------------
def postscript(errors: None):
if not any(errors):
@ -817,8 +809,6 @@ def main():
Globals.root = os.path.expanduser(get_root(opt.root) or '')
try:
introduction()
# We check for to see if the runtime directory is correctly initialized.
if Globals.root == '' \
or not os.path.exists(os.path.join(Globals.root,'invokeai.init')):

View File

@ -0,0 +1,11 @@
#!/usr/bin/env python
# Copyright (c) 2022 Lincoln D. Stein (https://github.com/lstein)
# Before running stable-diffusion on an internet-isolated machine,
# run this script from one with internet connectivity. The
# two machines must share a common .cache directory.
import warnings
from ldm.invoke.config import configure_invokeai
if __name__ == '__main__':
configure_invokeai.main()