add nai diffusion

Signed-off-by: hashcoko <hashcoko@gmail.com>
This commit is contained in:
hashcoko
2023-11-27 07:13:22 +09:00
parent d9e16cc427
commit b69f31caae
12 changed files with 226 additions and 40 deletions

View File

@@ -661,7 +661,7 @@ export async function globalFetch(url:string, arg:{
method: method,
signal: arg.abortSignal
})
addFetchLog("Uint8Array Response", da.ok && da.status >= 200 && da.status < 300)
return {
ok: da.ok && da.status >= 200 && da.status < 300,
@@ -685,6 +685,16 @@ export async function globalFetch(url:string, arg:{
headers: headers,
method: method
})
if(da.headers.get('content-type')?.includes('application/x-zip-compressed')){
const daText = await da.blob()
addFetchLog(daText, da.ok && da.status >= 200 && da.status < 300)
return {
ok: da.ok && da.status >= 200 && da.status < 300,
data: daText,
headers: Object.fromEntries(da.headers)
}
}
const daText = await da.text()
try {
const dat = JSON.parse(daText)