Fix big caption bug, and add logging

pull/2/head
Guillermo Rodriguez 2022-12-24 15:38:40 -03:00
parent 07321ee5ee
commit 021e9ce72d
No known key found for this signature in database
GPG Key ID: EC3AB66D5D83B392
2 changed files with 9 additions and 2 deletions

View File

@ -127,7 +127,10 @@ async def open_dgpu_node(
image = convert_from_cv2_to_image(up_img)
logging.info('done')
return image.tobytes()
raw_img = image.tobytes()
logging.info(f'final img size {len(raw_img)} bytes.')
return raw_img
except BaseException as e:
logging.error(e)

View File

@ -23,7 +23,11 @@ PREFIX = 'tg'
def prepare_metainfo_caption(meta: dict) -> str:
meta_str = f'prompt: \"{meta["prompt"]}\"\n'
prompt = meta["prompt"]
if len(prompt) > 256:
prompt = prompt[:256]
meta_str = f'prompt: \"{prompt}\"\n'
meta_str += f'seed: {meta["seed"]}\n'
meta_str += f'step: {meta["step"]}\n'
meta_str += f'guidance: {meta["guidance"]}\n'