keras-team / keras-cv

Industry-strength Computer Vision workflows with Keras
Other
1.01k stars 331 forks source link

stable_diffusion vs diffusion_model #2362

Closed Reginald-L closed 8 months ago

Reginald-L commented 9 months ago

there are two py files: stable_diffusion.py and diffusion_model.py, what is the difference between these two names stable diffusion and diffusion model? image

sachinprasadhs commented 9 months ago

stable_diffusion.py is base class for StableDiffusion, where as diffusion_model.py ( Diffusion Model) is the sub-component of StableDiffusion.

tirthasheshpatel commented 8 months ago

To add on to @sachinprasadhs's answer, diffusion_model.py is just the UNet for predicting the noise distribution. The stable_diffusion.py file brings all the components together (i.e. the text encoder, noise scheduler, time step embeddings, the diffusion UNet, and the image decoder) to provide the users an end-to-end text-to-image model for inference.

I hope this answers your question! I am closing this issue but feel free to reopen if you have further questions.