Skip to content

Commit

Permalink
Merge pull request #3745 from vladmandic/dev
Browse files Browse the repository at this point in the history
merge dev
  • Loading branch information
vladmandic authored Feb 5, 2025
2 parents 0dad4de + e506ed0 commit 9f12223
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 41 deletions.
12 changes: 10 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log for SD.Next

## Update for 2025-02-05

- refresh dev/master branches

## Update for 2025-02-04

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

## Update for 2025-01-29

Expand Down
2 changes: 1 addition & 1 deletion extensions-builtin/sdnext-modernui
Submodule sdnext-modernui updated 1 files
+1 −0 style.css
42 changes: 9 additions & 33 deletions installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ def check_onnx():
if not installed('onnx', quiet=True):
install('onnx', 'onnx', ignore=True)
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
install('onnxruntime', 'onnxruntime', ignore=True)
install(os.environ.get('ONNXRUNTIME_COMMAND', 'onnxruntime'), ignore=True)
ts('onnx', t_start)


Expand All @@ -555,7 +555,6 @@ def install_cuda():
if args.use_nightly:
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')
else:
# cmd = os.environ.get('TORCH_COMMAND', 'torch==2.5.1+cu124 torchvision==0.20.1+cu124 --index-url https://download.pytorch.org/whl/cu124')
cmd = os.environ.get('TORCH_COMMAND', 'torch==2.6.0+cu126 torchvision==0.21.0+cu126 --index-url https://download.pytorch.org/whl/cu126')
return cmd

Expand Down Expand Up @@ -643,9 +642,7 @@ def install_rocm_zluda():
log.info('Using CPU-only torch')
torch_command = os.environ.get('TORCH_COMMAND', 'torch torchvision')
else:
# Python 3.12 will cause compatibility issues with other dependencies
# ROCm supports Python 3.12 so don't block it but don't advertise it in the error message
check_python(supported_minors=[9, 10, 11, 12], reason='ROCm backend requires Python 3.9, 3.10 or 3.11')
check_python(supported_minors=[9, 10, 11, 12], reason='ROCm backend requires a Python version between 3.9 and 3.12')
if args.use_nightly:
if rocm.version is None or float(rocm.version) >= 6.3: # assume the latest if version check fails
torch_command = os.environ.get('TORCH_COMMAND', '--pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/rocm6.3')
Expand All @@ -660,8 +657,7 @@ def install_rocm_zluda():
elif rocm.version == "6.1":
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')
elif rocm.version == "6.0":
# 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
# 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
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')
elif float(rocm.version) < 5.5: # oldest supported version is 5.5
log.warning(f"ROCm: unsupported version={rocm.version}")
Expand All @@ -671,14 +667,6 @@ def install_rocm_zluda():
# older rocm (5.7) uses torch 2.3 or older
torch_command = os.environ.get('TORCH_COMMAND', f'torch torchvision --index-url https://download.pytorch.org/whl/rocm{rocm.version}')

if sys.version_info < (3, 11):
ort_version = os.environ.get('ONNXRUNTIME_VERSION', None)
if rocm.version is None or float(rocm.version) > 6.0:
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")
else:
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")
install(ort_package, 'onnxruntime-training')

if installed("torch") and device is not None:
if 'Flash attention' in opts.get('sdp_options', ''):
if not installed('flash-attn'):
Expand All @@ -705,9 +693,7 @@ def install_rocm_zluda():

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

Expand All @@ -731,34 +717,24 @@ def install_ipex(torch_command):
if args.use_nightly:
torch_command = os.environ.get('TORCH_COMMAND', '--pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/xpu')
else:
if "linux" in sys.platform:
# default to US server. If The China server is needed, change .../release-whl/stable/xpu/us/ to .../release-whl/stable/xpu/cn/
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/')
if os.environ.get('TRITON_COMMAND', None) is None:
os.environ.setdefault('TRITON_COMMAND', '--pre pytorch-triton-xpu==3.1.0+91b14bf559 --index-url https://download.pytorch.org/whl/nightly/xpu')
# os.environ.setdefault('TENSORFLOW_PACKAGE', 'tensorflow==2.15.1 intel-extension-for-tensorflow[xpu]==2.15.0.2')
else:
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')
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')

install(os.environ.get('OPENVINO_PACKAGE', 'openvino==2024.6.0'), 'openvino', ignore=True)
install(os.environ.get('OPENVINO_COMMAND', 'openvino==2024.6.0'), 'openvino', ignore=True)
install('nncf==2.7.0', ignore=True, no_deps=True) # requires older pandas
install(os.environ.get('ONNXRUNTIME_PACKAGE', 'onnxruntime-openvino'), 'onnxruntime-openvino', ignore=True)
ts('ipex', t_start)
return torch_command


def install_openvino(torch_command):
t_start = time.time()
# Python 3.12 will cause compatibility issues with other dependencies.
# OpenVINO supports Python 3.12 so don't block it but don't advertise it in the error message
check_python(supported_minors=[9, 10, 11, 12], reason='OpenVINO backend requires Python 3.9, 3.10 or 3.11')
check_python(supported_minors=[9, 10, 11, 12], reason='OpenVINO backend requires a Python version between 3.9 and 3.12')
log.info('OpenVINO: selected')
if sys.platform == 'darwin':
torch_command = os.environ.get('TORCH_COMMAND', 'torch==2.3.1 torchvision==0.18.1')
else:
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')
install(os.environ.get('OPENVINO_PACKAGE', 'openvino==2024.6.0'), 'openvino')
install(os.environ.get('ONNXRUNTIME_PACKAGE', 'onnxruntime-openvino'), 'onnxruntime-openvino', ignore=True)

install(os.environ.get('OPENVINO_COMMAND', 'openvino==2024.6.0'), 'openvino')
install('nncf==2.14.1', 'nncf')
os.environ.setdefault('PYTORCH_TRACING_MODE', 'TORCHFX')
if os.environ.get("NEOReadDebugKeys", None) is None:
Expand Down
10 changes: 5 additions & 5 deletions modules/ui_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def create_ui(_blocks: gr.Blocks=None):
enabled = True if i==0 else False
with gr.Accordion(f'ControlNet unit {i+1}', visible= i < num_controlnet_units.value, elem_classes='control-unit') as unit_ui:
with gr.Row():
enabled_cb = gr.Checkbox(enabled, label='', container=False, show_label=False, elem_id=f'control_unit-{i}-enabled')
enabled_cb = gr.Checkbox(enabled, label='Active', container=False, show_label=True, elem_id=f'control_unit-{i}-enabled')
process_id = gr.Dropdown(label="Processor", choices=processors.list_models(), value='None', elem_id=f'control_unit-{i}-process_name')
model_id = gr.Dropdown(label="ControlNet", choices=controlnet.list_models(), value='None', elem_id=f'control_unit-{i}-model_name')
ui_common.create_refresh_button(model_id, controlnet.list_models, lambda: {"choices": controlnet.list_models(refresh=True)}, f'refresh_controlnet_models_{i}')
Expand Down Expand Up @@ -294,7 +294,7 @@ def create_ui(_blocks: gr.Blocks=None):
enabled = True if i==0 else False
with gr.Accordion(f'T2I-Adapter unit {i+1}', visible= i < num_adapter_units.value, elem_classes='control-unit') as unit_ui:
with gr.Row():
enabled_cb = gr.Checkbox(enabled, label='', container=False, show_label=False, elem_id=f'control_unit-{i}-enabled')
enabled_cb = gr.Checkbox(enabled, label='Active', container=False, show_label=True, elem_id=f'control_unit-{i}-enabled')
process_id = gr.Dropdown(label="Processor", choices=processors.list_models(), value='None', elem_id=f'control_unit-{i}-process_name')
model_id = gr.Dropdown(label="Adapter", choices=t2iadapter.list_models(), value='None', elem_id=f'control_unit-{i}-model_name')
ui_common.create_refresh_button(model_id, t2iadapter.list_models, lambda: {"choices": t2iadapter.list_models(refresh=True)}, f'refresh_adapter_models_{i}')
Expand Down Expand Up @@ -339,7 +339,7 @@ def create_ui(_blocks: gr.Blocks=None):
enabled = True if i==0 else False
with gr.Accordion(f'ControlNet-XS unit {i+1}', visible= i < num_controlnet_units.value, elem_classes='control-unit') as unit_ui:
with gr.Row():
enabled_cb = gr.Checkbox(enabled, label='', container=False, show_label=False, elem_id=f'control_unit-{i}-enabled')
enabled_cb = gr.Checkbox(enabled, label='Active', container=False, show_label=True, elem_id=f'control_unit-{i}-enabled')
process_id = gr.Dropdown(label="Processor", choices=processors.list_models(), value='None', elem_id=f'control_unit-{i}-process_name')
model_id = gr.Dropdown(label="ControlNet-XS", choices=xs.list_models(), value='None', elem_id=f'control_unit-{i}-model_name')
ui_common.create_refresh_button(model_id, xs.list_models, lambda: {"choices": xs.list_models(refresh=True)}, f'refresh_xs_models_{i}')
Expand Down Expand Up @@ -387,7 +387,7 @@ def create_ui(_blocks: gr.Blocks=None):
enabled = True if i==0 else False
with gr.Accordion(f'Control-LLLite unit {i+1}', visible= i < num_lite_units.value, elem_classes='control-unit') as unit_ui:
with gr.Row():
enabled_cb = gr.Checkbox(enabled, label='', container=False, show_label=False, elem_id=f'control_unit-{i}-enabled')
enabled_cb = gr.Checkbox(enabled, label='Active', container=False, show_label=True, elem_id=f'control_unit-{i}-enabled')
process_id = gr.Dropdown(label="Processor", choices=processors.list_models(), value='None', elem_id=f'control_unit-{i}-process_name')
model_id = gr.Dropdown(label="Model", choices=lite.list_models(), value='None', elem_id=f'control_unit-{i}-model_name')
ui_common.create_refresh_button(model_id, lite.list_models, lambda: {"choices": lite.list_models(refresh=True)}, f'refresh_lite_models_{i}')
Expand Down Expand Up @@ -433,7 +433,7 @@ def create_ui(_blocks: gr.Blocks=None):
enabled = True if i==0 else False
with gr.Accordion(f'Reference unit {i+1}', visible=True, elem_classes='control-unit') as unit_ui:
with gr.Row():
enabled_cb = gr.Checkbox(enabled, label='', container=False, show_label=False, elem_id=f'control_unit-{i}-enabled')
enabled_cb = gr.Checkbox(enabled, label='Active', container=False, show_label=True, elem_id=f'control_unit-{i}-enabled')
model_id = gr.Dropdown(label="Reference", choices=reference.list_models(), value='Reference', visible=False, elem_id=f'control_unit-{i}-model_name')
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')
reset_btn = ui_components.ToolButton(value=ui_symbols.reset)
Expand Down

0 comments on commit 9f12223

Please sign in to comment.