cancelImageGeneration method
Cancel the current (streaming) image generation.
Sets the cooperative cancel latch; the in-flight CoreML generate cannot be
interrupted, so cancellation takes effect at the next checkpoint (before
the terminal event is emitted). Never throws — mirrors Swift
RunAnywhere.cancelImageGeneration().
Implementation
Future<void> cancelImageGeneration() async {
_cancelRequested = true;
}