Skip to content

Commit

Permalink
Update pipeline_stable_diffusion_controlnet.py (huggingface#2917)
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickvonplaten authored Mar 31, 2023
1 parent a5bdb67 commit 7447f75
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -698,15 +698,15 @@ def _default_height_width(self, height, width, image):
if isinstance(image, PIL.Image.Image):
height = image.height
elif isinstance(image, torch.Tensor):
height = image.shape[3]
height = image.shape[2]

height = (height // 8) * 8 # round down to nearest multiple of 8

if width is None:
if isinstance(image, PIL.Image.Image):
width = image.width
elif isinstance(image, torch.Tensor):
width = image.shape[2]
width = image.shape[3]

width = (width // 8) * 8 # round down to nearest multiple of 8

Expand Down

0 comments on commit 7447f75

Please sign in to comment.