Skip to content

Commit c067d4a

Browse files
committed
make fix-copies
1 parent a6f995c commit c067d4a

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/diffusers/pipelines/pag/pipeline_pag_sd_3_img2img.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,8 @@ def check_inputs(
549549
prompt,
550550
prompt_2,
551551
prompt_3,
552+
height,
553+
width,
552554
strength,
553555
negative_prompt=None,
554556
negative_prompt_2=None,
@@ -560,6 +562,15 @@ def check_inputs(
560562
callback_on_step_end_tensor_inputs=None,
561563
max_sequence_length=None,
562564
):
565+
if (
566+
height % (self.vae_scale_factor * self.patch_size) != 0
567+
or width % (self.vae_scale_factor * self.patch_size) != 0
568+
):
569+
raise ValueError(
570+
f"`height` and `width` have to be divisible by {self.vae_scale_factor * self.patch_size} but are {height} and {width}."
571+
f"You can use height {height - height % (self.vae_scale_factor * self.patch_size)} and width {width - width % (self.vae_scale_factor * self.patch_size)}."
572+
)
573+
563574
if strength < 0 or strength > 1:
564575
raise ValueError(f"The value of strength should in [0.0, 1.0] but is {strength}")
565576

src/diffusers/pipelines/stable_diffusion_3/pipeline_stable_diffusion_3_inpaint.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,8 @@ def check_inputs(
538538
prompt,
539539
prompt_2,
540540
prompt_3,
541+
height,
542+
width,
541543
strength,
542544
negative_prompt=None,
543545
negative_prompt_2=None,
@@ -549,6 +551,15 @@ def check_inputs(
549551
callback_on_step_end_tensor_inputs=None,
550552
max_sequence_length=None,
551553
):
554+
if (
555+
height % (self.vae_scale_factor * self.patch_size) != 0
556+
or width % (self.vae_scale_factor * self.patch_size) != 0
557+
):
558+
raise ValueError(
559+
f"`height` and `width` have to be divisible by {self.vae_scale_factor * self.patch_size} but are {height} and {width}."
560+
f"You can use height {height - height % (self.vae_scale_factor * self.patch_size)} and width {width - width % (self.vae_scale_factor * self.patch_size)}."
561+
)
562+
552563
if strength < 0 or strength > 1:
553564
raise ValueError(f"The value of strength should in [0.0, 1.0] but is {strength}")
554565

0 commit comments

Comments
 (0)