@@ -184,18 +184,14 @@ def _generate(
184184 self ,
185185 prompt_ids : jnp .array ,
186186 params : Union [Dict , FrozenDict ],
187- prng_seed : jax .random .PRNGKey ,
188- num_inference_steps : int = 50 ,
189- height : Optional [ int ] = None ,
190- width : Optional [ int ] = None ,
191- guidance_scale : float = 7.5 ,
187+ prng_seed : jax .random .KeyArray ,
188+ num_inference_steps : int ,
189+ height : int ,
190+ width : int ,
191+ guidance_scale : float ,
192192 latents : Optional [jnp .array ] = None ,
193- neg_prompt_ids : jnp .array = None ,
193+ neg_prompt_ids : Optional [ jnp .array ] = None ,
194194 ):
195- # 0. Default height and width to unet
196- height = height or self .unet .config .sample_size * self .vae_scale_factor
197- width = width or self .unet .config .sample_size * self .vae_scale_factor
198-
199195 if height % 8 != 0 or width % 8 != 0 :
200196 raise ValueError (f"`height` and `width` have to be divisible by 8 but are { height } and { width } ." )
201197
@@ -281,15 +277,15 @@ def __call__(
281277 self ,
282278 prompt_ids : jnp .array ,
283279 params : Union [Dict , FrozenDict ],
284- prng_seed : jax .random .PRNGKey ,
280+ prng_seed : jax .random .KeyArray ,
285281 num_inference_steps : int = 50 ,
286282 height : Optional [int ] = None ,
287283 width : Optional [int ] = None ,
288284 guidance_scale : Union [float , jnp .array ] = 7.5 ,
289285 latents : jnp .array = None ,
286+ neg_prompt_ids : jnp .array = None ,
290287 return_dict : bool = True ,
291288 jit : bool = False ,
292- neg_prompt_ids : jnp .array = None ,
293289 ):
294290 r"""
295291 Function invoked when calling the pipeline for generation.
0 commit comments