Skip to content

feat(convert): consolidate into one auto-detecting converter node#67

Merged
aszc-dev merged 3 commits into
mainfrom
feat/lcm-any-checkpoint
Jun 13, 2026
Merged

feat(convert): consolidate into one auto-detecting converter node#67
aszc-dev merged 3 commits into
mainfrom
feat/lcm-any-checkpoint

Conversation

@aszc-dev

@aszc-dev aszc-dev commented Jun 13, 2026

Copy link
Copy Markdown
Owner

What

Replaces the model-version dropdown and the separate LCM converter node with a
single Core ML Converter that auto-detects the model version from the
checkpoint. Requires coreml-diffusion>=0.1.5 (convert(model_version=None) +
detect_model_version).

Why

The converter UX was inconsistent: full-distill LCM was only reachable through a
dedicated node whose sole purpose was to autodownload one specific model
(SimianLuo/LCM_Dreamshaper_v7), while the standard converter did not list LCM
at all. Since the conversion behaviour is fully determined by the UNet
architecture, the version is redundant input — the package now infers it.

Changes

  • Auto-detect, no dropdownCoreMLConverter drops the model_version
    input. One node converts SD15 / SDXL / SDXL refiner / full-distill LCM; the
    version is detected from the checkpoint (cross-attention dim + guidance
    embedding). Misdetection raises a clear error naming the observed evidence.
  • LCM node removedCore ML LCM Converter, its single-model autodownload,
    and coreml_suite/lcm/nodes.py are gone. coreml_suite/lcm/utils.py
    (sampler-side timestep_cond patching) is unchanged.
  • Build fix — add a [build-system] (hatchling) and move package discovery
    to [tool.hatch.build.targets.wheel]; the old Poetry-style packages key
    under [project] made the package fail to build under modern setuptools.
  • Depscoreml-diffusion>=0.1.5; diffusers dropped (no longer imported
    directly after the LCM converter removal).
  • The e2e workflow fixture drops its now-invalid model_version input.

Verification

Local ComfyUI (M2 Pro, Python 3.12):

  • Server loads the Suite; Core ML Converter exposes no model_version;
    Core ML LCM Converter is gone (confirmed via /object_info).
  • detect_model_version verified on real checkpoints: LCM_Dreamshaper_v7_4k →
    LCM, v1-5-pruned-emaonly / dreamshaper_8 → SD15, geekyghostLCM_v10
    (LCM-LoRA merge) → SD15 (correctly not LCM).
  • Tier 0: 75 unit tests pass against coreml-diffusion==0.1.5.

Runtime input handling (CoreMLInputs) is untouched — characterization tests unchanged.

aszc-dev added 2 commits June 13, 2026 02:50
- COREML_CONVERT_LCM gains a ckpt_name input: any checkpoint from the
  checkpoints folder, with the canonical SimianLuo single file as the
  default auto-download entry, so workflows saved before this input
  existed keep the old behavior
- conversion routes through the unified
  coreml_diffusion.convert(model_version=LCM) path; the bespoke
  trace/convert pipeline in lcm/converter.py and the dead
  UNet2DConditionModelLCM wrapper are removed
- output naming via compose_out_name; existing cached LCM .mlpackages
  reconvert once due to the new _se attention suffix in the name
- LCM-LoRA merged checkpoints (plain SD1.5 architecture, no guidance
  embedding) are rejected by the package with a pointer to the standard
  converter node + LCM scheduler
- requires coreml-diffusion>=0.1.4 (generic LCM conversion fix)

Verified against a local ComfyUI checkout: the default entry resolves
the Hugging Face single file and cache-hits a previously converted
.mlpackage exposing timestep_cond; an LCM-LoRA merge raises the
explanatory ValueError.
The standard CoreMLConverter now auto-detects the model version from the
checkpoint (coreml-diffusion>=0.1.5, convert(model_version=None)), so:

- the model_version dropdown is gone — one node converts SD15 / SDXL / SDXL
  refiner / full-distill LCM, the version inferred from the UNet architecture
- the dedicated "Core ML LCM Converter" node, its single-model autodownload,
  and coreml_suite/lcm/nodes.py are removed; the converter UX was previously
  inconsistent (LCM only reachable through a separate autodownload-only node,
  while the standard converter did not list LCM at all)

lcm/utils.py (sampler-side timestep_cond patching) is unchanged — runtime LCM
support still keys off the converted UNet exposing timestep_cond.

diffusers is dropped from the dependencies (no longer imported directly after
the LCM converter removal). The e2e workflow fixture drops its now-invalid
model_version input.
@aszc-dev aszc-dev changed the title feat(lcm): convert any full-distill LCM checkpoint feat(convert): consolidate into one auto-detecting converter node Jun 13, 2026
The auto-detect consolidation needs convert(model_version=None) from
coreml-diffusion 0.1.5. requires-python stays pinned to <3.13 to match the
library (coremltools-driven); relaxing it past the library's own cap makes the
dependency unresolvable for the 3.13+ range.
@aszc-dev aszc-dev merged commit 8d28964 into main Jun 13, 2026
2 checks passed
@aszc-dev aszc-dev deleted the feat/lcm-any-checkpoint branch June 13, 2026 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant