mirror of
https://github.com/vladmandic/automatic
synced 2026-09-20 01:31:13 +02:00
make tensorflow optional
This commit is contained in:
@@ -7,6 +7,7 @@ Stuff to be fixed...
|
||||
- ClipSkip not updated on read gen info
|
||||
- Usage of `sd_vae` in quick settings
|
||||
- Run VAE with hires at 1280
|
||||
- Make TensorFlow optional
|
||||
|
||||
|
||||
## Features
|
||||
|
||||
Submodule extensions-builtin/sd-webui-controlnet updated: 68e4acf7c9...a8f45816e3
+1
-1
Submodule modules/lora updated: b824bbfce6...25c8279f26
@@ -40,7 +40,7 @@ def load_models(model_path: str, model_url: str = None, command_path: str = None
|
||||
|
||||
for place in places:
|
||||
if os.path.exists(place):
|
||||
for file in glob.iglob(place + '**/**', recursive=True):
|
||||
for file in glob.iglob(os.path.join(place, '**/**'), recursive=True):
|
||||
full_path = file
|
||||
if os.path.isdir(full_path):
|
||||
continue
|
||||
|
||||
+5
-2
@@ -205,8 +205,11 @@ def list_samplers():
|
||||
def list_themes():
|
||||
if not os.path.exists(os.path.join('javascript', 'themes.json')):
|
||||
refresh_themes()
|
||||
with open(os.path.join('javascript', 'themes.json'), mode='r', encoding='utf=8') as f:
|
||||
res = json.loads(f.read())
|
||||
if os.path.exists(os.path.join('javascript', 'themes.json')):
|
||||
with open(os.path.join('javascript', 'themes.json'), mode='r', encoding='utf=8') as f:
|
||||
res = json.loads(f.read())
|
||||
else:
|
||||
res = []
|
||||
builtin = ["black-orange", "gradio/default", "gradio/base", "gradio/glass", "gradio/monochrome", "gradio/soft"]
|
||||
themes = builtin + [x['id'] for x in res if x['status'] == 'RUNNING' and 'test' not in x['id'].lower()]
|
||||
return themes
|
||||
|
||||
@@ -59,7 +59,6 @@ numexpr==2.8.4
|
||||
pandas==1.5.3
|
||||
protobuf==3.20.3
|
||||
pytorch_lightning==1.9.4
|
||||
tensorflow==2.12.0
|
||||
transformers==4.26.1
|
||||
timm==0.6.13
|
||||
tomesd==0.1.2
|
||||
|
||||
@@ -214,6 +214,11 @@ def check_torch():
|
||||
install(f'--no-deps {xformers_package}', ignore=True)
|
||||
except Exception as e:
|
||||
log.debug(f'Cannot install xformers package: {e}')
|
||||
try:
|
||||
tensorflow_package = os.environ.get('TENSORFLOW_PACKAGE', 'tensorflow==2.12.0')
|
||||
install(f'--no-deps {tensorflow_package}', ignore=True)
|
||||
except Exception as e:
|
||||
log.debug(f'Cannot install tensorflow package: {e}')
|
||||
|
||||
|
||||
# install required packages
|
||||
@@ -363,6 +368,7 @@ def set_environment():
|
||||
os.environ.setdefault('GRADIO_ANALYTICS_ENABLED', 'False')
|
||||
os.environ.setdefault('SAFETENSORS_FAST_GPU', '1')
|
||||
os.environ.setdefault('NUMEXPR_MAX_THREADS', '16')
|
||||
os.environ.setdefault('PYTORCH_ENABLE_MPS_FALLBACK', '1')
|
||||
|
||||
|
||||
def check_extensions():
|
||||
|
||||
Reference in New Issue
Block a user