From cf40702e70ca5296516db5ac6e2a31cd3cf5d6f9 Mon Sep 17 00:00:00 2001 From: junhsss Date: Tue, 28 Mar 2023 07:08:43 +0900 Subject: [PATCH] docs: update README.md --- README.md | 52 +++++++++++++++++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index ad15722..34b09e9 100644 --- a/README.md +++ b/README.md @@ -10,29 +10,36 @@ **Consistency Models** are a new family of generative models that achieve high sample quality without adversarial training. They support _fast one-step generation_ by design, while still allowing for few-step sampling to trade compute for sample quality. +
+ +## Installation + +```sh +$ pip install consistency +``` + ### Note -If you just want to try things out, just do: +You **don't need to install** `consistency` for just trying things out: ```python from diffusers import DiffusionPipeline -pipeline = DiffusionPipeline("consistency/cifar10-32-demo", custom_pipeline="consistency/pipeline") +pipeline = DiffusionPipeline.from_pretrained( + "consistency/cifar10-32-demo", + custom_pipeline="consistency/pipeline", +) pipeline().images[0] # Super Fast Generation! 🤯 ``` -## Installation - -```sh -$ pip install consistency -``` +
## Quickstart ### Basic -Just wrap your favorite _U-Net_ with `Consistency`. 😊 +Just wrap your favorite _U-Net_ with `Consistency`. ```python import torch @@ -53,7 +60,7 @@ samples = consistency.sample(16, steps=5, use_ema=True) `Consistency` is self-contained with the training logic and all necessary schedules. -You can train `Consistency` with **PyTorch Lightning**'s `Trainer` 🚀 +You can train it with **PyTorch Lightning**'s `Trainer` 🚀 ```python from pytorch_lightning import Trainer @@ -64,10 +71,6 @@ trainer.fit(consistency, some_dataloader)
-A complete example can be found in [this **script**](https://github.com/junhsss/consistency-models/blob/main/examples/train.py) or in [this **colab notebook**](https://colab.research.google.com/github/junhsss/consistency-models/blob/main/examples/consistency_models.ipynb). - -Checkout [this **Wandb workspace**](https://wandb.ai/junhsss/consistency?workspace=user-junhsss) for some experiment results. - ### Push to HF Hub Just provide your `model_id` and `token`! @@ -82,16 +85,27 @@ consistency = Consistency( ) ``` -You can safely uninstall `consistency` afterwards. Good luck! 🤞: +You can safely drop `consistency` afterwards. Good luck! 🤞 ```python from diffusers import DiffusionPipeline -pipeline = DiffusionPipeline("your_model_id", custom_pipeline="consistency/pipeline") +pipeline = DiffusionPipeline.from_pretrained( + "your_model_id", + custom_pipeline="consistency/pipeline", +) pipeline().images[0] ``` +
+ +A complete example can be found in [this **script**](https://github.com/junhsss/consistency-models/blob/main/examples/train.py) or in [this **colab notebook**](https://colab.research.google.com/github/junhsss/consistency-models/blob/main/examples/consistency_models.ipynb). + +Checkout [this **Wandb workspace**](https://wandb.ai/junhsss/consistency?workspace=user-junhsss) for some experiment results. + +
+ ## Available Models | model_id | sample_size | @@ -100,10 +114,14 @@ pipeline().images[0] If you've trained some checkpoints. **Share with us! 🤗** +
+ ## Documentation In progress... 🛠 +
+ ## Reference ```bibtex @@ -118,7 +136,3 @@ In progress... 🛠 copyright = {arXiv.org perpetual, non-exclusive license} } ``` - -## Todo - -- [ ] `diffusers` integration. (`ConsistencyPipeline` + `ConsistencyScheduler`)