Update README.md
Browse files
README.md
CHANGED
@@ -12,47 +12,50 @@ base_model: "black-forest-labs/FLUX.1-dev"
|
|
12 |
pipeline_tag: text-to-image
|
13 |
instance_prompt: DHANUSH
|
14 |
---
|
|
|
15 |
# Tugce_Flux
|
|
|
16 |
Trained on Replicate using:
|
|
|
17 |
https://replicate.com/ostris/flux-dev-lora-trainer/train
|
18 |
|
|
|
19 |
## Trigger words
|
20 |
You should use `tugce` to trigger the image generation.
|
21 |
|
|
|
22 |
## Use it with the [🧨 diffusers library](https://github.com/huggingface/diffusers)
|
23 |
|
24 |
-
```
|
25 |
from diffusers import AutoPipelineForText2Image
|
26 |
import torch
|
27 |
|
28 |
-
#
|
29 |
pipeline = AutoPipelineForText2Image.from_pretrained('black-forest-labs/FLUX.1-dev', torch_dtype=torch.float16).to('cuda')
|
30 |
pipeline.load_lora_weights('codermert/tugce2-lora', weight_name='flux_train_replicate.safetensors')
|
31 |
|
32 |
-
#
|
33 |
-
|
34 |
(512, 512), # 1:1
|
35 |
-
(768, 768), # 3:3 (same as 1:1 but larger)
|
36 |
-
(640, 512), # 5:4
|
37 |
(768, 512), # 3:2
|
38 |
-
(
|
|
|
39 |
]
|
40 |
|
41 |
-
#
|
42 |
-
|
|
|
|
|
|
|
43 |
image = pipeline(
|
44 |
-
|
45 |
width=width,
|
46 |
height=height
|
47 |
).images[0]
|
48 |
|
49 |
-
#
|
50 |
image.save(f"tugce_{width}x{height}.png")
|
51 |
-
print(f"
|
52 |
```
|
53 |
|
54 |
-
This code will generate images in various aspect ratios. You can modify the `aspect_ratios` list to include any desired dimensions.
|
55 |
-
|
56 |
-
Remember to use the trigger word `tugce` in your prompts to activate the LoRA model.
|
57 |
-
|
58 |
For more details, including weighting, merging and fusing LoRAs, check the [documentation on loading LoRAs in diffusers](https://huggingface.co/docs/diffusers/main/en/using-diffusers/loading_adapters)
|
|
|
12 |
pipeline_tag: text-to-image
|
13 |
instance_prompt: DHANUSH
|
14 |
---
|
15 |
+
|
16 |
# Tugce_Flux
|
17 |
+
|
18 |
Trained on Replicate using:
|
19 |
+
|
20 |
https://replicate.com/ostris/flux-dev-lora-trainer/train
|
21 |
|
22 |
+
|
23 |
## Trigger words
|
24 |
You should use `tugce` to trigger the image generation.
|
25 |
|
26 |
+
|
27 |
## Use it with the [🧨 diffusers library](https://github.com/huggingface/diffusers)
|
28 |
|
29 |
+
```py
|
30 |
from diffusers import AutoPipelineForText2Image
|
31 |
import torch
|
32 |
|
33 |
+
# Model ve LoRA'yı yükle
|
34 |
pipeline = AutoPipelineForText2Image.from_pretrained('black-forest-labs/FLUX.1-dev', torch_dtype=torch.float16).to('cuda')
|
35 |
pipeline.load_lora_weights('codermert/tugce2-lora', weight_name='flux_train_replicate.safetensors')
|
36 |
|
37 |
+
# Farklı boyutlar
|
38 |
+
sizes = [
|
39 |
(512, 512), # 1:1
|
|
|
|
|
40 |
(768, 512), # 3:2
|
41 |
+
(640, 480), # 4:3
|
42 |
+
(896, 504), # 16:9
|
43 |
]
|
44 |
|
45 |
+
# Prompt
|
46 |
+
prompt = "tugce in a beautiful garden"
|
47 |
+
|
48 |
+
# Her boyut için görüntü oluştur
|
49 |
+
for width, height in sizes:
|
50 |
image = pipeline(
|
51 |
+
prompt,
|
52 |
width=width,
|
53 |
height=height
|
54 |
).images[0]
|
55 |
|
56 |
+
# Görüntüyü kaydet
|
57 |
image.save(f"tugce_{width}x{height}.png")
|
58 |
+
print(f"Oluşturuldu: tugce_{width}x{height}.png")
|
59 |
```
|
60 |
|
|
|
|
|
|
|
|
|
61 |
For more details, including weighting, merging and fusing LoRAs, check the [documentation on loading LoRAs in diffusers](https://huggingface.co/docs/diffusers/main/en/using-diffusers/loading_adapters)
|