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,86 +0,0 @@
|
|
1
|
-
dtype: fp16
|
2
|
-
bs: 2
|
3
|
-
seed: 42
|
4
|
-
|
5
|
-
memory: { }
|
6
|
-
|
7
|
-
prepare:
|
8
|
-
- _target_: hcpdiff.workflow.LoadModelsAction
|
9
|
-
pretrained_model: 'ckpts/any5'
|
10
|
-
dtype: ${dtype}
|
11
|
-
scheduler:
|
12
|
-
_target_: diffusers.EulerAncestralDiscreteScheduler # change Sampler
|
13
|
-
beta_start: 0.00085
|
14
|
-
beta_end: 0.012
|
15
|
-
beta_schedule: 'scaled_linear'
|
16
|
-
- _target_: hcpdiff.workflow.XformersEnableAction
|
17
|
-
- _target_: hcpdiff.workflow.ExecAction
|
18
|
-
prog: |-
|
19
|
-
import torch
|
20
|
-
from hcpdiff.utils.net_utils import to_cpu, to_cuda
|
21
|
-
to_cuda(memory.unet)
|
22
|
-
to_cuda(memory.text_encoder)
|
23
|
-
memory.vae.to(dtype=torch.bfloat16)
|
24
|
-
#to_cuda(memory.vae)
|
25
|
-
- _target_: hcpdiff.workflow.PrepareDiffusionAction
|
26
|
-
dtype: ${dtype}
|
27
|
-
- _target_: hcpdiff.workflow.VaeOptimizeAction
|
28
|
-
slicing: True
|
29
|
-
|
30
|
-
actions:
|
31
|
-
- _target_: hcpdiff.workflow.TextHookAction # text encoder and tokenizer auto get from memory
|
32
|
-
N_repeats: 1
|
33
|
-
layer_skip: 1
|
34
|
-
# encode text
|
35
|
-
- _target_: hcpdiff.workflow.AttnMultTextEncodeAction
|
36
|
-
prompt: 'masterpiece, best quality, 1girl, cat ears, outside'
|
37
|
-
negative_prompt: 'lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry'
|
38
|
-
bs: ${bs}
|
39
|
-
# prepare seed
|
40
|
-
- _target_: hcpdiff.workflow.SeedAction
|
41
|
-
seed: ${seed}
|
42
|
-
- _target_: hcpdiff.workflow.MakeTimestepsAction
|
43
|
-
N_steps: 30
|
44
|
-
# text to image
|
45
|
-
- _target_: hcpdiff.workflow.MakeLatentAction
|
46
|
-
width: 512
|
47
|
-
height: 768
|
48
|
-
- _target_: hcpdiff.workflow.LoopAction
|
49
|
-
loop_value:
|
50
|
-
timesteps: t
|
51
|
-
actions:
|
52
|
-
- _target_: hcpdiff.workflow.DiffusionStepAction
|
53
|
-
guidance_scale: 7.0
|
54
|
-
|
55
|
-
# image to image
|
56
|
-
- _target_: hcpdiff.workflow.LatentResizeAction
|
57
|
-
- _target_: hcpdiff.workflow.SeedAction
|
58
|
-
seed: ${seed}
|
59
|
-
- _target_: hcpdiff.workflow.MakeTimestepsAction
|
60
|
-
N_steps: 30
|
61
|
-
# only part of timesteps
|
62
|
-
- _target_: hcpdiff.workflow.ExecAction
|
63
|
-
prog: |-
|
64
|
-
states['timesteps'] = states['timesteps'][int(30*(1-0.6)):]
|
65
|
-
states['start_timestep'] = states['timesteps'][:1]
|
66
|
-
- _target_: hcpdiff.workflow.MakeLatentAction
|
67
|
-
width: 1024
|
68
|
-
height: 1536
|
69
|
-
- _target_: hcpdiff.workflow.LoopAction
|
70
|
-
loop_value:
|
71
|
-
timesteps: t
|
72
|
-
actions:
|
73
|
-
- _target_: hcpdiff.workflow.DiffusionStepAction
|
74
|
-
guidance_scale: 7.0
|
75
|
-
|
76
|
-
# decode to image
|
77
|
-
- _target_: hcpdiff.workflow.ExecAction
|
78
|
-
prog: |-
|
79
|
-
from hcpdiff.utils.net_utils import to_cpu, to_cuda
|
80
|
-
to_cpu(memory.unet)
|
81
|
-
- _target_: hcpdiff.workflow.DecodeAction
|
82
|
-
vae: ${hcp.from_memory:vae}
|
83
|
-
offload: true
|
84
|
-
- _target_: hcpdiff.workflow.SaveImageAction
|
85
|
-
save_root: output_pipe/
|
86
|
-
image_type: png
|
@@ -1,99 +0,0 @@
|
|
1
|
-
dtype: fp16
|
2
|
-
bs: 2
|
3
|
-
seed: 42
|
4
|
-
|
5
|
-
memory: { }
|
6
|
-
|
7
|
-
prepare:
|
8
|
-
- _target_: hcpdiff.workflow.LoadModelsAction
|
9
|
-
pretrained_model: 'ckpts/any5'
|
10
|
-
dtype: ${dtype}
|
11
|
-
scheduler:
|
12
|
-
_target_: diffusers.EulerAncestralDiscreteScheduler # change Sampler
|
13
|
-
beta_start: 0.00085
|
14
|
-
beta_end: 0.012
|
15
|
-
beta_schedule: 'scaled_linear'
|
16
|
-
- _target_: hcpdiff.workflow.XformersEnableAction
|
17
|
-
- _target_: hcpdiff.workflow.ExecAction
|
18
|
-
prog: |-
|
19
|
-
import torch
|
20
|
-
memory.vae.to(dtype=torch.bfloat16)
|
21
|
-
- _target_: hcpdiff.workflow.PrepareDiffusionAction
|
22
|
-
dtype: ${dtype}
|
23
|
-
- _target_: hcpdiff.workflow.VaeOptimizeAction
|
24
|
-
slicing: True
|
25
|
-
|
26
|
-
actions:
|
27
|
-
- _target_: hcpdiff.workflow.TextHookAction # text encoder and tokenizer auto get from memory
|
28
|
-
N_repeats: 1
|
29
|
-
layer_skip: 1
|
30
|
-
# encode text
|
31
|
-
- _target_: hcpdiff.workflow.StartTextEncode
|
32
|
-
- _target_: hcpdiff.workflow.AttnMultTextEncodeAction
|
33
|
-
prompt: 'masterpiece, best quality, 1girl, cat ears, outside'
|
34
|
-
negative_prompt: 'lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry'
|
35
|
-
bs: ${bs}
|
36
|
-
- _target_: hcpdiff.workflow.EndTextEncode
|
37
|
-
|
38
|
-
- _target_: hcpdiff.workflow.StartDiffusion
|
39
|
-
# prepare seed
|
40
|
-
- _target_: hcpdiff.workflow.SeedAction
|
41
|
-
seed: ${seed}
|
42
|
-
- _target_: hcpdiff.workflow.MakeTimestepsAction
|
43
|
-
N_steps: 30
|
44
|
-
# text to image
|
45
|
-
- _target_: hcpdiff.workflow.MakeLatentAction
|
46
|
-
width: 512
|
47
|
-
height: 768
|
48
|
-
- _target_: hcpdiff.workflow.LoopAction
|
49
|
-
loop_value:
|
50
|
-
timesteps: t
|
51
|
-
actions:
|
52
|
-
- _target_: hcpdiff.workflow.DiffusionStepAction
|
53
|
-
guidance_scale: 7.0
|
54
|
-
- _target_: hcpdiff.workflow.EndDiffusion
|
55
|
-
|
56
|
-
# decode and resize image
|
57
|
-
- _target_: hcpdiff.workflow.DecodeAction
|
58
|
-
vae: ${hcp.from_memory:vae}
|
59
|
-
offload: false
|
60
|
-
- _target_: hcpdiff.workflow.SaveImageAction
|
61
|
-
save_root: output_pipe/
|
62
|
-
image_type: webp
|
63
|
-
- _target_: hcpdiff.workflow.ImageResizeAction
|
64
|
-
- _target_: hcpdiff.workflow.EncodeAction
|
65
|
-
vae: ${hcp.from_memory:vae}
|
66
|
-
|
67
|
-
# image to image
|
68
|
-
- _target_: hcpdiff.workflow.StartDiffusion
|
69
|
-
- _target_: hcpdiff.workflow.SeedAction
|
70
|
-
seed: ${seed}
|
71
|
-
- _target_: hcpdiff.workflow.MakeTimestepsAction
|
72
|
-
N_steps: 30
|
73
|
-
# only part of timesteps
|
74
|
-
- _target_: hcpdiff.workflow.ExecAction
|
75
|
-
prog: |-
|
76
|
-
states['timesteps'] = states['timesteps'][int(30*(1-0.6)):]
|
77
|
-
states['start_timestep'] = states['timesteps'][:1]
|
78
|
-
- _target_: hcpdiff.workflow.MakeLatentAction
|
79
|
-
width: 1024
|
80
|
-
height: 1536
|
81
|
-
- _target_: hcpdiff.workflow.LoopAction
|
82
|
-
loop_value:
|
83
|
-
timesteps: t
|
84
|
-
actions:
|
85
|
-
- _target_: hcpdiff.workflow.DiffusionStepAction
|
86
|
-
guidance_scale: 7.0
|
87
|
-
- _target_: hcpdiff.workflow.EndDiffusion
|
88
|
-
|
89
|
-
# decode to image
|
90
|
-
- _target_: hcpdiff.workflow.ExecAction
|
91
|
-
prog: |-
|
92
|
-
from hcpdiff.utils.net_utils import to_cpu, to_cuda
|
93
|
-
to_cpu(memory.unet)
|
94
|
-
- _target_: hcpdiff.workflow.DecodeAction
|
95
|
-
vae: ${hcp.from_memory:vae}
|
96
|
-
offload: true
|
97
|
-
- _target_: hcpdiff.workflow.SaveImageAction
|
98
|
-
save_root: output_pipe/
|
99
|
-
image_type: png
|
@@ -1,59 +0,0 @@
|
|
1
|
-
dtype: fp16
|
2
|
-
amp: fp16
|
3
|
-
bs: 2
|
4
|
-
seed: 42
|
5
|
-
|
6
|
-
memory: { }
|
7
|
-
|
8
|
-
prepare:
|
9
|
-
- _target_: hcpdiff.workflow.LoadModelsAction
|
10
|
-
pretrained_model: 'ckpts/any5'
|
11
|
-
dtype: ${dtype}
|
12
|
-
scheduler:
|
13
|
-
_target_: diffusers.EulerAncestralDiscreteScheduler # change Sampler
|
14
|
-
beta_start: 0.00085
|
15
|
-
beta_end: 0.012
|
16
|
-
beta_schedule: 'scaled_linear'
|
17
|
-
- _target_: hcpdiff.workflow.XformersEnableAction
|
18
|
-
- _target_: hcpdiff.workflow.ExecAction
|
19
|
-
prog: |-
|
20
|
-
from hcpdiff.utils.net_utils import to_cpu, to_cuda
|
21
|
-
to_cuda(memory.unet)
|
22
|
-
to_cuda(memory.text_encoder)
|
23
|
-
to_cuda(memory.vae)
|
24
|
-
- _target_: hcpdiff.workflow.PrepareDiffusionAction
|
25
|
-
dtype: ${dtype}
|
26
|
-
amp: ${amp}
|
27
|
-
- _target_: hcpdiff.workflow.VaeOptimizeAction
|
28
|
-
slicing: True
|
29
|
-
|
30
|
-
actions:
|
31
|
-
- _target_: hcpdiff.workflow.TextHookAction
|
32
|
-
N_repeats: 1
|
33
|
-
layer_skip: 1
|
34
|
-
# encode text
|
35
|
-
- _target_: hcpdiff.workflow.AttnMultTextEncodeAction
|
36
|
-
prompt: 'masterpiece, best quality, 1girl, cat ears, outside'
|
37
|
-
negative_prompt: 'lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry'
|
38
|
-
bs: ${bs}
|
39
|
-
# prepare seed
|
40
|
-
- _target_: hcpdiff.workflow.SeedAction
|
41
|
-
seed: ${seed}
|
42
|
-
- _target_: hcpdiff.workflow.MakeTimestepsAction
|
43
|
-
N_steps: 30
|
44
|
-
# text to image
|
45
|
-
- _target_: hcpdiff.workflow.MakeLatentAction
|
46
|
-
width: 512
|
47
|
-
height: 512
|
48
|
-
- _target_: hcpdiff.workflow.LoopAction
|
49
|
-
loop_value:
|
50
|
-
timesteps: t #迭代timesteps,每一步的存成t到states里
|
51
|
-
actions:
|
52
|
-
- _target_: hcpdiff.workflow.DiffusionStepAction
|
53
|
-
guidance_scale: 7.0
|
54
|
-
# decode to image
|
55
|
-
- _target_: hcpdiff.workflow.DecodeAction
|
56
|
-
vae: ${hcp.from_memory:vae}
|
57
|
-
- _target_: hcpdiff.workflow.SaveImageAction
|
58
|
-
save_root: output_pipe/
|
59
|
-
image_type: png
|
@@ -1,70 +0,0 @@
|
|
1
|
-
dtype: fp16
|
2
|
-
bs: 2
|
3
|
-
seed: 42
|
4
|
-
|
5
|
-
memory: { }
|
6
|
-
|
7
|
-
prepare:
|
8
|
-
- _target_: hcpdiff.workflow.LoadModelsAction
|
9
|
-
pretrained_model: 'ckpts/any5'
|
10
|
-
dtype: ${dtype}
|
11
|
-
scheduler:
|
12
|
-
_target_: diffusers.EulerAncestralDiscreteScheduler # change Sampler
|
13
|
-
beta_start: 0.00085
|
14
|
-
beta_end: 0.012
|
15
|
-
beta_schedule: 'scaled_linear'
|
16
|
-
- _target_: hcpdiff.workflow.BuildModelLoaderAction
|
17
|
-
|
18
|
-
# load lora
|
19
|
-
- _target_: hcpdiff.workflow.LoadLoraAction
|
20
|
-
model: 'TE'
|
21
|
-
cfg:
|
22
|
-
- path: 'ckpts/nilu/text_encoder-1000.safetensors'
|
23
|
-
alpha: 0.8
|
24
|
-
- _target_: hcpdiff.workflow.LoadLoraAction
|
25
|
-
model: 'unet'
|
26
|
-
cfg:
|
27
|
-
- path: 'ckpts/nilu/unet-1000.safetensors'
|
28
|
-
alpha: 0.8
|
29
|
-
|
30
|
-
- _target_: hcpdiff.workflow.XformersEnableAction
|
31
|
-
- _target_: hcpdiff.workflow.ExecAction
|
32
|
-
prog: |-
|
33
|
-
from hcpdiff.utils.net_utils import to_cpu, to_cuda
|
34
|
-
to_cuda(memory.unet)
|
35
|
-
to_cuda(memory.vae)
|
36
|
-
- _target_: hcpdiff.workflow.PrepareDiffusionAction
|
37
|
-
dtype: ${dtype}
|
38
|
-
- _target_: hcpdiff.workflow.VaeOptimizeAction
|
39
|
-
slicing: True
|
40
|
-
|
41
|
-
actions:
|
42
|
-
- _target_: hcpdiff.workflow.TextHookAction
|
43
|
-
N_repeats: 1
|
44
|
-
layer_skip: 1
|
45
|
-
# encode text
|
46
|
-
- _target_: hcpdiff.workflow.AttnMultTextEncodeAction
|
47
|
-
prompt: 'masterpiece, best quality, pt-xi1-1000, 1girl, cat ears, outside'
|
48
|
-
negative_prompt: 'lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry'
|
49
|
-
bs: ${bs}
|
50
|
-
# prepare seed
|
51
|
-
- _target_: hcpdiff.workflow.SeedAction
|
52
|
-
seed: ${seed}
|
53
|
-
- _target_: hcpdiff.workflow.MakeTimestepsAction
|
54
|
-
N_steps: 30
|
55
|
-
# text to image
|
56
|
-
- _target_: hcpdiff.workflow.MakeLatentAction
|
57
|
-
width: 512
|
58
|
-
height: 512
|
59
|
-
- _target_: hcpdiff.workflow.LoopAction
|
60
|
-
loop_value:
|
61
|
-
timesteps: t #迭代timesteps,每一步的存成t到states里
|
62
|
-
actions:
|
63
|
-
- _target_: hcpdiff.workflow.DiffusionStepAction
|
64
|
-
guidance_scale: 7.0
|
65
|
-
# decode to image
|
66
|
-
- _target_: hcpdiff.workflow.DecodeAction
|
67
|
-
vae: ${hcp.from_memory:vae}
|
68
|
-
- _target_: hcpdiff.workflow.SaveImageAction
|
69
|
-
save_root: output_pipe/
|
70
|
-
image_type: png
|
@@ -1,32 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"fp16": {
|
3
|
-
"enabled": true,
|
4
|
-
"loss_scale": 0,
|
5
|
-
"loss_scale_window": 1000,
|
6
|
-
"initial_scale_power": 16,
|
7
|
-
"hysteresis": 2,
|
8
|
-
"min_loss_scale": 1
|
9
|
-
},
|
10
|
-
"bf16": {
|
11
|
-
"enabled": "auto"
|
12
|
-
},
|
13
|
-
"zero_optimization": {
|
14
|
-
"stage": 2,
|
15
|
-
"offload_optimizer": {
|
16
|
-
"device": "cpu",
|
17
|
-
"pin_memory": true
|
18
|
-
},
|
19
|
-
"allgather_partitions": true,
|
20
|
-
"allgather_bucket_size": 5e8,
|
21
|
-
"overlap_comm": true,
|
22
|
-
"reduce_scatter": true,
|
23
|
-
"reduce_bucket_size": 5e8,
|
24
|
-
"contiguous_gradients": true
|
25
|
-
},
|
26
|
-
"gradient_accumulation_steps": "auto",
|
27
|
-
"gradient_clipping": "auto",
|
28
|
-
"steps_per_print": 2000,
|
29
|
-
"train_batch_size": "auto",
|
30
|
-
"train_micro_batch_size_per_gpu": "auto",
|
31
|
-
"wall_clock_breakdown": false
|
32
|
-
}
|
@@ -1,39 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"fp16": {
|
3
|
-
"enabled": true,
|
4
|
-
"loss_scale": 0,
|
5
|
-
"loss_scale_window": 1000,
|
6
|
-
"initial_scale_power": 16,
|
7
|
-
"hysteresis": 2,
|
8
|
-
"min_loss_scale": 1
|
9
|
-
},
|
10
|
-
"bf16": {
|
11
|
-
"enabled": "auto"
|
12
|
-
},
|
13
|
-
"zero_optimization": {
|
14
|
-
"stage": 3,
|
15
|
-
"offload_optimizer": {
|
16
|
-
"device": "cpu",
|
17
|
-
"pin_memory": true
|
18
|
-
},
|
19
|
-
"offload_param": {
|
20
|
-
"device": "cpu",
|
21
|
-
"pin_memory": true
|
22
|
-
},
|
23
|
-
"overlap_comm": true,
|
24
|
-
"contiguous_gradients": true,
|
25
|
-
"reduce_bucket_size": 2e8,
|
26
|
-
"stage3_prefetch_bucket_size": 5e8,
|
27
|
-
"stage3_param_persistence_threshold": 1e6,
|
28
|
-
"sub_group_size": 1e9,
|
29
|
-
"stage3_max_live_parameters": 1e9,
|
30
|
-
"stage3_max_reuse_distance": 1e9,
|
31
|
-
"stage3_gather_16bit_weights_on_model_save": "auto"
|
32
|
-
},
|
33
|
-
"gradient_accumulation_steps": 1,
|
34
|
-
"gradient_clipping": "auto",
|
35
|
-
"steps_per_print": 2000,
|
36
|
-
"train_batch_size": "auto",
|
37
|
-
"train_micro_batch_size_per_gpu": "auto",
|
38
|
-
"wall_clock_breakdown": false
|
39
|
-
}
|
@@ -1 +0,0 @@
|
|
1
|
-
{pt1}{caption}
|
@@ -1 +0,0 @@
|
|
1
|
-
{name} {class}
|
@@ -1 +0,0 @@
|
|
1
|
-
{pt1} {class1} with a {pt2} {class2} on hair, {caption}
|
@@ -1 +0,0 @@
|
|
1
|
-
{name} {class}, {caption}
|
@@ -1,27 +0,0 @@
|
|
1
|
-
a photo of a {pt1} {class}
|
2
|
-
a rendering of a {pt1} {class}
|
3
|
-
a cropped photo of the {pt1} {class}
|
4
|
-
the photo of a {pt1} {class}
|
5
|
-
a photo of a clean {pt1} {class}
|
6
|
-
a photo of a dirty {pt1} {class}
|
7
|
-
a dark photo of the {pt1} {class}
|
8
|
-
a photo of my {pt1} {class}
|
9
|
-
a photo of the cool {pt1} {class}
|
10
|
-
a close-up photo of a {pt1} {class}
|
11
|
-
a bright photo of the {pt1} {class}
|
12
|
-
a cropped photo of a {pt1} {class}
|
13
|
-
a photo of the {pt1} {class}
|
14
|
-
a good photo of the {pt1} {class}
|
15
|
-
a photo of one {pt1} {class}
|
16
|
-
a close-up photo of the {pt1} {class}
|
17
|
-
a rendition of the {pt1} {class}
|
18
|
-
a photo of the clean {pt1} {class}
|
19
|
-
a rendition of a {pt1} {class}
|
20
|
-
a photo of a nice {pt1} {class}
|
21
|
-
a good photo of a {pt1} {class}
|
22
|
-
a photo of the nice {pt1} {class}
|
23
|
-
a photo of the small {pt1} {class}
|
24
|
-
a photo of the weird {pt1} {class}
|
25
|
-
a photo of the large {pt1} {class}
|
26
|
-
a photo of a cool {pt1} {class}
|
27
|
-
a photo of a small {pt1} {class}
|
@@ -1,27 +0,0 @@
|
|
1
|
-
a photo of a {pt1} {class}, {caption}
|
2
|
-
a rendering of a {pt1} {class}, {caption}
|
3
|
-
a cropped photo of the {pt1} {class}, {caption}
|
4
|
-
the photo of a {pt1} {class}, {caption}
|
5
|
-
a photo of a clean {pt1} {class}, {caption}
|
6
|
-
a photo of a dirty {pt1} {class}, {caption}
|
7
|
-
a dark photo of the {pt1} {class}, {caption}
|
8
|
-
a photo of my {pt1} {class}, {caption}
|
9
|
-
a photo of the cool {pt1} {class}, {caption}
|
10
|
-
a close-up photo of a {pt1} {class}, {caption}
|
11
|
-
a bright photo of the {pt1} {class}, {caption}
|
12
|
-
a cropped photo of a {pt1} {class}, {caption}
|
13
|
-
a photo of the {pt1} {class}, {caption}
|
14
|
-
a good photo of the {pt1} {class}, {caption}
|
15
|
-
a photo of one {pt1} {class}, {caption}
|
16
|
-
a close-up photo of the {pt1} {class}, {caption}
|
17
|
-
a rendition of the {pt1} {class}, {caption}
|
18
|
-
a photo of the clean {pt1} {class}, {caption}
|
19
|
-
a rendition of a {pt1} {class}, {caption}
|
20
|
-
a photo of a nice {pt1} {class}, {caption}
|
21
|
-
a good photo of a {pt1} {class}, {caption}
|
22
|
-
a photo of the nice {pt1} {class}, {caption}
|
23
|
-
a photo of the small {pt1} {class}, {caption}
|
24
|
-
a photo of the weird {pt1} {class}, {caption}
|
25
|
-
a photo of the large {pt1} {class}, {caption}
|
26
|
-
a photo of a cool {pt1} {class}, {caption}
|
27
|
-
a photo of a small {pt1} {class}, {caption}
|
@@ -1,19 +0,0 @@
|
|
1
|
-
a painting in the style of {pt1} {class}
|
2
|
-
a rendering in the style of {pt1} {class}
|
3
|
-
a cropped painting in the style of {pt1} {class}
|
4
|
-
the painting in the style of {pt1} {class}
|
5
|
-
a clean painting in the style of {pt1} {class}
|
6
|
-
a dirty painting in the style of {pt1} {class}
|
7
|
-
a dark painting in the style of {pt1} {class}
|
8
|
-
a picture in the style of {pt1} {class}
|
9
|
-
a cool painting in the style of {pt1} {class}
|
10
|
-
a close-up painting in the style of {pt1} {class}
|
11
|
-
a bright painting in the style of {pt1} {class}
|
12
|
-
a cropped painting in the style of {pt1} {class}
|
13
|
-
a good painting in the style of {pt1} {class}
|
14
|
-
a close-up painting in the style of {pt1} {class}
|
15
|
-
a rendition in the style of {pt1} {class}
|
16
|
-
a nice painting in the style of {pt1} {class}
|
17
|
-
a small painting in the style of {pt1} {class}
|
18
|
-
a weird painting in the style of {pt1} {class}
|
19
|
-
a large painting in the style of {pt1} {class}
|
@@ -1,19 +0,0 @@
|
|
1
|
-
a painting in the style of {pt1} {class}, {caption}
|
2
|
-
a rendering in the style of {pt1} {class}, {caption}
|
3
|
-
a cropped painting in the style of {pt1} {class}, {caption}
|
4
|
-
the painting in the style of {pt1} {class}, {caption}
|
5
|
-
a clean painting in the style of {pt1} {class}, {caption}
|
6
|
-
a dirty painting in the style of {pt1} {class}, {caption}
|
7
|
-
a dark painting in the style of {pt1} {class}, {caption}
|
8
|
-
a picture in the style of {pt1} {class}, {caption}
|
9
|
-
a cool painting in the style of {pt1} {class}, {caption}
|
10
|
-
a close-up painting in the style of {pt1} {class}, {caption}
|
11
|
-
a bright painting in the style of {pt1} {class}, {caption}
|
12
|
-
a cropped painting in the style of {pt1} {class}, {caption}
|
13
|
-
a good painting in the style of {pt1} {class}, {caption}
|
14
|
-
a close-up painting in the style of {pt1} {class}, {caption}
|
15
|
-
a rendition in the style of {pt1} {class}, {caption}
|
16
|
-
a nice painting in the style of {pt1} {class}, {caption}
|
17
|
-
a small painting in the style of {pt1} {class}, {caption}
|
18
|
-
a weird painting in the style of {pt1} {class}, {caption}
|
19
|
-
a large painting in the style of {pt1} {class}, {caption}
|