Update README.md
Browse files
README.md
CHANGED
@@ -1,15 +1,17 @@
|
|
1 |
-
|
2 |
-
from
|
3 |
|
4 |
-
|
5 |
-
|
6 |
-
]
|
7 |
-
pipe = pipeline("text-generation", model="google/gemma-2-2b-it")
|
8 |
-
pipe(messages)# Use a pipeline as a high-level helper
|
9 |
-
from transformers import pipeline
|
10 |
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import torch
|
2 |
+
from diffusers import FluxPipeline
|
3 |
|
4 |
+
pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16)
|
5 |
+
pipe.enable_model_cpu_offload() #save some VRAM by offloading the model to CPU. Remove this if you have enough GPU power
|
|
|
|
|
|
|
|
|
6 |
|
7 |
+
prompt = "A cat holding a sign that says hello world"
|
8 |
+
image = pipe(
|
9 |
+
prompt,
|
10 |
+
height=1024,
|
11 |
+
width=1024,
|
12 |
+
guidance_scale=3.5,
|
13 |
+
num_inference_steps=50,
|
14 |
+
max_sequence_length=512,
|
15 |
+
generator=torch.Generator("cpu").manual_seed(0)
|
16 |
+
).images[0]
|
17 |
+
image.save("flux-dev.png")
|