Open sbkobaidze opened 9 months ago
Hey,
I am trying to upscale image using API and I'm passing base64 png image without head, but I'm still getting this error {"id":"60fed0801d25b2362f63365c8dbd1d5d","message":"can't decode multipart body","name":"bad_request"} here's the code
{"id":"60fed0801d25b2362f63365c8dbd1d5d","message":"can't decode multipart body","name":"bad_request"}
export const sdxlUpscale = async ({ imageString, width, }: { imageString: string width: number }) => { // const req = await fetch(imageUrl) // console.log(imageUrl) // const blob = await req.arrayBuffer() // console.log(blob) const formData = new FormData() formData.append("image", imageString) formData.append("width", 1024) const response = await fetch( `${apiHost}/v1/generation/esrgan-v1-x2plus/image-to-image/upscale`, { method: "POST", headers: { "Content-Type": "multipart/form-data", Accept: "image/png", Authorization: `Bearer ${apiKey}`, }, body: formData, } ) if (!response.ok) { throw new Error(`Non-200 response: ${await response.text()}`) } const data = await response.json() return data }
i am also facing the same error for the text-to-image
Same, the example on the docs is broken
Hey,
I am trying to upscale image using API and I'm passing base64 png image without head, but I'm still getting this error
{"id":"60fed0801d25b2362f63365c8dbd1d5d","message":"can't decode multipart body","name":"bad_request"}
here's the code