generateImage method

Generate an image from the lifecycle-loaded diffusion model.

The prompt and all generation parameters travel in options. Load a diffusion model first (via load or RunAnywhere.loadModel). Mirrors Swift RunAnywhere.generateImage(_:).

Implementation

Future<DiffusionResult> generateImage(
  DiffusionGenerationOptions options,
) async {
  _ensureInitialized();
  _ensureApplePlatform();
  final modelId = await _requireLoadedModelId();
  _cancelRequested = false;
  return DartBridgeDiffusion.generateProto(
    _toGenerationRequest(options, modelId),
  );
}