Skip to content

[Bug][iOS] SDXL (iOS) Core ML model fails to load because validator expects Unet.mlmodelc but Apple bundle ships chunked UNet files #217

Closed

Description

@kerimala

Description

On iOS, after downloading and selecting the built-in SDXL (iOS) (Core ML) image model, the app fails to load it and shows:

Failed to load model: Missing required model component: Unet.mlmodelc

This appears to be a regression in the Core ML model validation logic, not a bad download or user workflow issue.

Steps to Reproduce

  1. Install the iOS App Store build of Off Grid.
  2. Open the image model picker.
  3. Download/select SDXL (iOS) (Core ML).
  4. Try to load the model.

Expected Behavior

The SDXL iOS Core ML model should load successfully.

Actual Behavior

The app rejects the model with:

Missing required model component: Unet.mlmodelc

Why this looks like a bug

The iOS validator currently requires these files for all Core ML models:

  • TextEncoder.mlmodelc
  • Unet.mlmodelc
  • VAEDecoder.mlmodelc

and for SDXL also:

  • TextEncoder2.mlmodelc

However, Apple’s current apple/coreml-stable-diffusion-xl-base-ios package exposes:

  • TextEncoder.mlmodelc
  • TextEncoder2.mlmodelc
  • UnetChunk1.mlmodelc
  • UnetChunk2.mlmodelc
  • VAEDecoder.mlmodelc

So the app is rejecting a valid SDXL bundle because it assumes SDXL uses a single Unet.mlmodelc.

Likely Regression

This appears to have been introduced by the March 14, 2026 validation hardening commit:

  • 834d78c – prevent CoreML TextEncoder crash in Stable Diffusion pipeline

That change added the pre-load file validation. Earlier SDXL support was added/fixed in:

Suggested Fix

Update the iOS Core ML validator to accept SDXL layouts that use chunked UNet bundles, e.g. UnetChunk1.mlmodelc + UnetChunk2.mlmodelc, instead of requiring only Unet.mlmodelc.

It would also be good to add tests covering both:

  • classic Core ML layouts with Unet.mlmodelc
  • SDXL layouts with chunked UNet bundles

Environment

  • Platform: iOS
  • Install source: App Store
  • Device: iPhone 17 Pro Max
  • iOS version: 26.3.1
  • App version: 0.0.81

Screenshots

Two screenshots are available showing:

  • the SDXL (iOS) (Core ML) model selected in the image model picker
  • the resulting error dialog with Missing required model component: Unet.mlmodelc

Image
Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions