hcpdiff 0.9.0__py3-none-any.whl → 2.1__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.
Files changed (208) hide show
  1. hcpdiff/__init__.py +4 -4
  2. hcpdiff/ckpt_manager/__init__.py +4 -5
  3. hcpdiff/ckpt_manager/ckpt.py +24 -0
  4. hcpdiff/ckpt_manager/format/__init__.py +4 -0
  5. hcpdiff/ckpt_manager/format/diffusers.py +59 -0
  6. hcpdiff/ckpt_manager/format/emb.py +21 -0
  7. hcpdiff/ckpt_manager/format/lora_webui.py +244 -0
  8. hcpdiff/ckpt_manager/format/sd_single.py +41 -0
  9. hcpdiff/ckpt_manager/loader.py +64 -0
  10. hcpdiff/data/__init__.py +4 -28
  11. hcpdiff/data/cache/__init__.py +1 -0
  12. hcpdiff/data/cache/vae.py +102 -0
  13. hcpdiff/data/dataset.py +20 -0
  14. hcpdiff/data/handler/__init__.py +3 -0
  15. hcpdiff/data/handler/controlnet.py +18 -0
  16. hcpdiff/data/handler/diffusion.py +80 -0
  17. hcpdiff/data/handler/text.py +111 -0
  18. hcpdiff/data/source/__init__.py +1 -2
  19. hcpdiff/data/source/folder_class.py +12 -29
  20. hcpdiff/data/source/text2img.py +36 -74
  21. hcpdiff/data/source/text2img_cond.py +9 -15
  22. hcpdiff/diffusion/__init__.py +0 -0
  23. hcpdiff/diffusion/noise/__init__.py +2 -0
  24. hcpdiff/diffusion/noise/pyramid_noise.py +42 -0
  25. hcpdiff/diffusion/noise/zero_terminal.py +39 -0
  26. hcpdiff/diffusion/sampler/__init__.py +5 -0
  27. hcpdiff/diffusion/sampler/base.py +72 -0
  28. hcpdiff/diffusion/sampler/ddpm.py +20 -0
  29. hcpdiff/diffusion/sampler/diffusers.py +66 -0
  30. hcpdiff/diffusion/sampler/edm.py +22 -0
  31. hcpdiff/diffusion/sampler/sigma_scheduler/__init__.py +3 -0
  32. hcpdiff/diffusion/sampler/sigma_scheduler/base.py +14 -0
  33. hcpdiff/diffusion/sampler/sigma_scheduler/ddpm.py +197 -0
  34. hcpdiff/diffusion/sampler/sigma_scheduler/edm.py +48 -0
  35. hcpdiff/easy/__init__.py +2 -0
  36. hcpdiff/easy/cfg/__init__.py +3 -0
  37. hcpdiff/easy/cfg/sd15_train.py +201 -0
  38. hcpdiff/easy/cfg/sdxl_train.py +140 -0
  39. hcpdiff/easy/cfg/t2i.py +177 -0
  40. hcpdiff/easy/model/__init__.py +2 -0
  41. hcpdiff/easy/model/cnet.py +31 -0
  42. hcpdiff/easy/model/loader.py +79 -0
  43. hcpdiff/easy/sampler.py +46 -0
  44. hcpdiff/evaluate/__init__.py +1 -0
  45. hcpdiff/evaluate/previewer.py +60 -0
  46. hcpdiff/loss/__init__.py +4 -1
  47. hcpdiff/loss/base.py +41 -0
  48. hcpdiff/loss/gw.py +35 -0
  49. hcpdiff/loss/ssim.py +37 -0
  50. hcpdiff/loss/vlb.py +79 -0
  51. hcpdiff/loss/weighting.py +66 -0
  52. hcpdiff/models/__init__.py +2 -2
  53. hcpdiff/models/cfg_context.py +17 -14
  54. hcpdiff/models/compose/compose_hook.py +44 -23
  55. hcpdiff/models/compose/compose_tokenizer.py +21 -8
  56. hcpdiff/models/compose/sdxl_composer.py +4 -4
  57. hcpdiff/models/container.py +1 -1
  58. hcpdiff/models/controlnet.py +16 -16
  59. hcpdiff/models/lora_base_patch.py +14 -25
  60. hcpdiff/models/lora_layers.py +3 -9
  61. hcpdiff/models/lora_layers_patch.py +14 -24
  62. hcpdiff/models/text_emb_ex.py +84 -6
  63. hcpdiff/models/textencoder_ex.py +54 -18
  64. hcpdiff/models/wrapper/__init__.py +3 -0
  65. hcpdiff/models/wrapper/pixart.py +19 -0
  66. hcpdiff/models/wrapper/sd.py +218 -0
  67. hcpdiff/models/wrapper/utils.py +20 -0
  68. hcpdiff/parser/__init__.py +1 -0
  69. hcpdiff/parser/embpt.py +32 -0
  70. hcpdiff/tools/convert_caption_txt2json.py +1 -1
  71. hcpdiff/tools/dataset_generator.py +94 -0
  72. hcpdiff/tools/download_hf_model.py +24 -0
  73. hcpdiff/tools/embedding_convert.py +6 -2
  74. hcpdiff/tools/init_proj.py +3 -21
  75. hcpdiff/tools/lora_convert.py +19 -15
  76. hcpdiff/tools/save_model.py +12 -0
  77. hcpdiff/tools/sd2diffusers.py +1 -1
  78. hcpdiff/train_colo.py +1 -1
  79. hcpdiff/train_deepspeed.py +1 -1
  80. hcpdiff/trainer_ac.py +79 -0
  81. hcpdiff/trainer_ac_single.py +31 -0
  82. hcpdiff/utils/__init__.py +0 -2
  83. hcpdiff/utils/inpaint_pipe.py +790 -0
  84. hcpdiff/utils/net_utils.py +29 -6
  85. hcpdiff/utils/pipe_hook.py +46 -33
  86. hcpdiff/utils/utils.py +21 -4
  87. hcpdiff/workflow/__init__.py +15 -10
  88. hcpdiff/workflow/daam/__init__.py +1 -0
  89. hcpdiff/workflow/daam/act.py +66 -0
  90. hcpdiff/workflow/daam/hook.py +109 -0
  91. hcpdiff/workflow/diffusion.py +128 -136
  92. hcpdiff/workflow/fast.py +31 -0
  93. hcpdiff/workflow/flow.py +67 -0
  94. hcpdiff/workflow/io.py +36 -68
  95. hcpdiff/workflow/model.py +46 -43
  96. hcpdiff/workflow/text.py +84 -52
  97. hcpdiff/workflow/utils.py +32 -12
  98. hcpdiff/workflow/vae.py +37 -38
  99. hcpdiff-2.1.dist-info/METADATA +285 -0
  100. hcpdiff-2.1.dist-info/RECORD +114 -0
  101. {hcpdiff-0.9.0.dist-info → hcpdiff-2.1.dist-info}/WHEEL +1 -1
  102. hcpdiff-2.1.dist-info/entry_points.txt +5 -0
  103. hcpdiff/ckpt_manager/base.py +0 -16
  104. hcpdiff/ckpt_manager/ckpt_diffusers.py +0 -45
  105. hcpdiff/ckpt_manager/ckpt_pkl.py +0 -138
  106. hcpdiff/ckpt_manager/ckpt_safetensor.py +0 -60
  107. hcpdiff/ckpt_manager/ckpt_webui.py +0 -54
  108. hcpdiff/data/bucket.py +0 -358
  109. hcpdiff/data/caption_loader.py +0 -80
  110. hcpdiff/data/cond_dataset.py +0 -40
  111. hcpdiff/data/crop_info_dataset.py +0 -40
  112. hcpdiff/data/data_processor.py +0 -33
  113. hcpdiff/data/pair_dataset.py +0 -146
  114. hcpdiff/data/sampler.py +0 -54
  115. hcpdiff/data/source/base.py +0 -30
  116. hcpdiff/data/utils.py +0 -80
  117. hcpdiff/infer_workflow.py +0 -57
  118. hcpdiff/loggers/__init__.py +0 -13
  119. hcpdiff/loggers/base_logger.py +0 -76
  120. hcpdiff/loggers/cli_logger.py +0 -40
  121. hcpdiff/loggers/preview/__init__.py +0 -1
  122. hcpdiff/loggers/preview/image_previewer.py +0 -149
  123. hcpdiff/loggers/tensorboard_logger.py +0 -30
  124. hcpdiff/loggers/wandb_logger.py +0 -31
  125. hcpdiff/loggers/webui_logger.py +0 -9
  126. hcpdiff/loss/min_snr_loss.py +0 -52
  127. hcpdiff/models/layers.py +0 -81
  128. hcpdiff/models/plugin.py +0 -348
  129. hcpdiff/models/wrapper.py +0 -75
  130. hcpdiff/noise/__init__.py +0 -3
  131. hcpdiff/noise/noise_base.py +0 -16
  132. hcpdiff/noise/pyramid_noise.py +0 -50
  133. hcpdiff/noise/zero_terminal.py +0 -44
  134. hcpdiff/train_ac.py +0 -565
  135. hcpdiff/train_ac_single.py +0 -39
  136. hcpdiff/utils/caption_tools.py +0 -105
  137. hcpdiff/utils/cfg_net_tools.py +0 -321
  138. hcpdiff/utils/cfg_resolvers.py +0 -16
  139. hcpdiff/utils/ema.py +0 -52
  140. hcpdiff/utils/img_size_tool.py +0 -248
  141. hcpdiff/vis/__init__.py +0 -3
  142. hcpdiff/vis/base_interface.py +0 -12
  143. hcpdiff/vis/disk_interface.py +0 -48
  144. hcpdiff/vis/webui_interface.py +0 -17
  145. hcpdiff/visualizer.py +0 -258
  146. hcpdiff/visualizer_reloadable.py +0 -237
  147. hcpdiff/workflow/base.py +0 -59
  148. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/infer/anime/text2img_anime.yaml +0 -21
  149. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/infer/anime/text2img_anime_lora.yaml +0 -58
  150. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/infer/change_vae.yaml +0 -6
  151. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/infer/euler_a.yaml +0 -8
  152. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/infer/img2img.yaml +0 -10
  153. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/infer/img2img_controlnet.yaml +0 -19
  154. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/infer/inpaint.yaml +0 -11
  155. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/infer/load_lora.yaml +0 -26
  156. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/infer/load_unet_part.yaml +0 -18
  157. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/infer/offload_2GB.yaml +0 -6
  158. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/infer/save_model.yaml +0 -44
  159. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/infer/text2img.yaml +0 -53
  160. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/infer/text2img_DA++.yaml +0 -34
  161. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/infer/text2img_sdxl.yaml +0 -9
  162. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/plugins/plugin_controlnet.yaml +0 -17
  163. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/te_struct.txt +0 -193
  164. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/train/dataset/base_dataset.yaml +0 -29
  165. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/train/dataset/regularization_dataset.yaml +0 -31
  166. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/train/examples/CustomDiffusion.yaml +0 -74
  167. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/train/examples/DreamArtist++.yaml +0 -135
  168. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/train/examples/DreamArtist.yaml +0 -45
  169. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/train/examples/DreamBooth.yaml +0 -62
  170. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/train/examples/FT_sdxl.yaml +0 -33
  171. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/train/examples/Lion_optimizer.yaml +0 -17
  172. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/train/examples/TextualInversion.yaml +0 -41
  173. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/train/examples/add_logger_tensorboard_wandb.yaml +0 -15
  174. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/train/examples/controlnet.yaml +0 -53
  175. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/train/examples/ema.yaml +0 -10
  176. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/train/examples/fine-tuning.yaml +0 -53
  177. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/train/examples/locon.yaml +0 -24
  178. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/train/examples/lora_anime_character.yaml +0 -77
  179. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/train/examples/lora_conventional.yaml +0 -56
  180. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/train/examples/lora_sdxl.yaml +0 -41
  181. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/train/examples/min_snr.yaml +0 -7
  182. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/train/examples/preview_in_training.yaml +0 -6
  183. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/train/examples_noob/DreamBooth.yaml +0 -70
  184. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/train/examples_noob/TextualInversion.yaml +0 -45
  185. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/train/examples_noob/fine-tuning.yaml +0 -45
  186. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/train/examples_noob/lora.yaml +0 -63
  187. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/train/train_base.yaml +0 -81
  188. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/train/tuning_base.yaml +0 -42
  189. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/unet_struct.txt +0 -932
  190. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/workflow/highres_fix_latent.yaml +0 -86
  191. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/workflow/highres_fix_pixel.yaml +0 -99
  192. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/workflow/text2img.yaml +0 -57
  193. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/workflow/text2img_lora.yaml +0 -70
  194. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/zero2.json +0 -32
  195. hcpdiff-0.9.0.data/data/hcpdiff/cfgs/zero3.json +0 -39
  196. hcpdiff-0.9.0.data/data/hcpdiff/prompt_tuning_template/caption.txt +0 -1
  197. hcpdiff-0.9.0.data/data/hcpdiff/prompt_tuning_template/name.txt +0 -1
  198. hcpdiff-0.9.0.data/data/hcpdiff/prompt_tuning_template/name_2pt_caption.txt +0 -1
  199. hcpdiff-0.9.0.data/data/hcpdiff/prompt_tuning_template/name_caption.txt +0 -1
  200. hcpdiff-0.9.0.data/data/hcpdiff/prompt_tuning_template/object.txt +0 -27
  201. hcpdiff-0.9.0.data/data/hcpdiff/prompt_tuning_template/object_caption.txt +0 -27
  202. hcpdiff-0.9.0.data/data/hcpdiff/prompt_tuning_template/style.txt +0 -19
  203. hcpdiff-0.9.0.data/data/hcpdiff/prompt_tuning_template/style_caption.txt +0 -19
  204. hcpdiff-0.9.0.dist-info/METADATA +0 -199
  205. hcpdiff-0.9.0.dist-info/RECORD +0 -155
  206. hcpdiff-0.9.0.dist-info/entry_points.txt +0 -2
  207. {hcpdiff-0.9.0.dist-info → hcpdiff-2.1.dist-info/licenses}/LICENSE +0 -0
  208. {hcpdiff-0.9.0.dist-info → hcpdiff-2.1.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,57 +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
- from hcpdiff.utils.net_utils import to_cpu, to_cuda
20
- to_cuda(memory.unet)
21
- to_cuda(memory.text_encoder)
22
- to_cuda(memory.vae)
23
- - _target_: hcpdiff.workflow.PrepareDiffusionAction
24
- dtype: ${dtype}
25
- - _target_: hcpdiff.workflow.VaeOptimizeAction
26
- slicing: True
27
-
28
- actions:
29
- - _target_: hcpdiff.workflow.TextHookAction
30
- N_repeats: 1
31
- layer_skip: 1
32
- # encode text
33
- - _target_: hcpdiff.workflow.AttnMultTextEncodeAction
34
- prompt: 'masterpiece, best quality, 1girl, cat ears, outside'
35
- 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'
36
- bs: ${bs}
37
- # prepare seed
38
- - _target_: hcpdiff.workflow.SeedAction
39
- seed: ${seed}
40
- - _target_: hcpdiff.workflow.MakeTimestepsAction
41
- N_steps: 30
42
- # text to image
43
- - _target_: hcpdiff.workflow.MakeLatentAction
44
- width: 512
45
- height: 512
46
- - _target_: hcpdiff.workflow.LoopAction
47
- loop_value:
48
- timesteps: t #迭代timesteps,每一步的存成t到states里
49
- actions:
50
- - _target_: hcpdiff.workflow.DiffusionStepAction
51
- guidance_scale: 7.0
52
- # decode to image
53
- - _target_: hcpdiff.workflow.DecodeAction
54
- vae: ${hcp.from_memory:vae}
55
- - _target_: hcpdiff.workflow.SaveImageAction
56
- save_root: output_pipe/
57
- 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": 2e8,
21
- "overlap_comm": true,
22
- "reduce_scatter": true,
23
- "reduce_bucket_size": 2e8,
24
- "contiguous_gradients": true
25
- },
26
- "gradient_accumulation_steps": 1,
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}