StreamDiffusion
StreamDiffusion copied to clipboard
How to generate a batch of size=4 when input 1 image using img2img?
I want to generate a batchsize>1 images for one input image with img2img, as the txt2img method,
x_t_latent = torch.randn((self.frame_bff_size, 4, self.latent_height, self.latent_width)).to(
device=self.device, dtype=self.dtype
)
x_t_latent can be setted with frame_bff_size, so i thought
x_t_latent=x_t_latent.repeat((self.frame_bff_size, 1,1,1)) #self.frame_bff_size>1
maybe work for img2img,but got error when excute self.unet_step in self.predict_x0_batch funtion:
x_0_pred_batch, model_pred = self.unet_step(x_t_latent, t_list)
model_pred = self.unet(
RuntimeError: The expanded size of the tensor (6) must match the existing size (5) at non-singleton dimension 0. Target sizes: [6]. Tensor sizes: [5]
I need some help,please.
@jesenzhang Currently, that feature is not supported. We have frame_buffer_size args, but they are designed to improve the throughput and can not be used for parallel image generation. We will also update the pipeline and enable that feature in the future.