Skip to main content

Function: resolveBackgroundRemovalProvider()

resolveBackgroundRemovalProvider(id?, config?): Promise<IBackgroundRemovalProvider>

Defined in: packages/agentos/src/io/segmentation/BackgroundRemovalProviderRegistry.ts:79

Resolve a provider: a registered instance first, else a built-in.

Parameters​

id?​

BackgroundRemovalProviderId = 'fal'

Provider id. Defaults to 'fal'.

config?​

BackgroundRemovalProviderConfig = {}

Credentials for a built-in provider; without them it is built from the environment. Either way it is kept for the next call with the same credentials, and calls that resolve it at the same time get the same instance.

Returns​

Promise<IBackgroundRemovalProvider>

Throws​

When the id is unknown or the provider's key is missing.