patrickvonplaten
commited on
Commit
•
8c4798e
1
Parent(s):
5fe03ce
Update README.md
Browse files
README.md
CHANGED
@@ -46,16 +46,34 @@ The exact dependencies is got using `pip freeze` and can be found in `exact_requ
|
|
46 |
|
47 |
Check our jupyter notebooks with examples in `./examples` folder
|
48 |
|
49 |
-
###
|
50 |
|
51 |
```python
|
52 |
-
from diffusers import
|
53 |
-
import torch
|
54 |
|
55 |
-
pipe =
|
56 |
-
pipe
|
|
|
|
|
57 |
|
58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
```
|
60 |
|
61 |
## Examples of generations
|
|
|
46 |
|
47 |
Check our jupyter notebooks with examples in `./examples` folder
|
48 |
|
49 |
+
### Text-2-Image
|
50 |
|
51 |
```python
|
52 |
+
from diffusers import AutoPipelineForText2Image
|
|
|
53 |
|
54 |
+
pipe = AutoPipelineForText2Image.from_pretrained("kandinsky-community/kandinsky-3", variant="fp16", torch_dtype=torch.float16)
|
55 |
+
pipe.enable_model_cpu_offload()
|
56 |
+
|
57 |
+
prompt = "A photograph of the inside of a subway train. There are raccoons sitting on the seats. One of them is reading a newspaper. The window shows the city in the background."
|
58 |
|
59 |
+
generator = torch.Generator(device="cpu").manual_seed(0)
|
60 |
+
image = pipe(prompt, num_inference_steps=25, generator=generator).images[0]
|
61 |
+
```
|
62 |
+
|
63 |
+
### Image-2-Image
|
64 |
+
|
65 |
+
```python
|
66 |
+
from diffusers import AutoPipelineForImage2Image
|
67 |
+
from diffusers.utils import load_image
|
68 |
+
|
69 |
+
pipe = AutoPipelineForImage2Image.from_pretrained("kandinsky-community/kandinsky-3", variant="fp16", torch_dtype=torch.float16)
|
70 |
+
pipe.enable_model_cpu_offload()
|
71 |
+
|
72 |
+
prompt = "A painting of the inside of a subway train with tiny raccoons."
|
73 |
+
image = load_image("https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/kandinsky3/t2i.png")
|
74 |
+
|
75 |
+
generator = torch.Generator(device="cpu").manual_seed(0)
|
76 |
+
image = pipe(prompt, image=image, strength=0.75, num_inference_steps=25, generator=generator).images[0]
|
77 |
```
|
78 |
|
79 |
## Examples of generations
|