Suzie1 / ComfyUI_Comfyroll_CustomNodes

Custom nodes for SDXL and SD1.5 including Multi-ControlNet, LoRA, Aspect Ratio, Process Switches, and many more nodes.
https://civitai.com/models/183551/comfyui-comfyroll-custom-nodes
673 stars 88 forks source link

Iterate through the CR Prompt List node and the CR Load Image List node ? #196

Open CatDroid opened 2 months ago

CatDroid commented 2 months ago

Using both the CR Prompt List node and the CR Load Image List node, the output from the CR Load Image List node is connected to the positive input of the Eff.Loader SDXL node, and the output from the CR Load Image List node is connected to ControlNet and then to the cnet_stack input of the Eff.Loader SDXL node. Upon running, it was found that it didn't iterate through all the images and prompts, but only took the first prompt from the CR Prompt List node.

CatDroid commented 2 months ago

What methods does ComfyUI have to iterate over each suggestion word (e.g., M words) and each reference image (e.g., N images) to obtain M*N generated images?

CatDroid commented 2 months ago
class CR_LoadImageList:
         ...
        images = torch.cat(image_list, dim=0)
        images_out = [images[i:i + 1, ...] for i in range(images.shape[0])]

        return (images_out, show_help, )

why torch.cat and then un-pack to images_out ? from list( tensor[1,C, H, W]), to tensor[N, C, H, W] to list( tensor[C, H, W]) ?