Getting SDXL to run on an iPhone without iOS killing the process mid-generation

r/StableDiffusion
Machine Learning Generative AI AI Hardware

I spent a while getting Stable Diffusion working through Core ML on the Neural Engine, and the actual model was never the hard part, memory pressure was. SDXL on a sits right at the edge of what iOS allows before the OS jetsams you. The thing that kept biting was peak memory during pipeline init. The Core ML TextEncoder stage was crashing, and the fix was less about the ML and about ordering and serializing initialization so the memory high-water mark never spiked enough to get the app killed mid-generation. On older devices the margin between "works" and "killed" is uncomfortably thin.