Skip to content

Commit 9f12223

Browse files
authored
Merge pull request #3745 from vladmandic/dev
merge dev
2 parents 0dad4de + e506ed0 commit 9f12223

File tree

4 files changed

+25
-41
lines changed

4 files changed

+25
-41
lines changed

CHANGELOG.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change Log for SD.Next
22

3+
## Update for 2025-02-05
4+
5+
- refresh dev/master branches
6+
37
## Update for 2025-02-04
48

59
### Highlights for 2025-02-04
@@ -24,8 +28,9 @@ Just one week after latest release and what a week it was with over 50 commits!
2428
- **Docs**:
2529
- Updated [Debugging guide](https://github.com/vladmandic/automatic/wiki/Debug)
2630
- **Torch**:
27-
- for **cuda** environments set default to `torch==2.6.0+cu126`
28-
for **rocm** environments set default to `torch==2.6.0+rocm6.2.4`
31+
- for **cuda** set default to `torch==2.6.0+cu126`
32+
for **rocm** set default to `torch==2.6.0+rocm6.2.4`
33+
for **ipex** set default to `torch==2.6.0+xpu`
2934
*note*: to avoid disruptions sdnext does not perform torch install during in-place upgrades
3035
to force torch upgrade, either start with new installation or use `--reinstall` flag
3136
- support for torch **nightly** builds and nvidia **blackwell** gpus!
@@ -54,6 +59,8 @@ Just one week after latest release and what a week it was with over 50 commits!
5459
- **prompt parser**: add setting to ignore line breaks in prompt
5560
set in *settings -> text encoder -> use line breaks*
5661
- **visual query**: add list of predefined system prompts
62+
- **onnx**: allow manually specifying `onnxruntime` package
63+
set env variable `ONNXRUNTIME_COMMAND` to override default package installation
5764
- **nvml cli**: run nvidia-management-lib interrogate from cli
5865
already available in ui in generate -> right click -> nvidia
5966
> python modules/api/nvml.py
@@ -77,6 +84,7 @@ Just one week after latest release and what a week it was with over 50 commits!
7784
- relax python version checks for rocm
7885
- simplify and improve file wildcard matching
7986
- fix `rich` version
87+
- add cn active label
8088

8189
## Update for 2025-01-29
8290

extensions-builtin/sdnext-modernui

installer.py

+9-33
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ def check_onnx():
544544
if not installed('onnx', quiet=True):
545545
install('onnx', 'onnx', ignore=True)
546546
if not installed('onnxruntime', quiet=True) and not (installed('onnxruntime-gpu', quiet=True) or installed('onnxruntime-openvino', quiet=True) or installed('onnxruntime-training', quiet=True)): # allow either
547-
install('onnxruntime', 'onnxruntime', ignore=True)
547+
install(os.environ.get('ONNXRUNTIME_COMMAND', 'onnxruntime'), ignore=True)
548548
ts('onnx', t_start)
549549

550550

@@ -555,7 +555,6 @@ def install_cuda():
555555
if args.use_nightly:
556556
cmd = os.environ.get('TORCH_COMMAND', 'pip install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cu128 --extra-index-url https://download.pytorch.org/whl/nightly/cu126')
557557
else:
558-
# cmd = os.environ.get('TORCH_COMMAND', 'torch==2.5.1+cu124 torchvision==0.20.1+cu124 --index-url https://download.pytorch.org/whl/cu124')
559558
cmd = os.environ.get('TORCH_COMMAND', 'torch==2.6.0+cu126 torchvision==0.21.0+cu126 --index-url https://download.pytorch.org/whl/cu126')
560559
return cmd
561560

@@ -643,9 +642,7 @@ def install_rocm_zluda():
643642
log.info('Using CPU-only torch')
644643
torch_command = os.environ.get('TORCH_COMMAND', 'torch torchvision')
645644
else:
646-
# Python 3.12 will cause compatibility issues with other dependencies
647-
# ROCm supports Python 3.12 so don't block it but don't advertise it in the error message
648-
check_python(supported_minors=[9, 10, 11, 12], reason='ROCm backend requires Python 3.9, 3.10 or 3.11')
645+
check_python(supported_minors=[9, 10, 11, 12], reason='ROCm backend requires a Python version between 3.9 and 3.12')
649646
if args.use_nightly:
650647
if rocm.version is None or float(rocm.version) >= 6.3: # assume the latest if version check fails
651648
torch_command = os.environ.get('TORCH_COMMAND', '--pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/rocm6.3')
@@ -660,8 +657,7 @@ def install_rocm_zluda():
660657
elif rocm.version == "6.1":
661658
torch_command = os.environ.get('TORCH_COMMAND', 'torch==2.6.0+rocm6.1 torchvision==0.21.0+rocm6.1 --index-url https://download.pytorch.org/whl/rocm6.1')
662659
elif rocm.version == "6.0":
663-
# lock to 2.4.1 instead of 2.5.1 for performance reasons
664-
# there are no support for torch 2.6.0 for rocm 6.0
660+
# lock to 2.4.1 instead of 2.5.1 for performance reasons there are no support for torch 2.6.0 for rocm 6.0
665661
torch_command = os.environ.get('TORCH_COMMAND', 'torch==2.4.1+rocm6.0 torchvision==0.19.1+rocm6.0 --index-url https://download.pytorch.org/whl/rocm6.0')
666662
elif float(rocm.version) < 5.5: # oldest supported version is 5.5
667663
log.warning(f"ROCm: unsupported version={rocm.version}")
@@ -671,14 +667,6 @@ def install_rocm_zluda():
671667
# older rocm (5.7) uses torch 2.3 or older
672668
torch_command = os.environ.get('TORCH_COMMAND', f'torch torchvision --index-url https://download.pytorch.org/whl/rocm{rocm.version}')
673669

674-
if sys.version_info < (3, 11):
675-
ort_version = os.environ.get('ONNXRUNTIME_VERSION', None)
676-
if rocm.version is None or float(rocm.version) > 6.0:
677-
ort_package = os.environ.get('ONNXRUNTIME_PACKAGE', f"--pre onnxruntime-training{'' if ort_version is None else ('==' + ort_version)} --index-url https://pypi.lsh.sh/60 --extra-index-url https://pypi.org/simple")
678-
else:
679-
ort_package = os.environ.get('ONNXRUNTIME_PACKAGE', f"--pre onnxruntime-training{'' if ort_version is None else ('==' + ort_version)} --index-url https://pypi.lsh.sh/{rocm.version[0]}{rocm.version[2]} --extra-index-url https://pypi.org/simple")
680-
install(ort_package, 'onnxruntime-training')
681-
682670
if installed("torch") and device is not None:
683671
if 'Flash attention' in opts.get('sdp_options', ''):
684672
if not installed('flash-attn'):
@@ -705,9 +693,7 @@ def install_rocm_zluda():
705693

706694
def install_ipex(torch_command):
707695
t_start = time.time()
708-
# Python 3.12 will cause compatibility issues with other dependencies
709-
# IPEX supports Python 3.12 so don't block it but don't advertise it in the error message
710-
check_python(supported_minors=[9, 10, 11, 12], reason='IPEX backend requires Python 3.9, 3.10 or 3.11')
696+
check_python(supported_minors=[9, 10, 11, 12], reason='IPEX backend requires a Python version between 3.9 and 3.12')
711697
args.use_ipex = True # pylint: disable=attribute-defined-outside-init
712698
log.info('IPEX: Intel OneAPI toolkit detected')
713699

@@ -731,34 +717,24 @@ def install_ipex(torch_command):
731717
if args.use_nightly:
732718
torch_command = os.environ.get('TORCH_COMMAND', '--pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/xpu')
733719
else:
734-
if "linux" in sys.platform:
735-
# default to US server. If The China server is needed, change .../release-whl/stable/xpu/us/ to .../release-whl/stable/xpu/cn/
736-
torch_command = os.environ.get('TORCH_COMMAND', 'torch==2.5.1+cxx11.abi torchvision==0.20.1+cxx11.abi intel-extension-for-pytorch==2.5.10+xpu oneccl_bind_pt==2.5.0+xpu --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/')
737-
if os.environ.get('TRITON_COMMAND', None) is None:
738-
os.environ.setdefault('TRITON_COMMAND', '--pre pytorch-triton-xpu==3.1.0+91b14bf559 --index-url https://download.pytorch.org/whl/nightly/xpu')
739-
# os.environ.setdefault('TENSORFLOW_PACKAGE', 'tensorflow==2.15.1 intel-extension-for-tensorflow[xpu]==2.15.0.2')
740-
else:
741-
torch_command = os.environ.get('TORCH_COMMAND', 'torch==2.6.0+xpu torchvision==0.21.0+xpu --index-url https://download.pytorch.org/whl/xpu')
720+
torch_command = os.environ.get('TORCH_COMMAND', 'torch==2.6.0+xpu torchvision==0.21.0+xpu --index-url https://download.pytorch.org/whl/xpu')
742721

743-
install(os.environ.get('OPENVINO_PACKAGE', 'openvino==2024.6.0'), 'openvino', ignore=True)
722+
install(os.environ.get('OPENVINO_COMMAND', 'openvino==2024.6.0'), 'openvino', ignore=True)
744723
install('nncf==2.7.0', ignore=True, no_deps=True) # requires older pandas
745-
install(os.environ.get('ONNXRUNTIME_PACKAGE', 'onnxruntime-openvino'), 'onnxruntime-openvino', ignore=True)
746724
ts('ipex', t_start)
747725
return torch_command
748726

749727

750728
def install_openvino(torch_command):
751729
t_start = time.time()
752-
# Python 3.12 will cause compatibility issues with other dependencies.
753-
# OpenVINO supports Python 3.12 so don't block it but don't advertise it in the error message
754-
check_python(supported_minors=[9, 10, 11, 12], reason='OpenVINO backend requires Python 3.9, 3.10 or 3.11')
730+
check_python(supported_minors=[9, 10, 11, 12], reason='OpenVINO backend requires a Python version between 3.9 and 3.12')
755731
log.info('OpenVINO: selected')
756732
if sys.platform == 'darwin':
757733
torch_command = os.environ.get('TORCH_COMMAND', 'torch==2.3.1 torchvision==0.18.1')
758734
else:
759735
torch_command = os.environ.get('TORCH_COMMAND', 'torch==2.3.1+cpu torchvision==0.18.1+cpu --index-url https://download.pytorch.org/whl/cpu')
760-
install(os.environ.get('OPENVINO_PACKAGE', 'openvino==2024.6.0'), 'openvino')
761-
install(os.environ.get('ONNXRUNTIME_PACKAGE', 'onnxruntime-openvino'), 'onnxruntime-openvino', ignore=True)
736+
737+
install(os.environ.get('OPENVINO_COMMAND', 'openvino==2024.6.0'), 'openvino')
762738
install('nncf==2.14.1', 'nncf')
763739
os.environ.setdefault('PYTORCH_TRACING_MODE', 'TORCHFX')
764740
if os.environ.get("NEOReadDebugKeys", None) is None:

modules/ui_control.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ def create_ui(_blocks: gr.Blocks=None):
241241
enabled = True if i==0 else False
242242
with gr.Accordion(f'ControlNet unit {i+1}', visible= i < num_controlnet_units.value, elem_classes='control-unit') as unit_ui:
243243
with gr.Row():
244-
enabled_cb = gr.Checkbox(enabled, label='', container=False, show_label=False, elem_id=f'control_unit-{i}-enabled')
244+
enabled_cb = gr.Checkbox(enabled, label='Active', container=False, show_label=True, elem_id=f'control_unit-{i}-enabled')
245245
process_id = gr.Dropdown(label="Processor", choices=processors.list_models(), value='None', elem_id=f'control_unit-{i}-process_name')
246246
model_id = gr.Dropdown(label="ControlNet", choices=controlnet.list_models(), value='None', elem_id=f'control_unit-{i}-model_name')
247247
ui_common.create_refresh_button(model_id, controlnet.list_models, lambda: {"choices": controlnet.list_models(refresh=True)}, f'refresh_controlnet_models_{i}')
@@ -294,7 +294,7 @@ def create_ui(_blocks: gr.Blocks=None):
294294
enabled = True if i==0 else False
295295
with gr.Accordion(f'T2I-Adapter unit {i+1}', visible= i < num_adapter_units.value, elem_classes='control-unit') as unit_ui:
296296
with gr.Row():
297-
enabled_cb = gr.Checkbox(enabled, label='', container=False, show_label=False, elem_id=f'control_unit-{i}-enabled')
297+
enabled_cb = gr.Checkbox(enabled, label='Active', container=False, show_label=True, elem_id=f'control_unit-{i}-enabled')
298298
process_id = gr.Dropdown(label="Processor", choices=processors.list_models(), value='None', elem_id=f'control_unit-{i}-process_name')
299299
model_id = gr.Dropdown(label="Adapter", choices=t2iadapter.list_models(), value='None', elem_id=f'control_unit-{i}-model_name')
300300
ui_common.create_refresh_button(model_id, t2iadapter.list_models, lambda: {"choices": t2iadapter.list_models(refresh=True)}, f'refresh_adapter_models_{i}')
@@ -339,7 +339,7 @@ def create_ui(_blocks: gr.Blocks=None):
339339
enabled = True if i==0 else False
340340
with gr.Accordion(f'ControlNet-XS unit {i+1}', visible= i < num_controlnet_units.value, elem_classes='control-unit') as unit_ui:
341341
with gr.Row():
342-
enabled_cb = gr.Checkbox(enabled, label='', container=False, show_label=False, elem_id=f'control_unit-{i}-enabled')
342+
enabled_cb = gr.Checkbox(enabled, label='Active', container=False, show_label=True, elem_id=f'control_unit-{i}-enabled')
343343
process_id = gr.Dropdown(label="Processor", choices=processors.list_models(), value='None', elem_id=f'control_unit-{i}-process_name')
344344
model_id = gr.Dropdown(label="ControlNet-XS", choices=xs.list_models(), value='None', elem_id=f'control_unit-{i}-model_name')
345345
ui_common.create_refresh_button(model_id, xs.list_models, lambda: {"choices": xs.list_models(refresh=True)}, f'refresh_xs_models_{i}')
@@ -387,7 +387,7 @@ def create_ui(_blocks: gr.Blocks=None):
387387
enabled = True if i==0 else False
388388
with gr.Accordion(f'Control-LLLite unit {i+1}', visible= i < num_lite_units.value, elem_classes='control-unit') as unit_ui:
389389
with gr.Row():
390-
enabled_cb = gr.Checkbox(enabled, label='', container=False, show_label=False, elem_id=f'control_unit-{i}-enabled')
390+
enabled_cb = gr.Checkbox(enabled, label='Active', container=False, show_label=True, elem_id=f'control_unit-{i}-enabled')
391391
process_id = gr.Dropdown(label="Processor", choices=processors.list_models(), value='None', elem_id=f'control_unit-{i}-process_name')
392392
model_id = gr.Dropdown(label="Model", choices=lite.list_models(), value='None', elem_id=f'control_unit-{i}-model_name')
393393
ui_common.create_refresh_button(model_id, lite.list_models, lambda: {"choices": lite.list_models(refresh=True)}, f'refresh_lite_models_{i}')
@@ -433,7 +433,7 @@ def create_ui(_blocks: gr.Blocks=None):
433433
enabled = True if i==0 else False
434434
with gr.Accordion(f'Reference unit {i+1}', visible=True, elem_classes='control-unit') as unit_ui:
435435
with gr.Row():
436-
enabled_cb = gr.Checkbox(enabled, label='', container=False, show_label=False, elem_id=f'control_unit-{i}-enabled')
436+
enabled_cb = gr.Checkbox(enabled, label='Active', container=False, show_label=True, elem_id=f'control_unit-{i}-enabled')
437437
model_id = gr.Dropdown(label="Reference", choices=reference.list_models(), value='Reference', visible=False, elem_id=f'control_unit-{i}-model_name')
438438
model_strength = gr.Slider(label="CN Strength", minimum=0.01, maximum=1.0, step=0.01, value=1.0, visible=False, elem_id=f'control_unit-{i}-strength')
439439
reset_btn = ui_components.ToolButton(value=ui_symbols.reset)

0 commit comments

Comments
 (0)