获取task信息失败时不中断请求

master isekai-v1.0.0
落雨楓 2 years ago
parent 40c0f9876f
commit ab52deffb4

@ -1202,13 +1202,10 @@ export class RemoteImageGenerationRequest {
status: bind.status ?? 500, status: bind.status ?? 500,
message: errorData.error, message: errorData.error,
}) })
return
} catch(err) { } catch(err) {
onError({ // don't stop generate when http error
status: bind.status ?? 500,
message: `Error: HTTP ${bind.status} - Unable to reach NovelAI servers. Please wait for a moment and try again`,
})
} }
return
} }
let res = await bind.json() let res = await bind.json()
// console.log('task info', res) // console.log('task info', res)
@ -1241,7 +1238,7 @@ export class RemoteImageGenerationRequest {
message: message:
'Error: Timeout - Unable to reach NovelAI servers. Please wait for a moment and try again', 'Error: Timeout - Unable to reach NovelAI servers. Please wait for a moment and try again',
}) })
}, 3600 * 1000) }, 30 * 1000)
const requestGetGenerationOutput: RequestInit = { const requestGetGenerationOutput: RequestInit = {
mode: 'cors', mode: 'cors',

@ -462,7 +462,7 @@ function ImageGenContent(): JSX.Element {
const [params, actualSetParams] = useState<any>( const [params, actualSetParams] = useState<any>(
getModelDefaultParams(ImageGenerationModels.stableDiffusion) getModelDefaultParams(ImageGenerationModels.stableDiffusion)
) )
const [prompt, setPrompt] = useRememberedValue('imagegen-prompt', [''] as string[]) const [prompt, setPrompt] = useState([''] as string[])
const [promptLines, setPromptLines] = useState([1] as number[]) const [promptLines, setPromptLines] = useState([1] as number[])
const [negPrompt, setNegPrompt] = useRememberedValue('imagegen-negativeprompt', '') const [negPrompt, setNegPrompt] = useRememberedValue('imagegen-negativeprompt', '')

Loading…
Cancel
Save