diff --git a/packages/excalidraw/actions/actionRemoveBackground.tsx b/packages/excalidraw/actions/actionRemoveBackground.tsx index b0099bdfe..23c5fff11 100644 --- a/packages/excalidraw/actions/actionRemoveBackground.tsx +++ b/packages/excalidraw/actions/actionRemoveBackground.tsx @@ -10,7 +10,7 @@ export const actionRemoveBackground = register({ label: "stats.fullTitle", trackEvent: false, viewMode: false, - async perform(elements, appState, _, app) { + async perform(elements, appState, type, app) { const selectedElements = app.scene.getSelectedElements(appState); if ( @@ -63,11 +63,11 @@ export const actionRemoveBackground = register({ for (const [, { file, elements }] of filesToProcess) { const res = await backgroundRemoval.removeBackground(file.dataURL, { - // debug: true, + debug: true, progress: (...args) => { console.log("progress", args); }, - device: "gpu", + device: type === "auto" ? undefined : type, proxyToWorker: true, }); @@ -101,13 +101,29 @@ export const actionRemoveBackground = register({ }, PanelComponent: ({ updateData }) => { return ( - + <> + + + + ); }, });