feat: add reprocess button to re-run AI background removal on image cards
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+12
-1
@@ -328,5 +328,16 @@ export function useImages() {
|
||||
[update],
|
||||
)
|
||||
|
||||
return { items, addFiles, setFeather, setAlphaThreshold, rotate, uploadOne, uploadAll, removeItem, assignProduct }
|
||||
const reprocess = useCallback(
|
||||
(id: string) => {
|
||||
const item = items.find((i) => i.id === id)
|
||||
if (!item) return
|
||||
queueRef.current.enqueue(() =>
|
||||
runPipeline(item.id, item.originalBlob, item.ref, item.feather, item.rotation, item.alphaThreshold)
|
||||
)
|
||||
},
|
||||
[items, runPipeline],
|
||||
)
|
||||
|
||||
return { items, addFiles, setFeather, setAlphaThreshold, rotate, uploadOne, uploadAll, removeItem, assignProduct, reprocess }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user