pch11 commited on
Commit
9d34262
·
verified ·
1 Parent(s): 3b1ad30

Delete fluxtraining

Browse files
fluxtraining/config_lora-20250412-151447.toml DELETED
@@ -1,64 +0,0 @@
1
- ae = "/workspace/flux_vae.safetensors"
2
- bucket_no_upscale = true
3
- bucket_reso_steps = 64
4
- cache_latents_to_disk = true
5
- cache_text_encoder_outputs_to_disk = true
6
- caption_extension = ".txt"
7
- clip_l = "/workspace/clip_l.safetensors"
8
- clip_skip = 1
9
- discrete_flow_shift = 3.0
10
- dynamo_backend = "no"
11
- enable_bucket = true
12
- epoch = 10
13
- full_bf16 = true
14
- gradient_accumulation_steps = 1
15
- gradient_checkpointing = true
16
- guidance_scale = 3.5
17
- huber_c = 0.1
18
- huber_scale = 1
19
- huber_schedule = "snr"
20
- logging_dir = "/workspace/train/log"
21
- loss_type = "l2"
22
- lr_scheduler = "cosine_with_restarts"
23
- lr_scheduler_args = []
24
- lr_scheduler_num_cycles = 1
25
- lr_scheduler_power = 1
26
- lr_warmup_steps = 0.1
27
- max_bucket_reso = 2048
28
- max_data_loader_n_workers = 0
29
- max_grad_norm = 1
30
- max_timestep = 1000
31
- max_train_steps = 500
32
- metadata_author = "Chris Hsu"
33
- metadata_description = "landscape for Overhead view"
34
- metadata_title = "landscapeOverhead_A6000"
35
- min_bucket_reso = 256
36
- mixed_precision = "bf16"
37
- model_prediction_type = "sigma_scaled"
38
- network_alpha = 8
39
- network_args = [ "train_double_block_indices=all", "train_single_block_indices=all",]
40
- network_dim = 4
41
- network_module = "networks.lora_flux"
42
- noise_offset_type = "Original"
43
- optimizer_args = []
44
- optimizer_type = "AdamW8bit"
45
- output_dir = "/workspace/train/model"
46
- output_name = "landscapeOverhead_A6000"
47
- pretrained_model_name_or_path = "/workspace/flux1-dev.safetensors"
48
- prior_loss_weight = 1
49
- resolution = "1024,1024"
50
- sample_every_n_epochs = 1
51
- sample_prompts = "/workspace/train/model/sample/prompt.txt"
52
- sample_sampler = "euler_a"
53
- save_every_n_epochs = 1
54
- save_model_as = "safetensors"
55
- save_precision = "bf16"
56
- t5xxl = "/workspace/t5xxl_fp16.safetensors"
57
- t5xxl_max_token_length = 512
58
- text_encoder_lr = [ 1e-5, 1e-5,]
59
- timestep_sampling = "sigma"
60
- train_batch_size = 2
61
- train_data_dir = "/workspace/train/img"
62
- unet_lr = 1e-5
63
- wandb_run_name = "landscapeOverhead_A6000"
64
- xformers = true
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fluxtraining/download_caption_flux.py DELETED
@@ -1,25 +0,0 @@
1
- from datasets import load_dataset
2
- import os
3
- import shutil
4
-
5
- # 加載 HuggingFace 數據集
6
-
7
- dataset = load_dataset("pch11/0412-2")
8
-
9
- # 創建目錄
10
- output_dir = "/workspace/datasets/"
11
- os.makedirs(output_dir, exist_ok=True)
12
-
13
- # 下載並保存圖像和標題
14
- for i, item in enumerate(dataset["train"]):
15
- # 保存圖像
16
- image = item["image"]
17
- image = image.convert("RGB")
18
- image_path = os.path.join(output_dir, f"image_{i:06d}.jpg")
19
- image.save(image_path)
20
-
21
- # 保存標題
22
- caption = item["caption_Flux"]
23
- caption_path = os.path.join(output_dir, f"image_{i:06d}.txt")
24
- with open(caption_path, "w", encoding="utf-8") as f:
25
- f.write(caption)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fluxtraining/landscapeOverhead_A6000_20250412-151447.json DELETED
@@ -1,228 +0,0 @@
1
- {
2
- "LoRA_type": "Flux1",
3
- "LyCORIS_preset": "full",
4
- "adaptive_noise_scale": 0,
5
- "additional_parameters": "",
6
- "ae": "/workspace/flux_vae.safetensors",
7
- "apply_t5_attn_mask": false,
8
- "async_upload": false,
9
- "block_alphas": "",
10
- "block_dims": "",
11
- "block_lr_zero_threshold": "",
12
- "blocks_to_swap": 0,
13
- "bucket_no_upscale": true,
14
- "bucket_reso_steps": 64,
15
- "bypass_mode": false,
16
- "cache_latents": false,
17
- "cache_latents_to_disk": true,
18
- "caption_dropout_every_n_epochs": 0,
19
- "caption_dropout_rate": 0,
20
- "caption_extension": ".txt",
21
- "clip_g": "",
22
- "clip_g_dropout_rate": 0,
23
- "clip_l": "/workspace/clip_l.safetensors",
24
- "clip_skip": 1,
25
- "color_aug": false,
26
- "constrain": 0,
27
- "conv_alpha": 1,
28
- "conv_block_alphas": "",
29
- "conv_block_dims": "",
30
- "conv_dim": 1,
31
- "cpu_offload_checkpointing": false,
32
- "dataset_config": "",
33
- "debiased_estimation_loss": false,
34
- "decompose_both": false,
35
- "dim_from_weights": false,
36
- "discrete_flow_shift": 3,
37
- "dora_wd": false,
38
- "double_blocks_to_swap": 0,
39
- "down_lr_weight": "",
40
- "dynamo_backend": "no",
41
- "dynamo_mode": "default",
42
- "dynamo_use_dynamic": false,
43
- "dynamo_use_fullgraph": false,
44
- "enable_all_linear": false,
45
- "enable_bucket": true,
46
- "epoch": 10,
47
- "extra_accelerate_launch_args": "",
48
- "factor": -1,
49
- "flip_aug": false,
50
- "flux1_cache_text_encoder_outputs": false,
51
- "flux1_cache_text_encoder_outputs_to_disk": true,
52
- "flux1_checkbox": true,
53
- "fp8_base": false,
54
- "fp8_base_unet": false,
55
- "full_bf16": true,
56
- "full_fp16": false,
57
- "gpu_ids": "",
58
- "gradient_accumulation_steps": 1,
59
- "gradient_checkpointing": true,
60
- "guidance_scale": 3.5,
61
- "highvram": false,
62
- "huber_c": 0.1,
63
- "huber_scale": 1,
64
- "huber_schedule": "snr",
65
- "huggingface_path_in_repo": "",
66
- "huggingface_repo_id": "",
67
- "huggingface_repo_type": "",
68
- "huggingface_repo_visibility": "",
69
- "huggingface_token": "",
70
- "img_attn_dim": "",
71
- "img_mlp_dim": "",
72
- "img_mod_dim": "",
73
- "in_dims": "",
74
- "ip_noise_gamma": 0,
75
- "ip_noise_gamma_random_strength": false,
76
- "keep_tokens": 0,
77
- "learning_rate": 1e-05,
78
- "log_config": false,
79
- "log_tracker_config": "",
80
- "log_tracker_name": "",
81
- "log_with": "",
82
- "logging_dir": "/workspace/train/log",
83
- "logit_mean": 0,
84
- "logit_std": 1,
85
- "loraplus_lr_ratio": 0,
86
- "loraplus_text_encoder_lr_ratio": 0,
87
- "loraplus_unet_lr_ratio": 0,
88
- "loss_type": "l2",
89
- "lowvram": false,
90
- "lr_scheduler": "cosine_with_restarts",
91
- "lr_scheduler_args": "",
92
- "lr_scheduler_num_cycles": 1,
93
- "lr_scheduler_power": 1,
94
- "lr_scheduler_type": "",
95
- "lr_warmup": 10,
96
- "lr_warmup_steps": 0,
97
- "main_process_port": 0,
98
- "masked_loss": false,
99
- "max_bucket_reso": 2048,
100
- "max_data_loader_n_workers": 0,
101
- "max_grad_norm": 1,
102
- "max_resolution": "1024,1024",
103
- "max_timestep": 1000,
104
- "max_token_length": 225,
105
- "max_train_epochs": 0,
106
- "max_train_steps": 0,
107
- "mem_eff_attn": false,
108
- "mem_eff_save": false,
109
- "metadata_author": "Chris Hsu",
110
- "metadata_description": "landscape for Overhead view",
111
- "metadata_license": "",
112
- "metadata_tags": "",
113
- "metadata_title": "landscapeOverhead_A6000",
114
- "mid_lr_weight": "",
115
- "min_bucket_reso": 256,
116
- "min_snr_gamma": 0,
117
- "min_timestep": 0,
118
- "mixed_precision": "bf16",
119
- "mode_scale": 1.29,
120
- "model_list": "custom",
121
- "model_prediction_type": "sigma_scaled",
122
- "module_dropout": 0,
123
- "multi_gpu": false,
124
- "multires_noise_discount": 0.3,
125
- "multires_noise_iterations": 0,
126
- "network_alpha": 8,
127
- "network_dim": 4,
128
- "network_dropout": 0,
129
- "network_weights": "",
130
- "noise_offset": 0,
131
- "noise_offset_random_strength": false,
132
- "noise_offset_type": "Original",
133
- "num_cpu_threads_per_process": 2,
134
- "num_machines": 1,
135
- "num_processes": 1,
136
- "optimizer": "AdamW8bit",
137
- "optimizer_args": "",
138
- "output_dir": "/workspace/train/model",
139
- "output_name": "landscapeOverhead_A6000",
140
- "persistent_data_loader_workers": false,
141
- "pos_emb_random_crop_rate": 0,
142
- "pretrained_model_name_or_path": "/workspace/flux1-dev.safetensors",
143
- "prior_loss_weight": 1,
144
- "random_crop": false,
145
- "rank_dropout": 0,
146
- "rank_dropout_scale": false,
147
- "reg_data_dir": "",
148
- "rescaled": false,
149
- "resume": "",
150
- "resume_from_huggingface": "",
151
- "sample_every_n_epochs": 1,
152
- "sample_every_n_steps": 0,
153
- "sample_prompts": "perspective view of a carbon-neutral park, blending nature and technology, diverse flora and fauna, vibrant community spaces, sustainable design, perspective view, detailed environment. --w 1024 --h 768 --l 7.0\n\nperspective view of landscape of a carbon-neutral park, ecological education area, walking and biking trails, artificial lake with wildlife, community interaction, nature-inspired gardens, renewable energy installations, perspective drawing, vivid colors. --w 1024 --h 768 --l 7.0\n\nperspective view of a sustainable park, biodiversity gardens, innovative water management systems, people enjoying recreational activities, artistic landscape design, eco-friendly facilities, on a sunny day, harmonious environment. --w 1024 --h 768 --l 7.0",
154
- "sample_sampler": "euler_a",
155
- "save_clip": false,
156
- "save_every_n_epochs": 1,
157
- "save_every_n_steps": 0,
158
- "save_last_n_epochs": 0,
159
- "save_last_n_epochs_state": 0,
160
- "save_last_n_steps": 0,
161
- "save_last_n_steps_state": 0,
162
- "save_model_as": "safetensors",
163
- "save_precision": "bf16",
164
- "save_state": false,
165
- "save_state_on_train_end": false,
166
- "save_state_to_huggingface": false,
167
- "save_t5xxl": false,
168
- "scale_v_pred_loss_like_noise_pred": false,
169
- "scale_weight_norms": 0,
170
- "sd3_cache_text_encoder_outputs": false,
171
- "sd3_cache_text_encoder_outputs_to_disk": false,
172
- "sd3_checkbox": false,
173
- "sd3_clip_l": "",
174
- "sd3_clip_l_dropout_rate": 0,
175
- "sd3_disable_mmap_load_safetensors": false,
176
- "sd3_enable_scaled_pos_embed": false,
177
- "sd3_fused_backward_pass": false,
178
- "sd3_t5_dropout_rate": 0,
179
- "sd3_t5xxl": "",
180
- "sd3_text_encoder_batch_size": 1,
181
- "sdxl": false,
182
- "sdxl_cache_text_encoder_outputs": false,
183
- "sdxl_no_half_vae": false,
184
- "seed": 0,
185
- "shuffle_caption": false,
186
- "single_blocks_to_swap": 0,
187
- "single_dim": "",
188
- "single_mod_dim": "",
189
- "skip_cache_check": false,
190
- "split_mode": false,
191
- "split_qkv": false,
192
- "stop_text_encoder_training": 0,
193
- "t5xxl": "/workspace/t5xxl_fp16.safetensors",
194
- "t5xxl_device": "",
195
- "t5xxl_dtype": "bf16",
196
- "t5xxl_lr": 1e-05,
197
- "t5xxl_max_token_length": 512,
198
- "text_encoder_lr": 1e-05,
199
- "timestep_sampling": "sigma",
200
- "train_batch_size": 2,
201
- "train_blocks": "all",
202
- "train_data_dir": "/workspace/train/img",
203
- "train_double_block_indices": "all",
204
- "train_norm": false,
205
- "train_on_input": true,
206
- "train_single_block_indices": "all",
207
- "train_t5xxl": false,
208
- "training_comment": "",
209
- "txt_attn_dim": "",
210
- "txt_mlp_dim": "",
211
- "txt_mod_dim": "",
212
- "unet_lr": 1e-05,
213
- "unit": 1,
214
- "up_lr_weight": "",
215
- "use_cp": false,
216
- "use_scalar": false,
217
- "use_tucker": false,
218
- "v2": false,
219
- "v_parameterization": false,
220
- "v_pred_like_loss": 0,
221
- "vae": "",
222
- "vae_batch_size": 0,
223
- "wandb_api_key": "",
224
- "wandb_run_name": "",
225
- "weighted_captions": false,
226
- "weighting_scheme": "logit_normal",
227
- "xformers": "xformers"
228
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fluxtraining/prompt.txt DELETED
@@ -1,3 +0,0 @@
1
- A sustainable park landscape designed for carbon neutrality and stormwater management, featuring integrated bioswales, terraced rain gardens with diverse native wetland plants, permeable pavements with warm-toned gravel, open green lawns for passive recreation, wooden benches shaded by deciduous trees, winding walking trails with natural stone edging, birds and butterflies in the background, bright sunny daylight, one-point perspective. --w 1024 --h 768 --l 7.0
2
- Eco-friendly park, small lighting poles along curving gravel walkways, native wildflower meadows with seasonal color shifts, small natural ponds with reeds and dragonflies, shaded picnic areas with wooden shelters and compost bins, wide open space in Perspective view, clear blue sky in afternoon light. --w 1024 --h 768 --l 7.0
3
- Perspective view of a low-carbon community park featuring curved natural walking trails, densely planted native shrubs and grasses, small open play areas for children, insect hotels and pollinator gardens, interpretive eco signage along the trail, composting station, lush tree canopy with filtered sunlight, morning glow, immersive and educational environment. --w 1024 --h 768 --l 7.0
 
 
 
 
fluxtraining/trainFlux.sh DELETED
@@ -1,31 +0,0 @@
1
- #使用 bash指令執行這個腳本 ---> bash trainFlux.sh
2
- #!/bin/bash
3
- cd /workspace
4
- wget --trust-server-name --content-disposition https://huggingface.co/datasets/pch11/flux-train00/tree/main/fluxtraining/download_caption_flux.py
5
- wget --trust-server-name --content-disposition https://huggingface.co/datasets/pch11/flux-train00/tree/main/fluxtraining/landscapeOverhead_A6000_20250412-151447.json
6
- python -m venv env
7
- source /workspace/env/bin/activate
8
- pip install datasets huggingface_hub Pillow
9
- python download_caption_flux.py
10
- deactivate
11
- cd /workspace
12
- git clone https://github.com/bmaltais/kohya_ss
13
- cd kohya_ss
14
- #預設是訓練SD1.5, SDXL的版本,如果要訓練SD3, Flux 必須切換至sd3-flux.1
15
- git branch -a
16
- git checkout sd3-flux.1
17
- ./setup-runpod.sh
18
- ./gui.sh --share --headless
19
-
20
- '''
21
- 另開 terminal 視窗,把以下內容貼上並按下enter執行,直接下載訓練Flux LoRA必須的相關模型(節省時間)
22
-
23
- wget --trust-server-name --content-disposition https://huggingface.co/realung/flux1-dev.safetensors/resolve/main/flux1-dev.safetensors
24
-
25
- wget --trust-server-name --content-disposition https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/t5xxl_fp16.safetensors
26
-
27
- wget --trust-server-name --content-disposition https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/clip_l.safetensors
28
-
29
- wget --trust-server-name --content-disposition https://huggingface.co/StableDiffusionVN/Flux/resolve/main/Vae/flux_vae.safetensors
30
- '''
31
- #./gui.sh --share --headless --config "/workspace/config.toml"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fluxtraining/trainFlux_CLI.sh DELETED
@@ -1,58 +0,0 @@
1
- #使用 bash指令執行這個腳本 ---> bash kohya_ss.sh
2
- #!/bin/bash
3
- wget --trust-server-name --content-disposition https://huggingface.co/datasets/pch11/flux-train00/tree/main/fluxtraining/download_caption_flux.py
4
- wget --trust-server-name --content-disposition https://huggingface.co/datasets/pch11/flux-train00/tree/main/fluxtraining/config_lora-20250412-151447.toml
5
- wget --trust-server-name --content-disposition https://huggingface.co/datasets/pch11/flux-train00/tree/main/fluxtraining/prompt.txt
6
- cd /workspace
7
- python -m venv env
8
- source /workspace/env/bin/activate
9
- pip install datasets huggingface_hub Pillow
10
- python download_caption_flux.py
11
- deactivate
12
- cd /workspace
13
- git clone https://github.com/kohya-ss/sd-scripts
14
- cd sd-scripts
15
- #預設是訓練SD1.5, SDXL的版本,如果要訓練SD3, Flux 必須切換至sd3
16
- git branch -a
17
- git checkout sd3
18
-
19
-
20
-
21
- '''
22
- 另開 terminal 視窗,把以下內容貼上並按下enter執行,直接下載訓練Flux LoRA必須的相關模型(節省時間)
23
-
24
- wget --trust-server-name --content-disposition https://huggingface.co/realung/flux1-dev.safetensors/resolve/main/flux1-dev.safetensors
25
-
26
- wget --trust-server-name --content-disposition https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/t5xxl_fp16.safetensors
27
-
28
- wget --trust-server-name --content-disposition https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/clip_l.safetensors
29
-
30
- wget --trust-server-name --content-disposition https://huggingface.co/StableDiffusionVN/Flux/resolve/main/Vae/flux_vae.safetensors
31
-
32
-
33
- '''
34
-
35
- cd /workspace/sd-scripts
36
- python -m venv env
37
- source /workspace/sd-scripts/env/bin/activate
38
- pip3 install torch==2.4.0 torchvision==0.19.0 --index-url https://download.pytorch.org/whl/cu124
39
- pip install --upgrade -r requirements.txt
40
-
41
-
42
- mkdir /workspace/train/
43
- mkdir /workspace/train/img
44
- mkdir /workspace/train/log
45
- mkdir /workspace/train/model
46
- mkdir /workspace/train/model/sample
47
- cp -R /workspace/datasets /workspace/train/img/1_overhedlandscape
48
- cp /workspace/prompt.txt /workspace/train/model/sample/prompt.txt
49
-
50
- '''
51
- 訓練的資料夾重複數設為1
52
- accelerate launch --multi_gpu --dynamo_backend no --dynamo_mode default --mixed_precision bf16 --gpu_ids 0,1,2 --num_processes 3 --num_machines 1 --num_cpu_threads_per_process 2 flux_train_network.py --config_file /workspace/config_lora_b8base_flux.toml
53
-
54
- tensorboard --host 0.0.0.0 --logdir=/workspace/train/log
55
- '''
56
-
57
- cd /workspace/sd-scripts
58
- source /workspace/sd-scripts/env/bin/activate