CoreML
.mlpackage versions of
SimianLuo/LCM_Dreamshaper_v7 configured for inpainting, palettized per Apple's LCM recommendation (TextEncoder/VAE at 6-bit, UNet at 8-bit).
Used by
SHxTLxST iOS app for lifestyle image generation from masked product photos.
1import CoreML
2
3let config = MLModelConfiguration()
4config.computeUnits = .all // ANE + GPU + CPU
5
6let textEncoder = try TextEncoder(configuration: config)
7let unet = try Unet(configuration: config)
8let vaeEncoder = try VAEEncoder(configuration: config)
9let vaeDecoder = try VAEDecoder(configuration: config)
For inference, see
apple/ml-stable-diffusion — this package is drop-in compatible, with the UNet modified to accept a 9-channel input (4 latent + 4 masked image latent + 1 mask) per the inpainting convention.
Original SD 1.5: CreativeML Open RAIL-M. The CoreML conversion is a derivative work; this repo inherits the Open RAIL-M license.