diff --git a/docker/frontend/src/engine/superRes.ts b/docker/frontend/src/engine/superRes.ts index 4df9e35..2652241 100644 --- a/docker/frontend/src/engine/superRes.ts +++ b/docker/frontend/src/engine/superRes.ts @@ -51,6 +51,9 @@ function load(): Promise { ort.env.wasm.numThreads = self.crossOriginIsolated ? Math.min(8, navigator.hardwareConcurrency || 1) : 1; + // A laptop with two GPUs would otherwise hand this to the one built into + // the processor. The model is the export, so ask for the fast one. + ort.env.webgpu.powerPreference = 'high-performance'; const session = await ort.InferenceSession.create(MODEL_URL, { executionProviders: ['webgpu'] }).catch(() => ort.InferenceSession.create(MODEL_URL, { executionProviders: ['wasm'] }) );