Nodes/Core ML Suite for ComfyUI/Convert LCM to Core ML
ComfyUI Node

Convert LCM to Core ML

One-click LCM → Core ML, for when 20 steps feels like an eternity

By aszc-dev·Created 3 years ago·Updated 2 months ago· 183
Convert LCM to Core ML
    • coreml_model
    height512
    width512
    batch_size1
    compute_unit
    controlnet_supportfalse

    Latent Consistency Models are the distilling trick that gets you from 20–50 sampling steps down to 4–8 - at the cost of some quality, per the community consensus the KB records. If you're on an Apple Silicon Mac, pairing LCM's few-step generation with the Neural Engine is the closest you get to "fast local diffusion" without owning an NVIDIA card. This node is the shortcut to that combo: it converts the well-known SimianLuo/LCM_Dreamshaper_v7 model to Core ML and saves the result into models/unet.

    The nice part is how little there is to configure. There's no ckpt_name input - the source model is hardcoded - and no attention-implementation dropdown, because the conversion is preset to the ANE-friendly path. You get:

    • height / width - 512–768, multiples of 8. This is the model's fixed input size, so pick your target resolution now; it's baked in.
    • batch_size - default 1; raise it if you generate batches and have the RAM.
    • compute_unit - how the converted model loads (CPU_AND_NE for the Neural Engine).
    • controlnet_support - flip this on before converting if you'll ever want ControlNet on the LCM model; you can't add it later.

    Output is a coreml_model that feeds the Core ML UNet Loader, then the Core ML Sampler. The conversion itself takes a while - the README says "please be patient" - and because the parameters are encoded in the filename, re-running the node with the same settings just loads the cached result instead of converting again.

    Sampling settings that actually matter

    With LCM, the normal ComfyUI defaults are wrong on purpose. The README is blunt about what to set in the Core ML Sampler: sampler_name lcm, scheduler sgm_uniform, low CFG, few steps. This matches what the distillation writeup says about LCM generally - a dedicated sampler, CFG around 1–2, 4–8 steps. Feed it 20 steps at CFG 8 and you'll get oversaturated mush that took longer than it needed to.

    A heads-up about this node's status

    If you're on a recent version of the Core ML Suite (2.x), you may notice this node is missing from your node list. That's not a broken install. The dedicated LCM converter was removed once the main Core ML Converter gained model-version auto-detection - full-distill LCM checkpoints are now detected from the weights and converted through the standard converter node instead. The node still appears in the pack's older docs and indexes (which is why you're here), so if you're on an older install this page is accurate for you; if you're on the current build, just use the regular converter and pick your LCM checkpoint.

    Same install path as the rest of the suite:

    cd ComfyUI/custom_nodes
    git clone https://github.com/aszc-dev/ComfyUI-CoreMLSuite
    cd ComfyUI-CoreMLSuite
    pip install -r requirements.txt
    

    Requires coremltools>=9 and coreml-diffusion, Apple Silicon only.

    CategoryCore ML Suite

    Inputs (5)

    NameTypeDefaultDescription
    heightINT512512–768
    widthINT512512–768
    batch_sizeINT11–64
    compute_unitCOMBO4 options: CPU_AND_NE, CPU_AND_GPU, ALL, CPU_ONLY
    controlnet_supportBOOLEANfalse

    Outputs (1)

    NameTypeDescription
    coreml_modelCOREML_UNET