Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix width height error #20

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion model/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pipeline/pipeline_sd_xl_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
4 changes: 2 additions & 2 deletions pipeline/pipeline_sd_xl_adapter_controlnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)}"
Expand Down
2 changes: 1 addition & 1 deletion pipeline/pipeline_sd_xl_adapter_controlnet_img2img.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down