mixed up beta schedules - linear and sqrt_linear
- Dominant language
- Python
- Stars
- 133k
- Forks
- 15.7k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 153
Description
it seems beta schedules in comfyui are inconsistent with those from diffusers library.
in diffusers, e.g. [euler](https://github.com/huggingface/diffusers/blob/4e54dfe985293df9e6e86828d7a2763d076879f5/src/diffusers/schedulers/scheduling_euler_discrete.py#L152) (it's the same elsewhere):
```
elif beta_schedule == "linear":
self.betas = torch.linspace(beta_start, beta_end, num_train_timesteps, dtype=torch.float32)
elif beta_schedule == "scaled_linear":
# this schedule is very specific to the latent diffusion model.
self.betas = torch.linspace(beta_start**0.5, beta_end**0.5, num_train_timesteps, dtype=torch.float32) ** 2
```
in [comfyui](https://github.com/comfyanonymous/ComfyUI/blob/8a451234b3090db488fbee9740a5f6be2f989253/comfy/ldm/modules/diffusionmodules/util.py#L22):
```
if schedule == "linear":
betas = torch.linspace(linear_start ** 0.5, linear_end ** 0.5, n_timestep, dtype=torch.float64) ** 2
. . .
elif schedule == "sqrt_linear":
betas = torch.linspace(linear_start, linear_end, n_timestep, dtype=torch.float64)
```
are the names simply mistaken or there is a logics behind such swap?
Contributor guide
Assessment
This issue has not been assessed yet.