add gradually inpainting mode

This commit is contained in:
Qing
2022-06-13 16:50:51 +08:00
parent d43d0694c2
commit 335685d581
15 changed files with 246 additions and 6 deletions

View File

@@ -192,3 +192,13 @@ export function isMidClick(ev: SyntheticEvent) {
const mouseEvent = ev.nativeEvent as MouseEvent
return mouseEvent.button === 1
}
export function srcToFile(src: string, fileName: string, mimeType: string) {
return fetch(src)
.then(function (res) {
return res.arrayBuffer()
})
.then(function (buf) {
return new File([buf], fileName, { type: mimeType })
})
}