WASasquatch / ASTERR

Abstract Syntax Trees Evaluated Restricted Run (ASTERR) is a Python Script executor for ComfyUI
MIT License
16 stars 5 forks source link

Is it possible to output image batch or image list? #7

Closed cheezecrisp closed 1 month ago

cheezecrisp commented 1 month ago

According to the reference code, this node can output one processed image. If I have more than one to output, how do I accomplish this? I tried to create a function that returns a list of pillow objects and got an error in the pil2tensor function.

WASasquatch commented 1 month ago
pil_images = []
for img in a:
    pil_images.append(tensor2pil(img))

#and

tensor_images = []
for img in pil_images:
    tensor_images.append(pil2tensor(img))

tensor_batch = torch.cat(tensor_images, dim=0)
cheezecrisp commented 1 month ago
pil_images = []
for img in a:
    pil_images.append(tensor2pil(img))

#and

tensor_images = []
for img in pil_images:
    tensor_images.append(pil2tensor(img))

tensor_batch = torch.cat(tensor_images, dim=0)

Dose the node have to allow TORCH to work like this?

WASasquatch commented 1 month ago
pil_images = []
for img in a:
    pil_images.append(tensor2pil(img))

#and

tensor_images = []
for img in pil_images:
    tensor_images.append(pil2tensor(img))

tensor_batch = torch.cat(tensor_images, dim=0)

Yes