Core ML Sampler (Advanced)
The Core ML Sampler, but with start/stop control for real workflows
- coreml_model
- positive
- negative
- latent_image
- LATENT
The plain Core ML Sampler is a straight KSampler replacement - whole-image txt2img or img2img, one denoising pass. The Advanced version is the same engine with KSamplerAdvanced's controls bolted on: start_at_step and end_at_step. That one addition unlocks everything KSamplerAdvanced is used for in real graphs - two-pass hires fix, inpainting where you only denoise the masked region, and staging denoise across separate nodes. If you've ever built a workflow where one KSampler hands a partially-denoised latent to another, you know exactly why this node exists.
The catch with Core ML, of course, is that your model is fixed to one input resolution. So partial denoising works great - same-size latents, fewer steps - but "upscale in the middle" is awkward because the model won't accept the bigger latent. For a true hires fix with a Core ML model you're realistically converting two models at two sizes, or keeping the whole thing at one resolution. Worth knowing before you rebuild your favorite SDXL hires workflow around this.
The inputs that are new vs. the basic sampler
The familiar list is all there - coreml_model, noise_seed, steps, cfg, sampler_name, scheduler, positive (required), plus optional negative and latent_image. On top of those:
- add_noise (
enable/disable) - whether the sampler starts from fresh noise or works from an existing latent. Disable it for the second pass of a two-pass workflow where the first node already added noise. - start_at_step / end_at_step - the denoising window. Start at 0 and end at
stepsfor a full pass; for partial denoising you set the window so one node does, say, steps 0–10 and the next does 10–20, each starting from the previous node's latent. - return_with_leftover_noise (
enable/disable) - whether to hand off a latent that still has noise in it. Enable when a downstream node will keep denoising; disable for final output.
How it behaves with Core ML models
Mechanically it's the same wrapper as the basic sampler: your coreml_model gets wrapped in a standard ComfyUI model patcher and run through the stock KSamplerAdvanced code. The suite's automation applies here too - if the model is an LCM (exposes a timestep_cond input), negative conditioning is dropped and the guidance embedding is injected automatically, so remember to keep CFG low and steps few with distilled models. And the same rules apply: the latent you feed must match the model's fixed conversion size, and a model converted with ORIGINAL attention will run on GPU no matter what compute unit you set.
Output is a LATENT, same as any sampler - decode it with a VAE, or feed it into the next stage of your graph.
Install
Same pack, same drill - Apple Silicon only, coremltools>=9 and coreml-diffusion required:
cd ComfyUI/custom_nodes
git clone https://github.com/aszc-dev/ComfyUI-CoreMLSuite
cd ComfyUI-CoreMLSuite
pip install -r requirements.txt
Or ComfyUI Manager → "Install Custom Nodes" → search "Core ML" → install → restart. And the usual suite reminders: models go in models/unet as unzipped .mlpackage folders, and SDXL models won't run on the Neural Engine - use CPU_AND_GPU or CPU_ONLY for those.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| coreml_model | COREML_UNET | — | |
| add_noise | COMBO | 2 options: enable, disable | |
| noise_seed | INT | 00–18446744073709550000 | — |
| steps | INT | 201–10000 | — |
| cfg | FLOAT | 8.00–100 | — |
| sampler_name | COMBO | 44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38 | |
| scheduler | COMBO | 9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3 | |
| positive | CONDITIONING | — | |
| start_at_step | INT | 00–10000 | — |
| end_at_step | INT | 100000–10000 | — |
| return_with_leftover_noise | COMBO | 2 options: disable, enable | |
| negativeopt | CONDITIONING | — | |
| latent_imageopt | LATENT | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | — |