diff --git a/installer.py b/installer.py index 23adbb342..394c9163c 100644 --- a/installer.py +++ b/installer.py @@ -1259,8 +1259,7 @@ def get_version(force=False): cwd = os.getcwd() try: if os.path.exists('extensions-builtin/sdnext-modernui'): - os.chdir('extensions-builtin/sdnext-modernui') - res = subprocess.run('git rev-parse --abbrev-ref HEAD', capture_output=True, shell=True, check=True) + res = subprocess.run('git rev-parse --abbrev-ref HEAD', capture_output=True, shell=True, check=True, cwd='extensions-builtin/sdnext-modernui') branch_ui = res.stdout.decode(encoding = 'utf8', errors='ignore') if len(res.stdout) > 0 else '' branch_ui = 'dev' if 'dev' in branch_ui else 'main' version['ui'] = branch_ui @@ -1275,8 +1274,7 @@ def get_version(force=False): if os.environ.get('SD_KANVAS_DISABLE', None) is not None: version['kanvas'] = 'disabled' elif os.path.exists('extensions-builtin/sdnext-kanvas'): - os.chdir('extensions-builtin/sdnext-kanvas') - res = subprocess.run('git rev-parse --abbrev-ref HEAD', capture_output=True, shell=True, check=True) + res = subprocess.run('git rev-parse --abbrev-ref HEAD', capture_output=True, shell=True, check=True, cwd='extensions-builtin/sdnext-kanvas') branch_kanvas = res.stdout.decode(encoding = 'utf8', errors='ignore') if len(res.stdout) > 0 else '' branch_kanvas = 'dev' if 'dev' in branch_kanvas else 'main' version['kanvas'] = branch_kanvas diff --git a/modules/sd_models.py b/modules/sd_models.py index 153969632..2fb38f57d 100644 --- a/modules/sd_models.py +++ b/modules/sd_models.py @@ -232,7 +232,7 @@ def move_model(model, device=None, force=False): try: t0 = time.time() try: - if model.device == torch.device('meta'): + if hasattr(model, 'device') and model.device == torch.device('meta'): set_execution_device(model, device) elif hasattr(model, 'to'): model.to(device) diff --git a/modules/ui_javascript.py b/modules/ui_javascript.py index c789535df..392525078 100644 --- a/modules/ui_javascript.py +++ b/modules/ui_javascript.py @@ -84,7 +84,7 @@ def html_css(css: list[str]): head += stylesheet(themecss) log.debug(f'UI theme: css="{themecss}" base="{css}" user="{usercss}"') else: - log.error(f'UI theme: css="{themecss}" not found') + log.error(f'UI theme: css="{themecss}" path="{os.getcwd()}" not found') elif modules.shared.opts.theme_type == 'Modern': theme_folder = next((e.path for e in modules.extensions.extensions if e.name == 'sdnext-modernui'), None) themecss = os.path.join(theme_folder or '', 'themes', f'{modules.shared.opts.gradio_theme}.css')