Help me use the new version of API #15433
Unanswered
TomMacario
asked this question in
Q&A
Replies: 1 comment 1 reply
-
The API hasn't been touched in 3 months. For API details, click the API link at the bottom of the page. Here's a simple txt2img example. import requests
import base64
payload = {
"prompt": "cat",
"steps": 20,
}
response = requests.post(url='http://127.0.0.1:7860/sdapi/v1/txt2img', json=payload)
r = response.json()
with open('output.png', 'wb') as f:
f.write(base64.b64decode(r['images'][0])) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone, I installed stable-diffusion locally, and now I would like to generate images using a python script. I found several examples on the internet. But unfortunately they don't work because it looks like they are using an old version of the api. It looks like the "/sdapi/v1/txt2img" has been replaced by "/api/{api_name}" but I don't understand how to make it work correctly.
Does anyone have the skills to help me?
Beta Was this translation helpful? Give feedback.
All reactions