Merge branch 'development' into fix-model-load-error-reporting

This commit is contained in:
Lincoln Stein 2022-11-22 16:24:00 +00:00
commit ba9c695463
2 changed files with 14 additions and 1 deletions

View File

@ -17,6 +17,7 @@ import transformers
import traceback
import textwrap
import contextlib
from typing import Union
from omegaconf import OmegaConf
from omegaconf.errors import ConfigAttributeError
from ldm.util import instantiate_from_config, ask_user
@ -388,7 +389,7 @@ class ModelCache(object):
def _has_cuda(self) -> bool:
return self.device.type == 'cuda'
def _cached_sha256(self,path,data) -> str | bytes:
def _cached_sha256(self,path,data) -> Union[str, bytes]:
dirname = os.path.dirname(path)
basename = os.path.basename(path)
base, _ = os.path.splitext(basename)

12
scripts/load_models.py Normal file
View File

@ -0,0 +1,12 @@
#!/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
import configure_invokeai
if __name__ == '__main__':
configure_invokeai.main()