Skip to content

Decoding Reponse for extra-single-image requests #6320

Answered by westmancurtis
SolusGod asked this question in Q&A
Discussion options

You must be logged in to vote

You are correct, it's because it doesn't return a list, it returns a single dict.

response = requests.post(url=f'{url}/sdapi/v1/extra-single-image', json=payload)

r = response.json()
   
image = Image.open(io.BytesIO(base64.b64decode(r['image'].split(",",1)[0])))

FYI, you can browse all the API request/response details on your local install at 127.0.0.1:7860/docs

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@SolusGod
Comment options

@westmancurtis
Comment options

@SolusGod
Comment options

@kaushal101
Comment options

@kaushal101
Comment options

Answer selected by SolusGod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants