generate
Generates one image from params as a cold Flow of DiffusionEvents. Each collection runs one generation on the engine thread (collections on the same engine are serialized).
Events, in order:
DiffusionEvent.Progress —
step = 0when sampling starts, then one per completed denoising step (DiffusionPhase.DENOISING); with DiffusionGenerationParams.vaeTiling the VAE tiles follow (DiffusionPhase.VAE_TILES). Progress is buffered, so a slow collector never stalls the sampler.DiffusionEvent.Completed — the last event, with the RGB8 DiffusionImage.
DiffusionEvent.Error — a typed InferenceException (native failure, out of memory, abortActiveGeneration, or close of the engine, reported as InferenceCancelledException). It is terminal: no event follows it and the flow then completes normally.
Cancelling the collector aborts the running generation at its next step boundary and throws CancellationException as usual.
Throws
immediately if the engine is closed.