hcpdiff 0.9.1__py3-none-any.whl → 2.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- hcpdiff/__init__.py +4 -4
- hcpdiff/ckpt_manager/__init__.py +4 -5
- hcpdiff/ckpt_manager/ckpt.py +24 -0
- hcpdiff/ckpt_manager/format/__init__.py +4 -0
- hcpdiff/ckpt_manager/format/diffusers.py +59 -0
- hcpdiff/ckpt_manager/format/emb.py +21 -0
- hcpdiff/ckpt_manager/format/lora_webui.py +252 -0
- hcpdiff/ckpt_manager/format/sd_single.py +41 -0
- hcpdiff/ckpt_manager/loader.py +64 -0
- hcpdiff/data/__init__.py +4 -28
- hcpdiff/data/cache/__init__.py +1 -0
- hcpdiff/data/cache/vae.py +102 -0
- hcpdiff/data/dataset.py +20 -0
- hcpdiff/data/handler/__init__.py +3 -0
- hcpdiff/data/handler/controlnet.py +18 -0
- hcpdiff/data/handler/diffusion.py +90 -0
- hcpdiff/data/handler/text.py +111 -0
- hcpdiff/data/source/__init__.py +3 -3
- hcpdiff/data/source/folder_class.py +12 -29
- hcpdiff/data/source/text.py +40 -0
- hcpdiff/data/source/text2img.py +36 -74
- hcpdiff/data/source/text2img_cond.py +9 -15
- hcpdiff/diffusion/__init__.py +0 -0
- hcpdiff/diffusion/noise/__init__.py +2 -0
- hcpdiff/diffusion/noise/pyramid_noise.py +42 -0
- hcpdiff/diffusion/noise/zero_terminal.py +39 -0
- hcpdiff/diffusion/sampler/__init__.py +5 -0
- hcpdiff/diffusion/sampler/base.py +72 -0
- hcpdiff/diffusion/sampler/ddpm.py +20 -0
- hcpdiff/diffusion/sampler/diffusers.py +66 -0
- hcpdiff/diffusion/sampler/edm.py +22 -0
- hcpdiff/diffusion/sampler/sigma_scheduler/__init__.py +3 -0
- hcpdiff/diffusion/sampler/sigma_scheduler/base.py +14 -0
- hcpdiff/diffusion/sampler/sigma_scheduler/ddpm.py +197 -0
- hcpdiff/diffusion/sampler/sigma_scheduler/edm.py +48 -0
- hcpdiff/easy/__init__.py +2 -0
- hcpdiff/easy/cfg/__init__.py +3 -0
- hcpdiff/easy/cfg/sd15_train.py +207 -0
- hcpdiff/easy/cfg/sdxl_train.py +147 -0
- hcpdiff/easy/cfg/t2i.py +228 -0
- hcpdiff/easy/model/__init__.py +2 -0
- hcpdiff/easy/model/cnet.py +31 -0
- hcpdiff/easy/model/loader.py +79 -0
- hcpdiff/easy/sampler.py +46 -0
- hcpdiff/evaluate/__init__.py +1 -0
- hcpdiff/evaluate/previewer.py +60 -0
- hcpdiff/loss/__init__.py +4 -1
- hcpdiff/loss/base.py +41 -0
- hcpdiff/loss/gw.py +35 -0
- hcpdiff/loss/ssim.py +37 -0
- hcpdiff/loss/vlb.py +79 -0
- hcpdiff/loss/weighting.py +66 -0
- hcpdiff/models/__init__.py +2 -2
- hcpdiff/models/cfg_context.py +17 -14
- hcpdiff/models/compose/compose_hook.py +44 -23
- hcpdiff/models/compose/compose_tokenizer.py +21 -8
- hcpdiff/models/compose/sdxl_composer.py +4 -4
- hcpdiff/models/controlnet.py +16 -16
- hcpdiff/models/lora_base_patch.py +14 -25
- hcpdiff/models/lora_layers.py +3 -9
- hcpdiff/models/lora_layers_patch.py +14 -24
- hcpdiff/models/text_emb_ex.py +84 -6
- hcpdiff/models/textencoder_ex.py +54 -18
- hcpdiff/models/wrapper/__init__.py +3 -0
- hcpdiff/models/wrapper/pixart.py +19 -0
- hcpdiff/models/wrapper/sd.py +218 -0
- hcpdiff/models/wrapper/utils.py +20 -0
- hcpdiff/parser/__init__.py +1 -0
- hcpdiff/parser/embpt.py +32 -0
- hcpdiff/tools/convert_caption_txt2json.py +1 -1
- hcpdiff/tools/dataset_generator.py +94 -0
- hcpdiff/tools/download_hf_model.py +24 -0
- hcpdiff/tools/init_proj.py +3 -21
- hcpdiff/tools/lora_convert.py +18 -17
- hcpdiff/tools/save_model.py +12 -0
- hcpdiff/tools/sd2diffusers.py +1 -1
- hcpdiff/train_colo.py +1 -1
- hcpdiff/train_deepspeed.py +1 -1
- hcpdiff/trainer_ac.py +79 -0
- hcpdiff/trainer_ac_single.py +31 -0
- hcpdiff/utils/__init__.py +0 -2
- hcpdiff/utils/inpaint_pipe.py +7 -2
- hcpdiff/utils/net_utils.py +29 -6
- hcpdiff/utils/pipe_hook.py +24 -7
- hcpdiff/utils/utils.py +21 -4
- hcpdiff/workflow/__init__.py +15 -10
- hcpdiff/workflow/daam/__init__.py +1 -0
- hcpdiff/workflow/daam/act.py +66 -0
- hcpdiff/workflow/daam/hook.py +109 -0
- hcpdiff/workflow/diffusion.py +118 -128
- hcpdiff/workflow/fast.py +31 -0
- hcpdiff/workflow/flow.py +67 -0
- hcpdiff/workflow/io.py +36 -130
- hcpdiff/workflow/model.py +46 -43
- hcpdiff/workflow/text.py +60 -47
- hcpdiff/workflow/utils.py +32 -12
- hcpdiff/workflow/vae.py +37 -38
- hcpdiff-2.2.dist-info/METADATA +299 -0
- hcpdiff-2.2.dist-info/RECORD +115 -0
- {hcpdiff-0.9.1.dist-info → hcpdiff-2.2.dist-info}/WHEEL +1 -1
- hcpdiff-2.2.dist-info/entry_points.txt +5 -0
- hcpdiff/ckpt_manager/base.py +0 -16
- hcpdiff/ckpt_manager/ckpt_diffusers.py +0 -45
- hcpdiff/ckpt_manager/ckpt_pkl.py +0 -138
- hcpdiff/ckpt_manager/ckpt_safetensor.py +0 -64
- hcpdiff/ckpt_manager/ckpt_webui.py +0 -54
- hcpdiff/data/bucket.py +0 -358
- hcpdiff/data/caption_loader.py +0 -80
- hcpdiff/data/cond_dataset.py +0 -40
- hcpdiff/data/crop_info_dataset.py +0 -40
- hcpdiff/data/data_processor.py +0 -33
- hcpdiff/data/pair_dataset.py +0 -146
- hcpdiff/data/sampler.py +0 -54
- hcpdiff/data/source/base.py +0 -30
- hcpdiff/data/utils.py +0 -80
- hcpdiff/deprecated/__init__.py +0 -1
- hcpdiff/deprecated/cfg_converter.py +0 -81
- hcpdiff/deprecated/lora_convert.py +0 -31
- hcpdiff/infer_workflow.py +0 -57
- hcpdiff/loggers/__init__.py +0 -13
- hcpdiff/loggers/base_logger.py +0 -76
- hcpdiff/loggers/cli_logger.py +0 -40
- hcpdiff/loggers/preview/__init__.py +0 -1
- hcpdiff/loggers/preview/image_previewer.py +0 -149
- hcpdiff/loggers/tensorboard_logger.py +0 -30
- hcpdiff/loggers/wandb_logger.py +0 -31
- hcpdiff/loggers/webui_logger.py +0 -9
- hcpdiff/loss/min_snr_loss.py +0 -52
- hcpdiff/models/layers.py +0 -81
- hcpdiff/models/plugin.py +0 -348
- hcpdiff/models/wrapper.py +0 -75
- hcpdiff/noise/__init__.py +0 -3
- hcpdiff/noise/noise_base.py +0 -16
- hcpdiff/noise/pyramid_noise.py +0 -50
- hcpdiff/noise/zero_terminal.py +0 -44
- hcpdiff/train_ac.py +0 -566
- hcpdiff/train_ac_single.py +0 -39
- hcpdiff/utils/caption_tools.py +0 -105
- hcpdiff/utils/cfg_net_tools.py +0 -321
- hcpdiff/utils/cfg_resolvers.py +0 -16
- hcpdiff/utils/ema.py +0 -52
- hcpdiff/utils/img_size_tool.py +0 -248
- hcpdiff/vis/__init__.py +0 -3
- hcpdiff/vis/base_interface.py +0 -12
- hcpdiff/vis/disk_interface.py +0 -48
- hcpdiff/vis/webui_interface.py +0 -17
- hcpdiff/viser_fast.py +0 -138
- hcpdiff/visualizer.py +0 -265
- hcpdiff/visualizer_reloadable.py +0 -237
- hcpdiff/workflow/base.py +0 -59
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/infer/anime/text2img_anime.yaml +0 -21
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/infer/anime/text2img_anime_lora.yaml +0 -58
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/infer/change_vae.yaml +0 -6
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/infer/euler_a.yaml +0 -8
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/infer/img2img.yaml +0 -10
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/infer/img2img_controlnet.yaml +0 -19
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/infer/inpaint.yaml +0 -11
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/infer/load_lora.yaml +0 -26
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/infer/load_unet_part.yaml +0 -18
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/infer/offload_2GB.yaml +0 -6
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/infer/save_model.yaml +0 -44
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/infer/text2img.yaml +0 -53
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/infer/text2img_DA++.yaml +0 -34
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/infer/text2img_sdxl.yaml +0 -9
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/plugins/plugin_controlnet.yaml +0 -17
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/te_struct.txt +0 -193
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/train/dataset/base_dataset.yaml +0 -29
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/train/dataset/regularization_dataset.yaml +0 -31
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/train/examples/CustomDiffusion.yaml +0 -74
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/train/examples/DreamArtist++.yaml +0 -135
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/train/examples/DreamArtist.yaml +0 -45
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/train/examples/DreamBooth.yaml +0 -62
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/train/examples/FT_sdxl.yaml +0 -33
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/train/examples/Lion_optimizer.yaml +0 -17
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/train/examples/TextualInversion.yaml +0 -41
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/train/examples/add_logger_tensorboard_wandb.yaml +0 -15
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/train/examples/controlnet.yaml +0 -53
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/train/examples/ema.yaml +0 -10
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/train/examples/fine-tuning.yaml +0 -53
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/train/examples/locon.yaml +0 -24
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/train/examples/lora_anime_character.yaml +0 -77
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/train/examples/lora_conventional.yaml +0 -56
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/train/examples/lora_sdxl.yaml +0 -41
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/train/examples/min_snr.yaml +0 -7
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/train/examples/preview_in_training.yaml +0 -6
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/train/examples_noob/DreamBooth.yaml +0 -70
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/train/examples_noob/TextualInversion.yaml +0 -45
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/train/examples_noob/fine-tuning.yaml +0 -45
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/train/examples_noob/lora.yaml +0 -63
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/train/train_base.yaml +0 -81
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/train/tuning_base.yaml +0 -42
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/unet_struct.txt +0 -932
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/workflow/highres_fix_latent.yaml +0 -86
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/workflow/highres_fix_pixel.yaml +0 -99
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/workflow/text2img.yaml +0 -59
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/workflow/text2img_lora.yaml +0 -70
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/zero2.json +0 -32
- hcpdiff-0.9.1.data/data/hcpdiff/cfgs/zero3.json +0 -39
- hcpdiff-0.9.1.data/data/hcpdiff/prompt_tuning_template/caption.txt +0 -1
- hcpdiff-0.9.1.data/data/hcpdiff/prompt_tuning_template/name.txt +0 -1
- hcpdiff-0.9.1.data/data/hcpdiff/prompt_tuning_template/name_2pt_caption.txt +0 -1
- hcpdiff-0.9.1.data/data/hcpdiff/prompt_tuning_template/name_caption.txt +0 -1
- hcpdiff-0.9.1.data/data/hcpdiff/prompt_tuning_template/object.txt +0 -27
- hcpdiff-0.9.1.data/data/hcpdiff/prompt_tuning_template/object_caption.txt +0 -27
- hcpdiff-0.9.1.data/data/hcpdiff/prompt_tuning_template/style.txt +0 -19
- hcpdiff-0.9.1.data/data/hcpdiff/prompt_tuning_template/style_caption.txt +0 -19
- hcpdiff-0.9.1.dist-info/METADATA +0 -199
- hcpdiff-0.9.1.dist-info/RECORD +0 -160
- hcpdiff-0.9.1.dist-info/entry_points.txt +0 -2
- {hcpdiff-0.9.1.dist-info → hcpdiff-2.2.dist-info/licenses}/LICENSE +0 -0
- {hcpdiff-0.9.1.dist-info → hcpdiff-2.2.dist-info}/top_level.txt +0 -0
@@ -1,70 +0,0 @@
|
|
1
|
-
_base_:
|
2
|
-
- cfgs/train/dataset/regularization_dataset.yaml
|
3
|
-
- cfgs/train/train_base.yaml
|
4
|
-
- cfgs/train/tuning_base.yaml
|
5
|
-
|
6
|
-
# 这部分根据需要改
|
7
|
-
|
8
|
-
train:
|
9
|
-
save_step: 100
|
10
|
-
|
11
|
-
model:
|
12
|
-
pretrained_model_name_or_path: 'runwayml/stable-diffusion-v1-5'
|
13
|
-
lr: 1e-6
|
14
|
-
|
15
|
-
data_cfg:
|
16
|
-
batch_size: 4
|
17
|
-
img_root: 'imgs/' # 数据集路径
|
18
|
-
caption_file: 'imgs/' # 标注文件或文件夹
|
19
|
-
regularization_img_root: 'imgs/' # 正则化数据集
|
20
|
-
regularization_caption_file: 'imgs/' # 正则化数据集标注文件
|
21
|
-
target_area: 512*512 # 训练预期分辨率
|
22
|
-
|
23
|
-
object_name: pt-cat1 # 训练物体名称
|
24
|
-
class_name: cat # 训练类别名称
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
# 这部分不用动
|
29
|
-
|
30
|
-
unet:
|
31
|
-
-
|
32
|
-
lr: ${model.lr}
|
33
|
-
layers:
|
34
|
-
- ''
|
35
|
-
|
36
|
-
data:
|
37
|
-
dataset1:
|
38
|
-
batch_size: ${data_cfg.batch_size}
|
39
|
-
cache_latents: True
|
40
|
-
|
41
|
-
source:
|
42
|
-
data_source1:
|
43
|
-
img_root: ${data_cfg.img_root}
|
44
|
-
prompt_template: 'prompt_tuning_template/object.txt'
|
45
|
-
caption_file: ${data_cfg.caption_file}
|
46
|
-
|
47
|
-
word_names:
|
48
|
-
pt1: ${object_name}
|
49
|
-
class: ${class_name}
|
50
|
-
bucket:
|
51
|
-
_target_: hcpdiff.data.bucket.RatioBucket.from_files # aspect ratio bucket
|
52
|
-
target_area: ${hcp.eval:"${data_cfg.target_area}"}
|
53
|
-
num_bucket: 1
|
54
|
-
|
55
|
-
dataset_class:
|
56
|
-
batch_size: 1
|
57
|
-
cache_latents: True
|
58
|
-
loss_weight: 1.0
|
59
|
-
|
60
|
-
source:
|
61
|
-
data_source1:
|
62
|
-
img_root: ${data_cfg.regularization_img_root}
|
63
|
-
prompt_template: 'prompt_tuning_template/object.txt'
|
64
|
-
caption_file: ${data_cfg.regularization_caption_file}
|
65
|
-
|
66
|
-
word_names:
|
67
|
-
class: ${class_name}
|
68
|
-
bucket:
|
69
|
-
_target_: hcpdiff.data.bucket.FixedBucket
|
70
|
-
target_size: [512, 512]
|
@@ -1,45 +0,0 @@
|
|
1
|
-
_base_:
|
2
|
-
- cfgs/train/dataset/base_dataset.yaml
|
3
|
-
- cfgs/train/train_base.yaml
|
4
|
-
- cfgs/train/tuning_base.yaml
|
5
|
-
|
6
|
-
# 这部分根据需要改
|
7
|
-
|
8
|
-
train:
|
9
|
-
save_step: 100
|
10
|
-
|
11
|
-
model:
|
12
|
-
pretrained_model_name_or_path: 'runwayml/stable-diffusion-v1-5'
|
13
|
-
lr: 1e-6
|
14
|
-
train_word_name: pt-catgirl1 # 训练单词名(需要提前创建单词)
|
15
|
-
|
16
|
-
data_cfg:
|
17
|
-
batch_size: 4
|
18
|
-
img_root: 'imgs/' # 数据集路径
|
19
|
-
caption_file: 'imgs/' # 标注文件或文件夹
|
20
|
-
target_area: 512*512 # 训练预期分辨率
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
# 这部分不用动
|
27
|
-
|
28
|
-
data:
|
29
|
-
dataset1:
|
30
|
-
batch_size: ${data_cfg.batch_size}
|
31
|
-
cache_latents: True
|
32
|
-
|
33
|
-
source:
|
34
|
-
data_source1:
|
35
|
-
img_root: ${data_cfg.img_root}
|
36
|
-
prompt_template: 'prompt_tuning_template/object.txt'
|
37
|
-
caption_file: ${data_cfg.caption_file}
|
38
|
-
|
39
|
-
word_names:
|
40
|
-
pt1: ${model.train_word_name}
|
41
|
-
|
42
|
-
bucket:
|
43
|
-
_target_: hcpdiff.data.bucket.RatioBucket.from_files # aspect ratio bucket
|
44
|
-
target_area: ${hcp.eval:"${data_cfg.target_area}"}
|
45
|
-
num_bucket: 3
|
@@ -1,45 +0,0 @@
|
|
1
|
-
_base_:
|
2
|
-
- cfgs/train/dataset/base_dataset.yaml
|
3
|
-
- cfgs/train/train_base.yaml
|
4
|
-
- cfgs/train/tuning_base.yaml
|
5
|
-
|
6
|
-
# 这部分根据需要改
|
7
|
-
|
8
|
-
train:
|
9
|
-
save_step: 100
|
10
|
-
|
11
|
-
model:
|
12
|
-
pretrained_model_name_or_path: 'runwayml/stable-diffusion-v1-5'
|
13
|
-
lr: 1e-6
|
14
|
-
|
15
|
-
data_cfg:
|
16
|
-
batch_size: 4
|
17
|
-
img_root: 'imgs/' # 数据集路径
|
18
|
-
caption_file: 'imgs/' # 标注文件或文件夹
|
19
|
-
target_area: 512*512 # 训练预期分辨率
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
# 这部分不用动
|
25
|
-
unet:
|
26
|
-
-
|
27
|
-
lr: ${model.lr}
|
28
|
-
layers:
|
29
|
-
- '' # fine-tuning all layers in unet
|
30
|
-
|
31
|
-
data:
|
32
|
-
dataset1:
|
33
|
-
batch_size: ${data_cfg.batch_size}
|
34
|
-
cache_latents: True
|
35
|
-
|
36
|
-
source:
|
37
|
-
data_source1:
|
38
|
-
img_root: ${data_cfg.img_root}
|
39
|
-
prompt_template: 'prompt_tuning_template/object.txt'
|
40
|
-
caption_file: ${data_cfg.caption_file}
|
41
|
-
|
42
|
-
bucket:
|
43
|
-
_target_: hcpdiff.data.bucket.RatioBucket.from_files # aspect ratio bucket
|
44
|
-
target_area: ${hcp.eval:"${data_cfg.target_area}"}
|
45
|
-
num_bucket: 3
|
@@ -1,63 +0,0 @@
|
|
1
|
-
_base_:
|
2
|
-
- cfgs/train/dataset/base_dataset.yaml
|
3
|
-
- cfgs/train/train_base.yaml
|
4
|
-
- cfgs/train/tuning_base.yaml
|
5
|
-
|
6
|
-
|
7
|
-
# 这部分根据需要改
|
8
|
-
|
9
|
-
train:
|
10
|
-
save_step: 100
|
11
|
-
|
12
|
-
model:
|
13
|
-
pretrained_model_name_or_path: 'runwayml/stable-diffusion-v1-5'
|
14
|
-
lr_unet: 1e-4
|
15
|
-
lr_text_encoder: 1e-5
|
16
|
-
lora_rank: 8
|
17
|
-
|
18
|
-
data_cfg:
|
19
|
-
batch_size: 4
|
20
|
-
img_root: 'imgs/' # 数据集路径
|
21
|
-
caption_file: 'imgs/' # 标注文件或文件夹
|
22
|
-
target_area: 512*512 # 训练预期分辨率
|
23
|
-
|
24
|
-
object_name: pt-cat1 # lora训练的物体名(触发词)
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
# 这部分不用动
|
30
|
-
|
31
|
-
lora_unet:
|
32
|
-
-
|
33
|
-
lr: ${model.lr_unet}
|
34
|
-
rank: ${model.lora_rank}
|
35
|
-
layers:
|
36
|
-
- 're:.*\.attn.?$'
|
37
|
-
- 're:.*\.ff$'
|
38
|
-
|
39
|
-
lora_text_encoder:
|
40
|
-
- lr: ${model.lr_text_encoder}
|
41
|
-
rank: ${model.lora_rank}
|
42
|
-
layers:
|
43
|
-
- 're:.*self_attn$'
|
44
|
-
- 're:.*mlp$'
|
45
|
-
|
46
|
-
data:
|
47
|
-
dataset1:
|
48
|
-
batch_size: ${data_cfg.batch_size}
|
49
|
-
cache_latents: True
|
50
|
-
|
51
|
-
source:
|
52
|
-
data_source1:
|
53
|
-
img_root: ${data_cfg.img_root}
|
54
|
-
prompt_template: 'prompt_tuning_template/object.txt'
|
55
|
-
caption_file: ${data_cfg.caption_file}
|
56
|
-
|
57
|
-
word_names:
|
58
|
-
pt1: ${object_name}
|
59
|
-
|
60
|
-
bucket:
|
61
|
-
_target_: hcpdiff.data.bucket.RatioBucket.from_files # aspect ratio bucket
|
62
|
-
target_area: ${hcp.eval:"${data_cfg.target_area}"}
|
63
|
-
num_bucket: 3
|
@@ -1,81 +0,0 @@
|
|
1
|
-
|
2
|
-
exp_dir: exps/${hcp.time:}
|
3
|
-
mixed_precision: 'fp16'
|
4
|
-
allow_tf32: False
|
5
|
-
seed: 114514
|
6
|
-
ckpt_type: 'safetensors' # [torch, safetensors]
|
7
|
-
|
8
|
-
vis_info:
|
9
|
-
prompt: null
|
10
|
-
negative_prompt: ''
|
11
|
-
|
12
|
-
train:
|
13
|
-
train_steps: 1000
|
14
|
-
train_epochs: null # Choose one of [train_steps, train_epochs]
|
15
|
-
gradient_accumulation_steps: 1
|
16
|
-
workers: 4
|
17
|
-
max_grad_norm: 1.0
|
18
|
-
set_grads_to_none: False
|
19
|
-
save_step: 100
|
20
|
-
cfg_scale: '1.0' # for DreamArtist
|
21
|
-
|
22
|
-
resume: null
|
23
|
-
# resume:
|
24
|
-
# ckpt_path:
|
25
|
-
# unet: []
|
26
|
-
# TE: []
|
27
|
-
# words: {}
|
28
|
-
# start_step: 0
|
29
|
-
|
30
|
-
loss:
|
31
|
-
criterion:
|
32
|
-
_target_: torch.nn.MSELoss
|
33
|
-
_partial_: True
|
34
|
-
reduction: 'none' # support for attention mask
|
35
|
-
type: 'eps' # 'eps' or 'sample'
|
36
|
-
|
37
|
-
optimizer:
|
38
|
-
_target_: torch.optim.AdamW
|
39
|
-
_partial_: True
|
40
|
-
weight_decay: 1e-3
|
41
|
-
|
42
|
-
optimizer_pt:
|
43
|
-
_target_: torch.optim.AdamW
|
44
|
-
_partial_: True
|
45
|
-
weight_decay: 5e-4
|
46
|
-
|
47
|
-
scale_lr: True # auto scale lr with total batch size
|
48
|
-
scheduler:
|
49
|
-
name: 'one_cycle'
|
50
|
-
num_warmup_steps: 200
|
51
|
-
num_training_steps: 1000
|
52
|
-
scheduler_kwargs: {} # args for scheduler
|
53
|
-
|
54
|
-
scale_lr_pt: True
|
55
|
-
scheduler_pt: ${.scheduler}
|
56
|
-
|
57
|
-
logger:
|
58
|
-
-
|
59
|
-
_target_: hcpdiff.loggers.CLILogger
|
60
|
-
_partial_: True
|
61
|
-
out_path: 'train.log'
|
62
|
-
log_step: 20
|
63
|
-
|
64
|
-
model:
|
65
|
-
revision: null
|
66
|
-
pretrained_model_name_or_path: null
|
67
|
-
tokenizer_repeats: 2
|
68
|
-
enable_xformers: True
|
69
|
-
gradient_checkpointing: True
|
70
|
-
force_cast_precision: False
|
71
|
-
ema: null
|
72
|
-
clip_skip: 0
|
73
|
-
clip_final_norm: True
|
74
|
-
|
75
|
-
tokenizer: null
|
76
|
-
noise_scheduler: null
|
77
|
-
unet: null
|
78
|
-
text_encoder: null
|
79
|
-
vae: null
|
80
|
-
|
81
|
-
previewer: null
|
@@ -1,42 +0,0 @@
|
|
1
|
-
# down部分总共6个 (Resnet+Transformer) 块,分别对应于:
|
2
|
-
# 1:
|
3
|
-
# down_blocks.0.resnets.0
|
4
|
-
# down_blocks.0.attentions.0.transformer_blocks.0
|
5
|
-
# 2:
|
6
|
-
# down_blocks.0.resnets.1
|
7
|
-
# down_blocks.0.attentions.1.transformer_blocks.0
|
8
|
-
# 3:
|
9
|
-
# down_blocks.1.resnets.0
|
10
|
-
# down_blocks.1.attentions.0.transformer_blocks.0
|
11
|
-
# ......
|
12
|
-
|
13
|
-
# up部分总共9个 (Resnet+Transformer) 块,分别对应于:
|
14
|
-
# 1:
|
15
|
-
# up_blocks.1.resnets.0
|
16
|
-
# up_blocks.1.attentions.0.transformer_blocks.0
|
17
|
-
# 2:
|
18
|
-
# up_blocks.1.resnets.1
|
19
|
-
# up_blocks.1.attentions.1.transformer_blocks.0
|
20
|
-
# 3:
|
21
|
-
# up_blocks.1.resnets.2
|
22
|
-
# up_blocks.1.attentions.2.transformer_blocks.0
|
23
|
-
# 4:
|
24
|
-
# up_blocks.2.resnets.0
|
25
|
-
# up_blocks.2.attentions.0.transformer_blocks.0
|
26
|
-
# ......
|
27
|
-
|
28
|
-
tokenizer_pt:
|
29
|
-
emb_dir: 'embs/'
|
30
|
-
replace: False
|
31
|
-
train: []
|
32
|
-
#train:
|
33
|
-
# - {name: pt1, lr: 1e-3}
|
34
|
-
|
35
|
-
unet: null
|
36
|
-
lora_unet: null
|
37
|
-
|
38
|
-
text_encoder: null
|
39
|
-
lora_text_encoder: null
|
40
|
-
|
41
|
-
plugin_unet: null
|
42
|
-
plugin_TE: null
|