Compare commits
No commits in common. "6ba5bf90ccd8618fb72ec7ddfa8231bca802a2fb" and "8a3c228f9204fc8b0b4c361ce07211854ec9b9f6" have entirely different histories.
6ba5bf90cc
...
8a3c228f92
@ -87,7 +87,7 @@ class DiffuseAPI():
|
|||||||
"prompt": prompt,
|
"prompt": prompt,
|
||||||
"styles": self.styles,
|
"styles": self.styles,
|
||||||
"steps": self.num_steps,
|
"steps": self.num_steps,
|
||||||
"seed": self.seed,
|
"seed": self.ai_seed,
|
||||||
"n_iter": 1,
|
"n_iter": 1,
|
||||||
"height": self.height,
|
"height": self.height,
|
||||||
"width": self.width,
|
"width": self.width,
|
||||||
@ -112,10 +112,17 @@ class DiffuseAPI():
|
|||||||
alive.close()
|
alive.close()
|
||||||
await sess.close()
|
await sess.close()
|
||||||
return None
|
return None
|
||||||
async with aiohttp.ClientSession(self.url) as session:
|
request = await sess.post("/sdapi/v1/txt2img", json=payload)
|
||||||
async with session.head('/') as alive:
|
try:
|
||||||
if alive.status != 200:
|
req_json = await request.json()
|
||||||
|
request.close()
|
||||||
|
await sess.close()
|
||||||
|
return req_json["images", [0]]
|
||||||
|
except:
|
||||||
return None
|
return None
|
||||||
async with session.post("/sdapi/v1/txt2img", json=payload) as image_json:
|
|
||||||
image_data = await image_json.json()
|
|
||||||
return image_data["images"][0]
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user