Skip to content

Commit

Permalink
bug fix (#2303)
Browse files Browse the repository at this point in the history
  • Loading branch information
haifeng-jin authored and sampathweb committed Jan 31, 2024
1 parent f3c85e9 commit 1474615
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion keras_cv/models/stable_diffusion/stable_diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,10 @@ def generate_image(
latent = self._get_initial_diffusion_noise(batch_size, seed)

# Iterative reverse diffusion stage
timesteps = np.arange(1, 1000, 1000 // num_steps)
num_timesteps = 1000
ratio = (num_timesteps - 1) / (num_steps - 1)
timesteps = (np.arange(0, num_steps) * ratio).round().astype(np.int64)

alphas, alphas_prev = self._get_initial_alphas(timesteps)
progbar = keras.utils.Progbar(len(timesteps))
iteration = 0
Expand Down

0 comments on commit 1474615

Please # to comment.