warmup
Warms up an Upscaler instance. For more info, see the guide on warming up.
Example
const upscaler = new Upscaler();
upscaler.warmup([{
patchSize: 64,
padding: 2,
}]).then(() => {
console.log('All warmed up!');
});
Parameters
- warmupSizes:
WarmupSizes
- Denotes how to warm the model up. - options?: - A set of warm up arguments.
- signal?:
AbortSignal
- Provides a mechanism to abort the warmup process. For more, see the guides on cancelling requests. - awaitNextFrame?:
boolean
- If provided, upscaler will awaittf.nextFrame()
on each cycle. This allows enhancement operations to more often release the UI thread, and can make enhancement operations more responsive to abort signals or.
- signal?:
WarmupSizes
number
- a number representing both the size (width and height) of the patch.{patchSize: number; padding?: number}
- an object with thepatchSize
and optionalpadding
properties.number[]
- an array of numbers representing the size (width and height) of the patch.{patchSize: number; padding?: number}[]
- an array of objects with thepatchSize
and optionalpadding
properties.
Returns
Promise<void>