Skip to content

Commit f91cfcf

Browse files
committed
check_inputs
1 parent 4e9850a commit f91cfcf

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/diffusers/pipelines/omnigen/pipeline_omnigen.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ def check_inputs(
199199
input_images,
200200
height,
201201
width,
202+
use_input_image_size_as_output,
202203
callback_on_step_end_tensor_inputs=None,
203204
max_sequence_length=None,
204205
):
@@ -219,6 +220,12 @@ def check_inputs(
219220
f"`height` and `width` have to be divisible by {self.vae_scale_factor * 2} but are {height} and {width}. Dimensions will be resized accordingly"
220221
)
221222

223+
if use_input_image_size_as_output:
224+
if input_images is None or input_images[0] is None:
225+
raise ValueError(
226+
f"`use_input_image_size_as_output` is set to True, but no input image was found. If you are performing a text-to-image task, please set it to False."
227+
)
228+
222229
if callback_on_step_end_tensor_inputs is not None and not all(
223230
k in self._callback_tensor_inputs for k in callback_on_step_end_tensor_inputs
224231
):
@@ -406,6 +413,7 @@ def __call__(
406413
input_images,
407414
height,
408415
width,
416+
use_input_image_size_as_output,
409417
callback_on_step_end_tensor_inputs=callback_on_step_end_tensor_inputs,
410418
max_sequence_length=max_sequence_length,
411419
)

0 commit comments

Comments
 (0)