@@ -741,6 +741,8 @@ def __call__(
741741 prompt : Union [str , List [str ]] = None ,
742742 prompt_2 : Optional [Union [str , List [str ]]] = None ,
743743 prompt_3 : Optional [Union [str , List [str ]]] = None ,
744+ height : Optional [int ] = None ,
745+ width : Optional [int ] = None ,
744746 image : PipelineImageInput = None ,
745747 strength : float = 0.6 ,
746748 num_inference_steps : int = 50 ,
@@ -871,11 +873,15 @@ def __call__(
871873 [`~pipelines.stable_diffusion_3.StableDiffusion3PipelineOutput`] if `return_dict` is True, otherwise a
872874 `tuple`. When returning a tuple, the first element is a list with the generated images.
873875 """
876+ height = height or self .default_sample_size * self .vae_scale_factor
877+ width = width or self .default_sample_size * self .vae_scale_factor
874878 # 1. Check inputs. Raise error if not correct
875879 self .check_inputs (
876880 prompt ,
877881 prompt_2 ,
878882 prompt_3 ,
883+ height ,
884+ width ,
879885 strength ,
880886 negative_prompt = negative_prompt ,
881887 negative_prompt_2 = negative_prompt_2 ,
@@ -944,7 +950,7 @@ def __call__(
944950 pooled_prompt_embeds = torch .cat ([negative_pooled_prompt_embeds , pooled_prompt_embeds ], dim = 0 )
945951
946952 # 3. Preprocess image
947- image = self .image_processor .preprocess (image )
953+ image = self .image_processor .preprocess (image , height = height , width = width )
948954
949955 # 4. Prepare timesteps
950956 timesteps , num_inference_steps = retrieve_timesteps (self .scheduler , num_inference_steps , device , sigmas = sigmas )
0 commit comments