Update README.md
Browse files
README.md
CHANGED
|
@@ -12,38 +12,33 @@ base_model: "black-forest-labs/FLUX.1-dev"
|
|
| 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 |
-
```
|
| 30 |
from diffusers import AutoPipelineForText2Image
|
| 31 |
import torch
|
| 32 |
|
| 33 |
-
#
|
| 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 |
-
#
|
| 38 |
aspect_ratios = [
|
| 39 |
(512, 512), # 1:1
|
| 40 |
-
(768, 768), # 3:3 (
|
| 41 |
(640, 512), # 5:4
|
| 42 |
(768, 512), # 3:2
|
| 43 |
(896, 512), # 7:4
|
| 44 |
]
|
| 45 |
|
| 46 |
-
#
|
| 47 |
for width, height in aspect_ratios:
|
| 48 |
image = pipeline(
|
| 49 |
'tugce in a beautiful garden',
|
|
@@ -51,9 +46,13 @@ for width, height in aspect_ratios:
|
|
| 51 |
height=height
|
| 52 |
).images[0]
|
| 53 |
|
| 54 |
-
#
|
| 55 |
image.save(f"tugce_{width}x{height}.png")
|
| 56 |
-
print(f"
|
| 57 |
```
|
| 58 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
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 |
# 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 |
+
```python
|
| 25 |
from diffusers import AutoPipelineForText2Image
|
| 26 |
import torch
|
| 27 |
|
| 28 |
+
# Load the model and LoRA weights
|
| 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 |
+
# Define different aspect ratios
|
| 33 |
aspect_ratios = [
|
| 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 |
(896, 512), # 7:4
|
| 39 |
]
|
| 40 |
|
| 41 |
+
# Generate images for each aspect ratio
|
| 42 |
for width, height in aspect_ratios:
|
| 43 |
image = pipeline(
|
| 44 |
'tugce in a beautiful garden',
|
|
|
|
| 46 |
height=height
|
| 47 |
).images[0]
|
| 48 |
|
| 49 |
+
# Save the image
|
| 50 |
image.save(f"tugce_{width}x{height}.png")
|
| 51 |
+
print(f"Generated: tugce_{width}x{height}.png")
|
| 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)
|