feat: Update CoreML device support and server controls

- Replace 'mps' with 'coreml' as the identifier for Apple CoreML Execution Provider across the codebase.
- Remove Apple chip generation checks and ensure CoreML is available on all macOS arm64 devices.
- Adjust ONNX Runtime session creation to use default CoreML configurations without forcing 'MLProgram'.
- Implement support for MoGe-2 to utilize CoreML with static input shape requirements.
- Enhance server panel to display restart and stop controls consistently across running states, including 'BUSY'.
- Update UI tests to verify new behavior for server controls and cached model display.
- Bump blendjob dependency version to 0.1.16 in packaging tests and configurations.
This commit is contained in:
2026-09-02 10:50:02 +08:00
parent 7f6e47432e
commit 5a011b3b57
24 changed files with 619 additions and 117 deletions

View File

@@ -17,14 +17,14 @@ class ServerPanel(bpy.types.Panel):
def draw(self, _context):
layout = self.layout
running = runtime.server_busy()
busy = runtime.server_busy()
if not runtime.environment_ready():
layout.label(
text="Environment is not installed",
icon="ERROR",
)
setup_row = layout.row()
setup_row.enabled = not running
setup_row.enabled = not busy
setup_row.operator(
"anyimage.setup_ai_environment",
text="Set Up AI Environment…",
@@ -34,6 +34,7 @@ class ServerPanel(bpy.types.Panel):
status = runtime.server_status()
state = status.get("state", "STOPPED")
server_running = state in {"READY", "BUSY"}
icons = {
"READY": "RADIOBUT_ON",
"BUSY": "TIME",
@@ -43,7 +44,7 @@ class ServerPanel(bpy.types.Panel):
"STOPPED": "PAUSE",
}
row = layout.row(align=True)
if state in {"READY", "BUSY"}:
if server_running:
row.label(
text=(
"Running"
@@ -52,18 +53,17 @@ class ServerPanel(bpy.types.Panel):
),
icon=icons[state],
)
if state == "READY":
controls = row.row(align=True)
controls.operator(
"anyimage.restart_server",
text="",
icon="FILE_REFRESH",
)
controls.operator(
"anyimage.stop_server",
text="",
icon="PAUSE",
)
controls = row.row(align=True)
controls.operator(
"anyimage.restart_server",
text="",
icon="FILE_REFRESH",
)
controls.operator(
"anyimage.stop_server",
text="",
icon="PAUSE",
)
elif state == "STOPPED":
row.operator(
"anyimage.start_server",
@@ -82,7 +82,7 @@ class ServerPanel(bpy.types.Panel):
icon="PLAY",
)
if state in {"READY", "BUSY"}:
if server_running:
cached = (
status.get("resources", {})
.get("model_manager", {})
@@ -90,13 +90,19 @@ class ServerPanel(bpy.types.Panel):
)
cached_names = [name for name in cached.values() if name]
cached_row = layout.row(align=True)
cached_row.label(
text=(
f"Cached: {', '.join(cached_names)}"
if cached_names
else "Cached: None"
if len(cached_names) > 1:
cached_list = cached_row.column(align=True)
cached_list.label(text="Cached:")
for name in cached_names:
cached_list.label(text=name)
else:
cached_row.label(
text=(
f"Cached: {cached_names[0]}"
if cached_names
else "Cached: None"
)
)
)
clear = cached_row.row(align=True)
clear.enabled = state == "READY"
clear.operator(