Added jsonify base64

This commit is contained in:
root 2023-07-28 05:59:11 +00:00
parent 08a991eab8
commit 9512cac9d2
2 changed files with 8 additions and 2 deletions

5
build_docker.sh Executable file
View File

@ -0,0 +1,5 @@
docker build -t comfy .
docker tag comfy forme2/comfy
docker push forme2/comfy

View File

@ -74,10 +74,11 @@ def run_prompt(job):
for node_id in images:
for image_data in images[node_id]:
image = Image.open(io.BytesIO(image_data))
im_file = BytesIO()
im_file = io.BytesIO()
image.save(im_file, format="JPEG")
im_bytes = im_file.getvalue() # im_bytes: image in binary format.
im_b64 = base64.b64encode(im_bytes)
im_b64 = base64.b64encode(im_bytes)
im_b64 = str(im_b64)
data['images'].append(im_b64)
return data