chaowenguo commited on
Commit
44dd305
·
verified ·
1 Parent(s): 7ec6188

Update zh.py

Browse files
Files changed (1) hide show
  1. zh.py +7 -8
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
- buffer.seek(0)
285
- with aiohttp.MultipartWriter('form-data') as mpwriter:
286
- mpwriter.append(script.get('prompt')).set_content_disposition('form-data', name='prompt')
287
- mpwriter.append(negative).set_content_disposition('form-data', name='negative')
288
- mpwriter.append(buffer, {'Content-Type':'image/png'}).set_content_disposition('form-data', name='image', filename='image.png')
289
- tail = f'https://chaowenguo-zh{bit}.ms.show/'
290
- outer = False
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: