← All courses

EDGE FDE

Advanced

Diffusion LoRA to Core AI on device

A practical skill for putting a personalized model on a phone. Train a LoRA on a Mac so a catalog diffusion model learns a subject or style. Then merge that change into the base model (bake it: merge the LoRA into the base and export one model file). Export a portable .aimodel resource, and run the personalized generator on the device. You own the model, keep the pictures private, get fast results, and work offline because the model file is stored on the phone. A cloud adapter you swap in at request time does not give you those things.

For someone who can run Python on a Mac and ship a small Xcode 27 app. Pair this with LLM LoRA for your writing style. The two courses teach the same personalization skill in two places: pictures here, writing there.

The real path

Core AI has no documented hot-swap LoRA. That means you cannot load a new adapter on the phone at run time. Do not design an app that tries to attach a LoRA on device. Train the LoRA on a Mac with MPS, or CPU if MPS is missing. Merge it into the base. Export with coreai.diffusion.export, or with torch.export plus coreai-torch. Ship the on-device .aimodel resource folder.

Lessons

  1. What you are building
  2. Pick a base and LoRA idea
  3. Train a LoRA on a Mac
  4. Merge, then export
  5. Run the on-device pipeline
  6. Evaluate generations
  7. End-to-end checklist

Key concepts

Takeaways

Agent briefs

Related courses

PyTorch to Core AI in Xcode · From the metal to the model · Core AI models, typed · Model architectures in plain English · LLM LoRA for your writing style

Official references

apple/coreai-models · coreai-torch docs · Apple Core AI