mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 17:24:32 +02:00
+2
-4
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user