CogView4 (supports different length c and uc) by zRzRzRzRzRzRzR · Pull Request #10649 · huggingface/diffusers (original) (raw)

We don't have access to the original codebase yet, so it will be hard to check if it's an oversight. It is weird that we have to do it this way, but if we don't do it (that is having sigmas corresponding to timesteps), the final outputs come out with some residual noise.

Also seems like in my latest update I made a mistake doing timesteps.astype(np.float32) from some local testing. Basically, we want integer timesteps here first (to round down the float values from linspace), but then need float32 timesteps for our scheduler to not raise an error:

raise ValueError(
(
"Passing integer indices (e.g. from `enumerate(timesteps)`) as timesteps to"
" `EulerDiscreteScheduler.step()` is not supported. Make sure to pass"
" one of the `scheduler.timesteps` as a timestep."
),
)

So, it will have to be something like timesteps.astype(np.int64).astype(np.float32) to be consistent with the behaviour when we started updating the PR and to not error out in our scheduler