diff --git a/model/adapter.py b/model/adapter.py index abe9bc8..b9ebce4 100644 --- a/model/adapter.py +++ b/model/adapter.py @@ -281,7 +281,9 @@ def forward(self, x, t=None): t = self.time_proj(t) # b, 320 t = t.to(dtype=x[0].dtype) t = self.time_embedding(t) # b, 1280 - output_size = (b, 640, 128, 128) # last CA layer output + # output_size = (b, 640, 128, 128) # last CA layer output + output_size = (b, 640, (x[0].shape)[2] * 4 , (x[0].shape)[3] * 4) # last CA layer output should suit to the input size CSR + for i in range(len(self.channels)): for j in range(self.nums_rb): idx = i * self.nums_rb + j diff --git a/pipeline/pipeline_sd_xl_adapter.py b/pipeline/pipeline_sd_xl_adapter.py index db6643f..418561c 100644 --- a/pipeline/pipeline_sd_xl_adapter.py +++ b/pipeline/pipeline_sd_xl_adapter.py @@ -1341,7 +1341,7 @@ def prepare_xl_latents_from_sd_1_5( image = self.vae_sd1_5.decode(latent / self.vae_sd1_5.config.scaling_factor, return_dict=False)[0] do_denormalize = [True] * image.shape[0] image = self.image_processor_sd1_5.postprocess(image, output_type='pil', do_denormalize=do_denormalize)[0] - image = image.resize((height, width)) + image = image.resize((width, height)) # image.save('./test_img/image_sd1_5.jpg') # input() diff --git a/pipeline/pipeline_sd_xl_adapter_controlnet.py b/pipeline/pipeline_sd_xl_adapter_controlnet.py index ef6192d..b2a361c 100644 --- a/pipeline/pipeline_sd_xl_adapter_controlnet.py +++ b/pipeline/pipeline_sd_xl_adapter_controlnet.py @@ -1727,8 +1727,8 @@ def prepare_xl_latents_from_sd_1_5( image = self.vae_sd1_5.decode(latent / self.vae_sd1_5.config.scaling_factor, return_dict=False)[0] do_denormalize = [True] * image.shape[0] image = self.image_processor_sd1_5.postprocess(image, output_type='pil', do_denormalize=do_denormalize)[0] - image = image.resize((height, width)) - + image = image.resize((width, height)) + if not isinstance(image, (torch.Tensor, PIL.Image.Image, list)): raise ValueError( f"`image` has to be of type `torch.Tensor`, `PIL.Image.Image` or list but is {type(image)}" diff --git a/pipeline/pipeline_sd_xl_adapter_controlnet_img2img.py b/pipeline/pipeline_sd_xl_adapter_controlnet_img2img.py index 94bc92e..86bf82d 100644 --- a/pipeline/pipeline_sd_xl_adapter_controlnet_img2img.py +++ b/pipeline/pipeline_sd_xl_adapter_controlnet_img2img.py @@ -1818,7 +1818,7 @@ def prepare_xl_latents_from_sd_1_5( image = self.vae_sd1_5.decode(latent / self.vae_sd1_5.config.scaling_factor, return_dict=False)[0] do_denormalize = [True] * image.shape[0] image = self.image_processor_sd1_5.postprocess(image, output_type='pil', do_denormalize=do_denormalize)[0] - image = image.resize((height, width)) + image = image.resize((width, height)) # image.save('./test_img/image_sd1_5.jpg') # input()