Update README for image variation
#9
by williamberman - opened
README.md
CHANGED
|
@@ -17,6 +17,7 @@ Karlo is available in diffusers!
|
|
| 17 |
```python
|
| 18 |
pip install diffusers transformers accelerate safetensors
|
| 19 |
```
|
|
|
|
| 20 |
|
| 21 |
```python
|
| 22 |
from diffusers import UnCLIPPipeline
|
|
@@ -34,6 +35,25 @@ image.save("./frog.png")
|
|
| 34 |
|
| 35 |

|
| 36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
## Model Architecture
|
| 38 |
|
| 39 |
### Overview
|
|
|
|
| 17 |
```python
|
| 18 |
pip install diffusers transformers accelerate safetensors
|
| 19 |
```
|
| 20 |
+
### Text to image
|
| 21 |
|
| 22 |
```python
|
| 23 |
from diffusers import UnCLIPPipeline
|
|
|
|
| 35 |
|
| 36 |

|
| 37 |
|
| 38 |
+
### Image variation
|
| 39 |
+
|
| 40 |
+
```python
|
| 41 |
+
from diffusers import UnCLIPImageVariationPipeline
|
| 42 |
+
import torch
|
| 43 |
+
from PIL import Image
|
| 44 |
+
|
| 45 |
+
pipe = UnCLIPImageVariationPipeline.from_pretrained("kakaobrain/karlo-v1-alpha-image-variations", torch_dtype=torch.float16)
|
| 46 |
+
pipe = pipe.to('cuda')
|
| 47 |
+
|
| 48 |
+
image = Image.open("./frog.png")
|
| 49 |
+
|
| 50 |
+
image = pipe(image).images[0]
|
| 51 |
+
|
| 52 |
+
image.save("./frog-variation.png")
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+

|
| 56 |
+
|
| 57 |
## Model Architecture
|
| 58 |
|
| 59 |
### Overview
|