diff --git a/src/diffusers/image_processor.py b/src/diffusers/image_processor.py index 4f6f4bd52b9c..dcde6f0db249 100644 --- a/src/diffusers/image_processor.py +++ b/src/diffusers/image_processor.py @@ -120,8 +120,8 @@ def __init__( if do_convert_rgb and do_convert_grayscale: raise ValueError( "`do_convert_rgb` and `do_convert_grayscale` can not both be set to `True`," - " if you intended to convert the image into RGB format, please set `do_convert_grayscale = False`.", - " if you intended to convert the image into grayscale format, please set `do_convert_rgb = False`", + " if you intended to convert the image into RGB format, please set `do_convert_grayscale = False`." + " if you intended to convert the image into grayscale format, please set `do_convert_rgb = False`" ) @staticmethod diff --git a/src/diffusers/pipelines/deprecated/spectrogram_diffusion/pipeline_spectrogram_diffusion.py b/src/diffusers/pipelines/deprecated/spectrogram_diffusion/pipeline_spectrogram_diffusion.py index ead87da95c87..c5a6a6a9e616 100644 --- a/src/diffusers/pipelines/deprecated/spectrogram_diffusion/pipeline_spectrogram_diffusion.py +++ b/src/diffusers/pipelines/deprecated/spectrogram_diffusion/pipeline_spectrogram_diffusion.py @@ -249,7 +249,7 @@ def __call__( if callback is not None and i % callback_steps == 0: callback(i, full_pred_mel) - logger.info("Generated segment", i) + logger.info("Generated segment %d", i) if output_type == "np" and not is_onnx_available(): raise ValueError( diff --git a/src/diffusers/pipelines/wan/image_processor.py b/src/diffusers/pipelines/wan/image_processor.py index fa18150fcc6e..0e58ec1beb08 100644 --- a/src/diffusers/pipelines/wan/image_processor.py +++ b/src/diffusers/pipelines/wan/image_processor.py @@ -72,8 +72,8 @@ def __init__( if do_convert_rgb and do_convert_grayscale: raise ValueError( "`do_convert_rgb` and `do_convert_grayscale` can not both be set to `True`," - " if you intended to convert the image into RGB format, please set `do_convert_grayscale = False`.", - " if you intended to convert the image into grayscale format, please set `do_convert_rgb = False`", + " if you intended to convert the image into RGB format, please set `do_convert_grayscale = False`." + " if you intended to convert the image into grayscale format, please set `do_convert_rgb = False`" ) def _resize_and_fill( diff --git a/tests/others/test_image_processor.py b/tests/others/test_image_processor.py index 88e82ab54b82..bce07a3e7706 100644 --- a/tests/others/test_image_processor.py +++ b/tests/others/test_image_processor.py @@ -308,3 +308,16 @@ def test_vae_image_processor_resize_np(self): assert out_np.shape == exp_np_shape, ( f"resized image output shape '{out_np.shape}' didn't match expected shape '{exp_np_shape}'." ) + + def test_rgb_and_grayscale_conflict_message_is_one_string(self): + # The ValueError used to be raised with two arguments, so str(e) rendered the tuple + # repr and the second half of the guidance arrived wrapped in quotes and parentheses. + with self.assertRaises(ValueError) as ctx: + VaeImageProcessor(do_convert_rgb=True, do_convert_grayscale=True) + + assert len(ctx.exception.args) == 1 + message = str(ctx.exception) + assert message.startswith("`do_convert_rgb` and `do_convert_grayscale` can not both be set to `True`,") + assert "please set `do_convert_grayscale = False`" in message + assert "please set `do_convert_rgb = False`" in message + assert not message.startswith("(")