crowsonkb / k-diffusion

Karras et al. (2022) diffusion models for PyTorch
MIT License
2.26k stars 372 forks source link

Karras samplers: refrain from advancing random generator, allocating unused tensor when gamma==0 #30

Closed Birch-san closed 1 year ago

Birch-san commented 1 year ago

should help with https://github.com/crowsonkb/k-diffusion/issues/25 (giving users more control over determinism), at least for Karras samplers at the default churn=0.

this also eliminates allocation of an unused tensor on every sampler step, which in the case of stable-diffusion was 64kB.

crowsonkb commented 1 year ago

The noise samplers feature should resolve this, allowing the user to choose whether to advance the RNG or not independently of churn/eta.