Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion keras_cv/models/stable_diffusion/stable_diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,9 @@ def generate_image(
+ unconditional_guidance_scale * (latent - unconditional_latent)
)
a_t, a_prev = alphas[index], alphas_prev[index]
latent = ops.cast(latent, latent_prev.dtype)
# Keras backend array need to cast explicitly
target_dtype = latent_prev.dtype
latent = ops.cast(latent, target_dtype)
pred_x0 = (latent_prev - math.sqrt(1 - a_t) * latent) / math.sqrt(
a_t
)
Expand Down