gride29 commited on
Commit
a70d6b9
·
verified ·
1 Parent(s): c079e9a

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. README.md +37 -3
  2. config.yaml +3 -3
  3. lora.safetensors +2 -2
README.md CHANGED
@@ -23,15 +23,37 @@ instance_prompt: TOK
23
 
24
  <Gallery />
25
 
26
- Trained on Replicate using:
27
 
28
- https://replicate.com/ostris/flux-dev-lora-trainer/train
 
 
29
 
30
 
31
  ## Trigger words
 
32
  You should use `TOK` to trigger the image generation.
33
 
34
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  ## Use it with the [🧨 diffusers library](https://github.com/huggingface/diffusers)
36
 
37
  ```py
@@ -40,7 +62,19 @@ import torch
40
 
41
  pipeline = AutoPipelineForText2Image.from_pretrained('black-forest-labs/FLUX.1-dev', torch_dtype=torch.float16).to('cuda')
42
  pipeline.load_lora_weights('gride29/flux-custom-smaller', weight_name='lora.safetensors')
43
- image = pipeline('your prompt').images[0]
44
  ```
45
 
46
  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)
 
 
 
 
 
 
 
 
 
 
 
 
 
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 `TOK` 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": "TOK",
45
+ "lora_weights": "https://huggingface.co/gride29/flux-custom-smaller/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('gride29/flux-custom-smaller', weight_name='lora.safetensors')
65
+ image = pipeline('TOK').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/gride29/flux-custom-smaller/discussions) to add images that show off what you’ve made with this LoRA.
config.yaml CHANGED
@@ -12,7 +12,7 @@ config:
12
  linear_alpha: 16
13
  save:
14
  dtype: float16
15
- save_every: 51
16
  max_step_saves_to_keep: 1
17
  datasets:
18
  - folder_path: input_images
@@ -27,7 +27,7 @@ config:
27
  - 1024
28
  train:
29
  batch_size: 1
30
- steps: 50
31
  gradient_accumulation_steps: 1
32
  train_unet: true
33
  train_text_encoder: false
@@ -46,7 +46,7 @@ config:
46
  quantize: false
47
  sample:
48
  sampler: flowmatch
49
- sample_every: 51
50
  width: 1024
51
  height: 1024
52
  prompts: []
 
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
 
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
 
46
  quantize: false
47
  sample:
48
  sampler: flowmatch
49
+ sample_every: 1001
50
  width: 1024
51
  height: 1024
52
  prompts: []
lora.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:2e8a4fe59d015a03e0c30a6c2a341ebeceb9f557959260557f7275f5756ef751
3
- size 171969408
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9ea2f682e622b2887fd3be71036045b37648efbc6370d62e213568e5a0739e37
3
+ size 171969416