Spaces:
Running
Running
chaowenguo
commited on
Update zh.py
Browse files
zh.py
CHANGED
|
@@ -281,14 +281,13 @@ async def main():
|
|
| 281 |
for script in itertools.islice(scripts, 1, None):
|
| 282 |
buffer = io.BytesIO()
|
| 283 |
PIL.Image.fromarray(frame.to_ndarray(format='rgb24')).save(buffer, format='png')
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
while True:
|
| 292 |
async with client.post(urllib.parse.urljoin(tail, 'start'), data=mpwriter) as _: pass
|
| 293 |
while True:
|
| 294 |
async with client.get(urllib.parse.urljoin(tail, 'get')) as get:
|
|
|
|
| 281 |
for script in itertools.islice(scripts, 1, None):
|
| 282 |
buffer = io.BytesIO()
|
| 283 |
PIL.Image.fromarray(frame.to_ndarray(format='rgb24')).save(buffer, format='png')
|
| 284 |
+
outer = False
|
| 285 |
+
while True:
|
| 286 |
+
with aiohttp.MultipartWriter('form-data') as mpwriter:
|
| 287 |
+
mpwriter.append(script.get('prompt')).set_content_disposition('form-data', name='prompt')
|
| 288 |
+
mpwriter.append(negative).set_content_disposition('form-data', name='negative')
|
| 289 |
+
mpwriter.append(buffer.getvalue(), {'Content-Type':'image/png'}).set_content_disposition('form-data', name='image', filename='image.png')
|
| 290 |
+
tail = f'https://chaowenguo-zh{bit}.ms.show/'
|
|
|
|
| 291 |
async with client.post(urllib.parse.urljoin(tail, 'start'), data=mpwriter) as _: pass
|
| 292 |
while True:
|
| 293 |
async with client.get(urllib.parse.urljoin(tail, 'get')) as get:
|