Instructions to use codermert/ayd_flux with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use codermert/ayd_flux with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("codermert/ayd_flux") prompt = "ser" image = pipe(prompt).images[0] - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
Upload folder using huggingface_hub
Browse files- README.md +1 -44
- config.yaml +60 -0
- flux_train_replicate.safetensors +3 -0
- optimizer.pt +3 -0
- samples/1728930066331__000000000_0.jpg +0 -0
- samples/1728930606595__000000250_0.jpg +0 -0
- samples/1728931146124__000000500_0.jpg +0 -0
- samples/1728931681526__000000750_0.jpg +0 -0
- samples/1728932225335__000001000_0.jpg +0 -0
- samples/1728932758437__000001250_0.jpg +0 -0
- samples/1728933294543__000001500_0.jpg +0 -0
README.md
CHANGED
|
@@ -2,47 +2,4 @@
|
|
| 2 |
license: other
|
| 3 |
license_name: flux-1-dev-non-commercial-license
|
| 4 |
license_link: https://huggingface.co/black-forest-labs/FLUX.1-dev/blob/main/LICENSE.md
|
| 5 |
-
|
| 6 |
-
- en
|
| 7 |
-
tags:
|
| 8 |
-
- flux
|
| 9 |
-
- diffusers
|
| 10 |
-
- lora
|
| 11 |
-
base_model: "black-forest-labs/FLUX.1-dev"
|
| 12 |
-
pipeline_tag: text-to-image
|
| 13 |
-
instance_prompt: ser
|
| 14 |
-
---
|
| 15 |
-
|
| 16 |
-
# ser LoRa Trainer (developing...)
|
| 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 `mert` to trigger the image generation.
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
## Use it with the [🧨 diffusers library](https://github.com/huggingface/diffusers)
|
| 28 |
-
|
| 29 |
-
```py
|
| 30 |
-
import torch
|
| 31 |
-
from diffusers import FluxPipeline
|
| 32 |
-
|
| 33 |
-
pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16)
|
| 34 |
-
pipe.load_lora_weights('codermert/ayd_flux', weight_name='flux_train_replicate.safetensors')
|
| 35 |
-
pipe.fuse_lora(lora_scale=0.9)
|
| 36 |
-
pipe.to("cuda")
|
| 37 |
-
|
| 38 |
-
prompt = "close up portrait, Amidst the interplay of light and shadows in a photography studio,a soft spotlight traces the contours of a face,highlighting a figure clad in a sleek black turtleneck. The garment,hugging the skin with subtle luxury,complements the Caucasian model's understated makeup,embodying minimalist elegance. Behind,a pale gray backdrop extends,its fine texture shimmering subtly in the dim light,artfully balancing the composition and focusing attention on the subject. In a palette of black,gray,and skin tones,simplicity intertwines with profundity,as every detail whispers untold stories."
|
| 39 |
-
|
| 40 |
-
image = pipe(prompt,
|
| 41 |
-
num_inference_steps=24,
|
| 42 |
-
guidance_scale=3.5,
|
| 43 |
-
width=768, height=1024,
|
| 44 |
-
).images[0]
|
| 45 |
-
image.save(f"example.png")
|
| 46 |
-
```
|
| 47 |
-
|
| 48 |
-
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)
|
|
|
|
| 2 |
license: other
|
| 3 |
license_name: flux-1-dev-non-commercial-license
|
| 4 |
license_link: https://huggingface.co/black-forest-labs/FLUX.1-dev/blob/main/LICENSE.md
|
| 5 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config.yaml
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
config:
|
| 2 |
+
name: flux_train_replicate
|
| 3 |
+
process:
|
| 4 |
+
- datasets:
|
| 5 |
+
- cache_latents_to_disk: true
|
| 6 |
+
caption_dropout_rate: 0.05
|
| 7 |
+
caption_ext: txt
|
| 8 |
+
folder_path: input_images
|
| 9 |
+
resolution:
|
| 10 |
+
- 512
|
| 11 |
+
- 768
|
| 12 |
+
- 1024
|
| 13 |
+
shuffle_tokens: false
|
| 14 |
+
device: cuda:0
|
| 15 |
+
model:
|
| 16 |
+
is_flux: true
|
| 17 |
+
name_or_path: black-forest-labs/FLUX.1-dev
|
| 18 |
+
quantize: true
|
| 19 |
+
network:
|
| 20 |
+
linear: 16
|
| 21 |
+
linear_alpha: 16
|
| 22 |
+
type: lora
|
| 23 |
+
sample:
|
| 24 |
+
guidance_scale: 4
|
| 25 |
+
height: 1024
|
| 26 |
+
neg: ''
|
| 27 |
+
prompts:
|
| 28 |
+
- a sign that says 'I LOVE PROMPTS!' in the style of [trigger]
|
| 29 |
+
sample_every: 250
|
| 30 |
+
sample_steps: 20
|
| 31 |
+
sampler: flowmatch
|
| 32 |
+
seed: 42
|
| 33 |
+
walk_seed: true
|
| 34 |
+
width: 1024
|
| 35 |
+
save:
|
| 36 |
+
dtype: float16
|
| 37 |
+
max_step_saves_to_keep: 1
|
| 38 |
+
save_every: 1501
|
| 39 |
+
train:
|
| 40 |
+
batch_size: 1
|
| 41 |
+
content_or_style: balanced
|
| 42 |
+
dtype: bf16
|
| 43 |
+
ema_config:
|
| 44 |
+
ema_decay: 0.99
|
| 45 |
+
use_ema: true
|
| 46 |
+
gradient_accumulation_steps: 1
|
| 47 |
+
gradient_checkpointing: true
|
| 48 |
+
lr: 0.0004
|
| 49 |
+
noise_scheduler: flowmatch
|
| 50 |
+
optimizer: adamw8bit
|
| 51 |
+
steps: 1500
|
| 52 |
+
train_text_encoder: false
|
| 53 |
+
train_unet: true
|
| 54 |
+
training_folder: output
|
| 55 |
+
trigger_word: TOK
|
| 56 |
+
type: sd_trainer
|
| 57 |
+
job: extension
|
| 58 |
+
meta:
|
| 59 |
+
name: flux_train_replicate
|
| 60 |
+
version: '1.0'
|
flux_train_replicate.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ca3aaaab20a9213da9d059f45399c2b4e6ed90025423bd18a5ede73a7e27fb24
|
| 3 |
+
size 171969416
|
optimizer.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:12c3a93498dcb03148444df6bfc5c5f0fd069f4e793648829568b746f7eb9676
|
| 3 |
+
size 173272836
|
samples/1728930066331__000000000_0.jpg
ADDED
|
samples/1728930606595__000000250_0.jpg
ADDED
|
samples/1728931146124__000000500_0.jpg
ADDED
|
samples/1728931681526__000000750_0.jpg
ADDED
|
samples/1728932225335__000001000_0.jpg
ADDED
|
samples/1728932758437__000001250_0.jpg
ADDED
|
samples/1728933294543__000001500_0.jpg
ADDED
|