Commit Graph
28 Commits
Author SHA1 Message Date
aszc-dev 31774e3324 chore: slim PR to user-facing essentials
Carry only the code, tests, and user-facing docs that matter to end
users; drop the modernization scaffolding accumulated while building it.

- Remove the bench harness, results, and environment captures (bench/).
- Remove internal docs and research spikes (docs/).
- Remove the Makefile; tests run via uv / pytest directly.
- Strip the bench harness and quantization-matrix steps from the Tier 2
  workflow. The golden-image test drives conversion through the Core ML
  Converter node at runtime, so no separate convert step is needed.
- Replace phase/handoff annotations across code, tests, and config with
  neutral docstrings and comments.
2026-05-25 18:37:04 +02:00
aszc-dev 5dafd261b7 refactor(phase3): split pure logic into coreml_suite.core
Phase 3 of the modernization plan: move the framework-free math out of
the comfy-coupled modules so Tier-0 tests can run on plain Linux without
ComfyUI, coremltools, or python_coreml_stable_diffusion.

New pure-core package (no comfy / coreml / mps imports):
- coreml_suite.core.latents: chunk_batch, merge_chunks
- coreml_suite.core.controlnet: expand_inputs, no_control,
  extract_residual_kwargs, chunk_control
- coreml_suite.core.inputs: CoreMLInputs (chunks + coreml_kwargs)
- coreml_suite.core.sdxl: is_sdxl / is_sdxl_base / is_sdxl_refiner,
  build_sdxl_time_ids (base len 6, refiner len 5), build_sdxl_text_embeds,
  sdxl_model_function_wrapper
- coreml_suite.core.naming: compose_out_name, lora_names_from_params

Thin adapters keep the public import paths:
- coreml_suite.latents / coreml_suite.controlnet: re-export from core
- coreml_suite.models: CoreMLModelWrapper, CoreMLModelWrapperLCM,
  add_sdxl_model_options (now uses the pure builders from core.sdxl),
  get_latent_image, get_model_patcher remain framework-coupled
- coreml_suite.nodes: CoreMLConverter.convert now delegates the out_name
  composition to core.naming.compose_out_name

Test infra:
- tests/unit/* re-pointed at coreml_suite.core.*
- test_chunks.py dropped `from comfy.model_management import ...` and
  the dead `model_config` fixture (Phase 1 left it broken; Phase 3
  removes it entirely)
- test_characterization_sdxl_options now targets the pure builders
  directly via inspect.getclosurevars on the wrapper closure
- test_characterization_out_name now calls compose_out_name without the
  heavy CoreMLConverter monkey-patching that Phase 2 needed
- tests/unit/test_tier0_purity.py: new gate that fails if comfy /
  coremltools / etc leak into sys.modules during a pure `-m unit` run
  (skipped in mixed runs where m2 / integration legitimately import them)
- tests/__init__.py + top-level conftest.py + pyproject addopts
  `--import-mode=importlib --confcutdir=tests` together stop pytest from
  importing the repo-root `__init__.py` (the ComfyUI custom-node entry
  pulls in comfy)
- tests/conftest.py adds tier-aware collect_ignore so `-m unit` skips
  tests/m2 + tests/integration at collection time

Verification:
- `pytest -m unit tests/` → 88 passed in ~2s; deterministic across runs
- Tier-0 purity gate confirms no comfy/coreml/etc in sys.modules
- m2 golden image (Phase 2 anchor) still hashes identical → refactor
  produced bit-for-bit unchanged output
- `git diff main -- __init__.py coreml_suite/nodes.py` shows zero churn
  to NODE_CLASS_MAPPINGS keys or INPUT_TYPES field names (public
  workflow contract intact)
2026-05-22 16:08:01 +02:00
aszc-dev b8197c21ef Converting refiner works 2023-11-24 12:14:15 +01:00
aszc-dev 0c78803b25 Base SDXL conversion works 2023-11-24 12:14:15 +01:00
aszc-dev 763ca3961b Handle SDXL config 2023-11-24 12:14:15 +01:00
aszc-dev ae9a9874c5 Add Advanced Sampler node 2023-11-24 12:14:15 +01:00
aszc-dev 67c902f761 Generating SDXL with Core ML Sampler works 2023-11-24 12:14:15 +01:00
aszc-dev 6ccf41e5c9 Refactor LCM sampling 2023-11-09 18:02:37 +01:00
aszc-dev fa0735746c Refactor model config 2023-11-09 00:04:28 +01:00
aszc-dev c26099b334 Add CoreMLInputs to handle inputs 2023-11-08 22:19:41 +01:00
aszc-dev 27f1a19131 Refactor CoreMLModelWrapper 2023-11-08 21:14:55 +01:00
aszc-dev 701443f59e Wrapped Core ML Model is now diffusion_model attribute of BaseModel 2023-11-08 17:51:27 +01:00
aszc-dev 44a380ffdf img2img works 2023-11-03 01:29:32 +01:00
aszc-dev e22d8187cd Add more advanced LCM Sampler 2023-11-03 01:28:34 +01:00
aszc-dev 1937f39cca Add support for CN models to LCM 2023-11-03 01:27:48 +01:00
aszc-dev 8a814b7a56 Fix LCM Sampler 2023-11-03 01:27:48 +01:00
aszc-dev 213088241d LCM Converter works 2023-11-03 01:27:48 +01:00
aszc-dev 9d509ad8f4 WIP: LCM 2023-11-03 01:27:48 +01:00
aszc-dev 0092ad5e75 Prepare LCM Model Wrapper 2023-11-03 01:27:48 +01:00
aszc-dev 99a0a9996d Fix cn chunking 2023-11-03 00:31:46 +01:00
aszc-dev db0aea3d9c Fix chunk_inputs 2023-11-01 22:16:47 +01:00
aszc-dev dfdc1bf520 Fix cn chunking 2023-11-01 01:08:14 +01:00
aszc-dev dd438f66cc Fix controlnet residuals chunking 2023-10-31 21:40:11 +01:00
aszc-dev 41797203d7 Improve chunking and padding 2023-10-31 02:49:35 +01:00
aszc-dev 4d83603c98 Chunking works for ControlNet 2023-10-30 18:16:51 +01:00
aszc-dev 8a3e9332e1 Chunk and pad batches 2023-10-30 16:17:18 +01:00
aszc-dev d0629b4efc Rearrange stuff 2023-10-30 11:15:42 +01:00
aszc-dev 4cd2226148 Add Core ML Sampler 2023-10-29 23:55:18 +01:00