image_api.py 248 B

123456789
  1. import requests
  2. url = "http://localhost:1337/v1/images/generations"
  3. body = {
  4. "prompt": "heaven for dogs",
  5. "provider": "OpenaiAccount",
  6. "response_format": "b64_json",
  7. }
  8. data = requests.post(url, json=body, stream=True).json()
  9. print(data)