BonsaiGenerationRepositoryImpl

internal class BonsaiGenerationRepositoryImpl(mediaStoreGateway: MediaStoreGateway, localDataSource: GenerationResultDataSource.Local, backgroundWorkObserver: BackgroundWorkObserver, val preferenceManager: PreferenceManager, val bonsaiDiffusion: BonsaiDiffusion, val downloadableLocalDataSource: DownloadableModelDataSource.Local, val fileProviderDescriptor: FileProviderDescriptor) : CoreGenerationRepository, BonsaiGenerationRepository(source)

Implements BonsaiGenerationRepository behavior in the SDAI data layer.

Author

Dmitriy Moroz

Constructors

Link copied to clipboard
constructor(mediaStoreGateway: MediaStoreGateway, localDataSource: GenerationResultDataSource.Local, backgroundWorkObserver: BackgroundWorkObserver, preferenceManager: PreferenceManager, bonsaiDiffusion: BonsaiDiffusion, downloadableLocalDataSource: DownloadableModelDataSource.Local, fileProviderDescriptor: FileProviderDescriptor)

Properties

Link copied to clipboard

Exposes the backgroundWorkObserver value used by the SDAI data layer.

Link copied to clipboard

Exposes the bonsaiDiffusion value used by the SDAI data layer.

Link copied to clipboard

Exposes the downloadableLocalDataSource value used by the SDAI data layer.

Link copied to clipboard

Exposes the fileProviderDescriptor value used by the SDAI data layer.

Link copied to clipboard

Exposes the localDataSource value used by the SDAI data layer.

Link copied to clipboard

Exposes the mediaStoreGateway value used by the SDAI data layer.

Link copied to clipboard

Exposes the preferenceManager value used by the SDAI data layer.

Functions

Link copied to clipboard
private fun exportAsync(result: AiGenerationResult)

Executes the exportAsync step in the SDAI data layer.

Link copied to clipboard
protected suspend fun exportToMediaStoreAsync(result: AiGenerationResult)

Executes the exportToMediaStoreAsync step in the SDAI data layer.

Link copied to clipboard
private suspend fun generate(payload: TextToImagePayload, modelPath: String): AiGenerationResult
Link copied to clipboard
open suspend override fun generateFromText(payload: TextToImagePayload): AiGenerationResult
Link copied to clipboard
protected suspend fun getInfoAsync(): MediaStoreInfo

Loads SDAI data through getInfoAsync.

Link copied to clipboard
Link copied to clipboard

Performs the SDAI side effect handled by insertGenerationResult.

Link copied to clipboard
open suspend override fun interruptGeneration()
Link copied to clipboard
open override fun observeStatus(): Flow<LocalDiffusionStatus>
Link copied to clipboard