williamberman commited on
Commit
bc7740d
1 Parent(s): 35095e9

Update README for image variation

Browse files
Files changed (1) hide show
  1. README.md +20 -0
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
  ![img](https://huggingface.co/datasets/patrickvonplaten/images/resolve/main/frog.png)
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
  ![img](https://huggingface.co/datasets/patrickvonplaten/images/resolve/main/frog.png)
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
+ ![img](https://huggingface.co/datasets/williamberman/images/resolve/main/frog-variation.png)
56
+
57
  ## Model Architecture
58
 
59
  ### Overview