saharmor / dalle-playground

A playground to generate images from any text prompt using Stable Diffusion (past: using DALL-E Mini)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

images output format changed

dcsan opened this issue · comments

commented

just in case anyone else hit this.

my service that was pulling from dall-e mini model seems to now get images in jpeg format, and the response structure changed.

I guess this change?
cad1753

I'm using node server side to extract, so now extract these fields

    let images, parsed, format

    try {
        // @ts-ignore
        parsed = JsonBigint.parse(response)
        images = parsed.generatedImgs
        format = parsed.generatedImgsFormat // seems to switch between 'png' and 'jpg'
        if (!images) {
            clog.error('cannot parse images from response', { response, data: parsed })
            throw Error('cannot parse images from response')
        }
    } catch (error) {
        clog.error('expection on parsing dalle response', { error, response, data: parsed })
    }
commented

@dcsan that's correct, sorry for the breaking changes. I had to add an extra variable while the response was only a json-version of thegeneratedImgs list.