Upload folder using huggingface_hub
Browse files- README.md +44 -3
- config.yaml +11 -10
- lora.safetensors +2 -2
README.md
CHANGED
|
@@ -11,20 +11,49 @@ tags:
|
|
| 11 |
- replicate
|
| 12 |
base_model: "black-forest-labs/FLUX.1-dev"
|
| 13 |
pipeline_tag: text-to-image
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
instance_prompt: KATIE
|
| 15 |
---
|
| 16 |
|
| 17 |
# Katie
|
| 18 |
|
| 19 |
-
|
| 20 |
|
| 21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
|
| 24 |
## Trigger words
|
|
|
|
| 25 |
You should use `KATIE` to trigger the image generation.
|
| 26 |
|
| 27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
## Use it with the [🧨 diffusers library](https://github.com/huggingface/diffusers)
|
| 29 |
|
| 30 |
```py
|
|
@@ -33,7 +62,19 @@ import torch
|
|
| 33 |
|
| 34 |
pipeline = AutoPipelineForText2Image.from_pretrained('black-forest-labs/FLUX.1-dev', torch_dtype=torch.float16).to('cuda')
|
| 35 |
pipeline.load_lora_weights('codebuilt/katie', weight_name='lora.safetensors')
|
| 36 |
-
image = pipeline('
|
| 37 |
```
|
| 38 |
|
| 39 |
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)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
- replicate
|
| 12 |
base_model: "black-forest-labs/FLUX.1-dev"
|
| 13 |
pipeline_tag: text-to-image
|
| 14 |
+
# widget:
|
| 15 |
+
# - text: >-
|
| 16 |
+
# prompt
|
| 17 |
+
# output:
|
| 18 |
+
# url: https://...
|
| 19 |
instance_prompt: KATIE
|
| 20 |
---
|
| 21 |
|
| 22 |
# Katie
|
| 23 |
|
| 24 |
+
<Gallery />
|
| 25 |
|
| 26 |
+
## About this LoRA
|
| 27 |
+
|
| 28 |
+
This is a [LoRA](https://replicate.com/docs/guides/working-with-loras) for the FLUX.1-dev text-to-image model. It can be used with diffusers or ComfyUI.
|
| 29 |
+
|
| 30 |
+
It was trained on [Replicate](https://replicate.com/) using AI toolkit: https://replicate.com/ostris/flux-dev-lora-trainer/train
|
| 31 |
|
| 32 |
|
| 33 |
## Trigger words
|
| 34 |
+
|
| 35 |
You should use `KATIE` to trigger the image generation.
|
| 36 |
|
| 37 |
|
| 38 |
+
## Run this LoRA with an API using Replicate
|
| 39 |
+
|
| 40 |
+
```py
|
| 41 |
+
import replicate
|
| 42 |
+
|
| 43 |
+
input = {
|
| 44 |
+
"prompt": "KATIE",
|
| 45 |
+
"lora_weights": "https://huggingface.co/codebuilt/katie/resolve/main/lora.safetensors"
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
output = replicate.run(
|
| 49 |
+
"black-forest-labs/flux-dev-lora",
|
| 50 |
+
input=input
|
| 51 |
+
)
|
| 52 |
+
for index, item in enumerate(output):
|
| 53 |
+
with open(f"output_{index}.webp", "wb") as file:
|
| 54 |
+
file.write(item.read())
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
## Use it with the [🧨 diffusers library](https://github.com/huggingface/diffusers)
|
| 58 |
|
| 59 |
```py
|
|
|
|
| 62 |
|
| 63 |
pipeline = AutoPipelineForText2Image.from_pretrained('black-forest-labs/FLUX.1-dev', torch_dtype=torch.float16).to('cuda')
|
| 64 |
pipeline.load_lora_weights('codebuilt/katie', weight_name='lora.safetensors')
|
| 65 |
+
image = pipeline('KATIE').images[0]
|
| 66 |
```
|
| 67 |
|
| 68 |
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)
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
## Training details
|
| 72 |
+
|
| 73 |
+
- Steps: 1000
|
| 74 |
+
- Learning rate: 0.0004
|
| 75 |
+
- LoRA rank: 16
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
## Contribute your own examples
|
| 79 |
+
|
| 80 |
+
You can use the [community tab](https://huggingface.co/codebuilt/katie/discussions) to add images that show off what you’ve made with this LoRA.
|
config.yaml
CHANGED
|
@@ -8,30 +8,31 @@ config:
|
|
| 8 |
trigger_word: KATIE
|
| 9 |
network:
|
| 10 |
type: lora
|
| 11 |
-
linear:
|
| 12 |
-
linear_alpha:
|
| 13 |
save:
|
| 14 |
dtype: float16
|
| 15 |
-
save_every:
|
| 16 |
max_step_saves_to_keep: 1
|
| 17 |
datasets:
|
| 18 |
- folder_path: input_images
|
| 19 |
caption_ext: txt
|
| 20 |
caption_dropout_rate: 0.05
|
| 21 |
shuffle_tokens: false
|
| 22 |
-
cache_latents_to_disk:
|
|
|
|
| 23 |
resolution:
|
| 24 |
- 512
|
| 25 |
- 768
|
| 26 |
- 1024
|
| 27 |
train:
|
| 28 |
batch_size: 1
|
| 29 |
-
steps:
|
| 30 |
gradient_accumulation_steps: 1
|
| 31 |
train_unet: true
|
| 32 |
train_text_encoder: false
|
| 33 |
content_or_style: balanced
|
| 34 |
-
gradient_checkpointing:
|
| 35 |
noise_scheduler: flowmatch
|
| 36 |
optimizer: adamw8bit
|
| 37 |
lr: 0.0004
|
|
@@ -42,18 +43,18 @@ config:
|
|
| 42 |
model:
|
| 43 |
name_or_path: FLUX.1-dev
|
| 44 |
is_flux: true
|
| 45 |
-
quantize:
|
| 46 |
sample:
|
| 47 |
sampler: flowmatch
|
| 48 |
-
sample_every:
|
| 49 |
width: 1024
|
| 50 |
height: 1024
|
| 51 |
prompts: []
|
| 52 |
neg: ''
|
| 53 |
seed: 42
|
| 54 |
walk_seed: true
|
| 55 |
-
guidance_scale:
|
| 56 |
-
sample_steps:
|
| 57 |
meta:
|
| 58 |
name: flux_train_replicate
|
| 59 |
version: '1.0'
|
|
|
|
| 8 |
trigger_word: KATIE
|
| 9 |
network:
|
| 10 |
type: lora
|
| 11 |
+
linear: 16
|
| 12 |
+
linear_alpha: 16
|
| 13 |
save:
|
| 14 |
dtype: float16
|
| 15 |
+
save_every: 1001
|
| 16 |
max_step_saves_to_keep: 1
|
| 17 |
datasets:
|
| 18 |
- folder_path: input_images
|
| 19 |
caption_ext: txt
|
| 20 |
caption_dropout_rate: 0.05
|
| 21 |
shuffle_tokens: false
|
| 22 |
+
cache_latents_to_disk: false
|
| 23 |
+
cache_latents: true
|
| 24 |
resolution:
|
| 25 |
- 512
|
| 26 |
- 768
|
| 27 |
- 1024
|
| 28 |
train:
|
| 29 |
batch_size: 1
|
| 30 |
+
steps: 1000
|
| 31 |
gradient_accumulation_steps: 1
|
| 32 |
train_unet: true
|
| 33 |
train_text_encoder: false
|
| 34 |
content_or_style: balanced
|
| 35 |
+
gradient_checkpointing: false
|
| 36 |
noise_scheduler: flowmatch
|
| 37 |
optimizer: adamw8bit
|
| 38 |
lr: 0.0004
|
|
|
|
| 43 |
model:
|
| 44 |
name_or_path: FLUX.1-dev
|
| 45 |
is_flux: true
|
| 46 |
+
quantize: false
|
| 47 |
sample:
|
| 48 |
sampler: flowmatch
|
| 49 |
+
sample_every: 1001
|
| 50 |
width: 1024
|
| 51 |
height: 1024
|
| 52 |
prompts: []
|
| 53 |
neg: ''
|
| 54 |
seed: 42
|
| 55 |
walk_seed: true
|
| 56 |
+
guidance_scale: 3.5
|
| 57 |
+
sample_steps: 28
|
| 58 |
meta:
|
| 59 |
name: flux_train_replicate
|
| 60 |
version: '1.0'
|
lora.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5fba995388f946e288e6e454c477e5d4eedd5f73c7ac0f8dd536f235eac201fb
|
| 3 |
+
size 171969416
|