We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
api = webuiapi.WebUIApi(baseurl=SD_BASE_URL) api.session.headers.update({'Authorization': 'Bearer ' +SD_ACCESS_TOKEN}) api.txt2img(,,use_async=True) #Authorization failed api.txt2img(,,use_async=False) #OK #webuiapi.py: def post_and_get_api_result(self, url, json, use_async): if use_async: import asyncio return asyncio.ensure_future(self.async_post(url=url, json=json)) else: response = self.session.post(url=url, json=json) return self._to_api_result(response) async def async_post(self, url, json): import aiohttp async with aiohttp.ClientSession(timeout=aiohttp.ClientTimeout()) as session: infinite_timeout = aiohttp.ClientTimeout(total=None) auth = aiohttp.BasicAuth(self.session.auth[0], self.session.auth[1]) if self.session.auth else None async with session.post(url, json=json, auth=auth, timeout=infinite_timeout) as response: # infinite_timeout timeout here for timeout fix return await self._to_api_result_async(response)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: