From 8e6cca80808375f990b3f604722121769eaae615 Mon Sep 17 00:00:00 2001 From: Patrick von Platen <patrick.v.platen@gmail.com> Date: Tue, 8 Nov 2022 17:56:09 +0100 Subject: [PATCH] Add link to diffusers --- README.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/README.md b/README.md index c23f4f3..e3d7a97 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,38 @@ Aside from the **NCSN++** and **DDPM++** models in our paper, this codebase also It supports training new models, evaluating the sample quality and likelihoods of existing models. We carefully designed the code to be modular and easily extensible to new SDEs, predictors, or correctors. +## **Integration with 🤗 Diffusers library** + +Most models are now also available in 🧨 Diffusers and accesible via the [ScoreSdeVE pipeline](https://huggingface.co/docs/diffusers/api/pipelines/score_sde_ve). + +Diffusers allows you to test score sde based models in PyTorch in just a couple lines of code. + +You can install diffusers as follows: + +``` +pip install diffusers torch accelerate +``` + +And then try out the models with just a couple lines of code: + +```python +from diffusers import DiffusionPipeline + +model_id = "google/ncsnpp-ffhq-1024" + +# load model and scheduler +sde_ve = DiffusionPipeline.from_pretrained(model_id) + +# run pipeline in inference (sample random noise and denoise) +image = sde_ve().images[0] + + +# save image +image[0].save("sde_ve_generated_image.png") +``` + +More models can be found directly [on the Hub](https://huggingface.co/models?library=diffusers&pipeline_tag=unconditional-image-generation&sort=downloads&search=ncsnpp). + ## JAX version Please find a JAX implementation [here](https://github.com/yang-song/score_sde), which additionally supports class-conditional generation with a pre-trained classifier, and resuming an evalution process after pre-emption. -- GitLab