Phase 2 of the modernization plan: lock the current behavior of the pure math so the Phase 3 refactor cannot silently change it. Unit characterization tests (Tier 0, 64 new): - test_characterization_latents.py: chunk_batch / merge_chunks padding, truncation, and identity contracts. - test_characterization_controlnet.py: expand_inputs / no_control / extract_residual_kwargs / chunk_control shape, dtype, and zero-fill behavior, including the [None]*target contract. - test_characterization_inputs.py: CoreMLInputs.chunks / coreml_kwargs for SD1.5, SDXL base (time_ids len 6), SDXL refiner (time_ids len 5), and LCM (timestep_cond). - test_characterization_sdxl_options.py: add_sdxl_model_options time_ids / text_embeds assembly via a SimpleNamespace fake ModelPatcher and inspect.getclosurevars on the returned model_function_wrapper. - test_characterization_out_name.py: CoreMLConverter out_name encoding for attn_impl suffix, batch/size, ControlNet, LoRA (sorted), SDXL. M2 [Tier 2] golden image anchor (1 new): - test_golden_image.py: posts the SD1.5+CoreML workflow to a local ComfyUI server (auto-skips if unreachable), asserts SHA256 of the generated PNG against tests/m2/goldens/sd15_seed42.sha256; falls back to PSNR >= 40 dB if the hash drifts. Test infra: - pyproject.toml [tool.pytest.ini_options]: unit / m2 / smoke markers, testpaths=tests; rootdir is now this package (was ComfyUI's pytest.ini). - tests/conftest.py: bootstraps sys.path for comfy imports, auto-marks tests by directory, and ignores the maintainer's WIP scaffolds (test_experiments / test_unet_conversion / standalone_test) so they don't break collection. All 85 collected tests pass; two consecutive runs produced identical results (run1: 3.55s, run2: 3.40s).
56 lines
2.1 KiB
TOML
56 lines
2.1 KiB
TOML
[project]
|
|
name = "comfyui-coremlsuite"
|
|
description = "This extension contains a set of custom nodes for ComfyUI that allow you to use Core ML models in your ComfyUI workflows."
|
|
version = "1.0.1"
|
|
license = "MIT"
|
|
requires-python = ">=3.11,<3.12"
|
|
packages = [{ include = "coreml_suite" }]
|
|
dependencies = [
|
|
# Phase 1 baseline pins: matches the apple_env that last produced working
|
|
# conversions. Comfy's checkpoint-safe-loading branch (utils.py:33) is gated
|
|
# on torch>=2.4, so newer torch + numpy 1.23 (ml-sd's pin) breaks at import.
|
|
# Bump the whole set together in Phase 5; do not bump individually.
|
|
"python-coreml-stable-diffusion @ git+https://github.com/apple/ml-stable-diffusion.git@e5d960c41a6a4ab200b8db379194127607b1c590",
|
|
"torch==2.0.1",
|
|
"coremltools==8.2",
|
|
"numpy<1.25",
|
|
"overrides",
|
|
"diffusers>=0.22",
|
|
"peft>=0.6.2",
|
|
"omegaconf>=2.3",
|
|
]
|
|
|
|
[project.urls]
|
|
Repository = "https://github.com/aszc-dev/ComfyUI-CoreMLSuite"
|
|
# Used by Comfy Registry https://comfyregistry.org
|
|
|
|
[tool.comfy]
|
|
PublisherId = "aszc-dev"
|
|
DisplayName = "ComfyUI-CoreMLSuite"
|
|
Icon = ""
|
|
# Pinned to the ComfyUI commit this Phase 1 baseline was validated against.
|
|
# Bump together with the toolchain upgrade in Phase 5.
|
|
requires-comfyui = "==ab5413351eee61f3d7f10c74e75286df0058bb18"
|
|
|
|
[dependency-groups]
|
|
dev = [
|
|
"pillow>=12.2.0",
|
|
"psutil>=7.2.2",
|
|
]
|
|
|
|
[tool.pytest.ini_options]
|
|
# Phase 2: tier markers gate which environment a test needs.
|
|
# - unit: framework-free pure-logic tests (Tier 0; future Phase 3 will run
|
|
# these without ComfyUI on Linux). For now they may still transitively
|
|
# import comfy.
|
|
# - m2: needs an Apple Silicon Mac with the Neural Engine (Tier 2),
|
|
# typically the maintainer's self-hosted runner or local M-series box.
|
|
# - smoke: lightweight checks that need Apple Silicon + coremltools but no
|
|
# ANE/real model (reserved for Phase 4 Tier 1 smoke harness).
|
|
markers = [
|
|
"unit: framework-free unit test (Tier 0)",
|
|
"m2: requires Apple Silicon + Neural Engine (Tier 2)",
|
|
"smoke: macOS-ARM smoke test on a synthetic micro-model (Tier 1)",
|
|
]
|
|
testpaths = ["tests"]
|