Skip to content

Commit 02e4dfd

Browse files
Update README.md
1 parent 7480ee0 commit 02e4dfd

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Lambda Diffusers
2+
3+
_Additional models and pipelines for 🤗 Diffusers created by [Lambda Labs](https://lambdalabs.com/)_
4+
5+
![](https://raw.githubusercontent.com/justinpinkney/stable-diffusion/main/assets/im-vars-thin.jpg)
6+
7+
Currently supports a fine-tuned version of Stable Diffusion conditioned on CLIP image embeddings to enabel Image Variations.
8+
9+
[![Open Demo](https://img.shields.io/badge/%CE%BB-Open%20Demo-blueviolet)](https://47725.gradio.app/)
10+
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1JqNbI_kDq_Gth2MIYdsphgNgyGIJxBgB?usp=sharing)
11+
[![Open in Spaces](https://img.shields.io/badge/%F0%9F%A4%97-Open%20in%20Spaces-orange)]()
12+
13+
- Download the weights ported to 🤗 Diffusers [here](https://huggingface.co/lambdalabs/sd-image-variations-diffusers).
14+
- See the original training repo [here](https://github.com/justinpinkney/stable-diffusion).
15+
16+
## Usage
17+
18+
### Installation
19+
20+
```bash
21+
git clone https://github.com/LambdaLabsML/lambda-diffusers.git
22+
cd lambda-diffusers
23+
python -m venv .venv
24+
source .venv/bin/activate
25+
pip install -r requirements.txt
26+
```
27+
28+
```python
29+
from pathlib import Path
30+
from lambda_diffusers import StableDiffusionImageEmbedPipeline
31+
from PIL import Image
32+
import torch
33+
device = "cuda" if torch.cuda.is_available() else "cpu"
34+
pipe = StableDiffusionImageEmbedPipeline.from_pretrained("lambdalabs/sd-image-variations-diffusers")
35+
pipe = pipe.to(device)
36+
im = Image.open("your/input/image/here.jpg")
37+
num_samples = 4
38+
image = pipe(num_samples*[im], guidance_scale=3.0)
39+
image = image["sample"]
40+
base_path = Path("outputs/im2im")
41+
base_path.mkdir(exist_ok=True, parents=True)
42+
for idx, im in enumerate(image):
43+
im.save(base_path/f"{idx:06}.jpg")
44+
```

0 commit comments

Comments
 (0)