File ~/.local/lib/python3.10/site-packages/keras_cv/src/models/stable_diffusion/stable_diffusion.py:203, in StableDiffusionBase.generate_image(self, encoded_text, negative_prompt, batch_size, num_steps, unconditional_guidance_scale, diffusion_noise, seed)
201 if diffusion_noise is not None:
202 diffusion_noise = ops.squeeze(diffusion_noise)
--> 203 if diffusion_noise.shape.rank == 3:
204 diffusion_noise = ops.repeat(
205 ops.expand_dims(diffusion_noise, axis=0), batch_size, axis=0
206 )
207 latent = diffusion_noise
AttributeError: 'tuple' object has no attribute 'rank'
When using a backend other than TF, tensor shapes do not have a rank attribute. Instead, use len(ops.shape(diffusion_noise)) which will work across all backends.
When using the method
generate_image
you get:When using a backend other than TF, tensor shapes do not have a
rank
attribute. Instead, uselen(ops.shape(diffusion_noise))
which will work across all backends.