MewSocial commited on
Commit
cfe5e53
·
verified ·
1 Parent(s): c5c852e

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. README.md +40 -6
  2. config.yaml +60 -0
  3. lora.safetensors +3 -0
README.md CHANGED
@@ -16,22 +16,44 @@ pipeline_tag: text-to-image
16
  # prompt
17
  # output:
18
  # url: https://...
19
- instance_prompt: Mewsocial
20
  ---
21
 
22
- # Flux Lora Mewsocial
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 `mew2` to trigger the image generation.
33
 
34
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  ## Use it with the [🧨 diffusers library](https://github.com/huggingface/diffusers)
36
 
37
  ```py
@@ -39,8 +61,20 @@ from diffusers import AutoPipelineForText2Image
39
  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('MewSocial/flux-lora-mewsocial', 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)
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  # prompt
17
  # output:
18
  # url: https://...
19
+ instance_prompt: mew2
20
  ---
21
 
22
+ # Mew2
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 `mew2` 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": "mew2",
45
+ "lora_weights": "https://huggingface.co/MewSocial/mew2/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
 
61
  import torch
62
 
63
  pipeline = AutoPipelineForText2Image.from_pretrained('black-forest-labs/FLUX.1-dev', torch_dtype=torch.float16).to('cuda')
64
+ pipeline.load_lora_weights('MewSocial/mew2', weight_name='lora.safetensors')
65
+ image = pipeline('mew2').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: 2060
74
+ - Learning rate: 0.0004
75
+ - LoRA rank: 20
76
+
77
+
78
+ ## Contribute your own examples
79
+
80
+ You can use the [community tab](https://huggingface.co/MewSocial/mew2/discussions) to add images that show off what you’ve made with this LoRA.
config.yaml ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ job: custom_job
2
+ config:
3
+ name: flux_train_replicate
4
+ process:
5
+ - type: custom_sd_trainer
6
+ training_folder: output
7
+ device: cuda:0
8
+ trigger_word: mew2
9
+ network:
10
+ type: lora
11
+ linear: 20
12
+ linear_alpha: 20
13
+ save:
14
+ dtype: float16
15
+ save_every: 2061
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: 2060
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
39
+ ema_config:
40
+ use_ema: true
41
+ ema_decay: 0.99
42
+ dtype: bf16
43
+ model:
44
+ name_or_path: FLUX.1-dev
45
+ is_flux: true
46
+ quantize: false
47
+ sample:
48
+ sampler: flowmatch
49
+ sample_every: 2061
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 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:25eef56e5ddfcb857364d55a1d994c5fe866b60a41263841673298cbb57051fe
3
+ size 214928520