load method
Load a diffusion model by registry ID through commons lifecycle routing.
Reuses the canonical RunAnywhere.loadModel path with the image-generation
component, exactly like every other modality (VLM/embeddings/…).
DiffusionConfiguration was deleted outright (idl/diffusion_options.proto)
— there is no load-time configuration message left to accept.
Implementation
Future<void> load(String modelId) async {
_ensureInitialized();
_ensureApplePlatform();
final result = await RunAnywhereModelLifecycle.shared.load(
model_pb.ModelLoadRequest(
modelId: modelId,
category: _diffusionCategory,
forceReload: true,
validateAvailability: true,
),
);
if (result.hasError()) {
throw SDKException.modelLoadFailed(
modelId,
result.error.message.isNotEmpty
? result.error.message
: 'Diffusion lifecycle load failed',
);
}
}