Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb8f43f4

Browse files
author
Lincoln Stein
committed
implemented startup sanity checks on core models
1 parentc4f064b commitb8f43f4

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

‎invokeai/app/api_app.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,10 @@ def find_port(port: int):
203203
returnfind_port(port=port+1)
204204
else:
205205
returnport
206-
206+
207+
frominvokeai.backend.install.check_rootimportcheck_invokeai_root
208+
check_invokeai_root(app_config)# note, may exit with an exception if root not set up
209+
207210
port=find_port(app_config.port)
208211
ifport!=app_config.port:
209212
logger.warn(f"Port{app_config.port} in use, using port{port}")
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
"""
2+
Check that the invokeai_root is correctly configured and exit if not.
3+
"""
4+
importsys
5+
frominvokeai.app.services.configimport (
6+
InvokeAIAppConfig,
7+
)
8+
9+
defcheck_invokeai_root(config:InvokeAIAppConfig):
10+
try:
11+
assertconfig.model_conf_path.exists()
12+
assertconfig.db_path.exists()
13+
assertconfig.models_path.exists()
14+
formodelin [
15+
'CLIP-ViT-bigG-14-laion2B-39B-b160k',
16+
'bert-base-uncased',
17+
'clip-vit-large-patch14',
18+
'sd-vae-ft-mse',
19+
'stable-diffusion-2-clip',
20+
'stable-diffusion-safety-checker']:
21+
assert (config.models_path/f'core/convert/{model}').exists()
22+
except:
23+
print()
24+
print('== STARTUP ABORTED ==')
25+
print('** One or more necessary files is missing from your InvokeAI root directory **')
26+
print('** Please rerun the configuration script to fix this problem. From the launcher, this is option [7] **')
27+
input('Press any key to continue...')
28+
sys.exit(0)
29+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp