hcpdiff 0.3.6__tar.gz → 0.3.7__tar.gz
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-0.3.6/hcpdiff.egg-info → hcpdiff-0.3.7}/PKG-INFO +1 -1
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/cfgs/train/examples/Lion_optimizer.yaml +1 -1
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/data/bucket.py +1 -1
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/tools/convert_caption_txt2json.py +8 -4
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/train_ac.py +2 -2
- {hcpdiff-0.3.6 → hcpdiff-0.3.7/hcpdiff.egg-info}/PKG-INFO +1 -1
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/setup.py +1 -1
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/LICENSE +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/README.md +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/cfgs/infer/change_vae.yaml +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/cfgs/infer/euler_a.yaml +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/cfgs/infer/img2img.yaml +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/cfgs/infer/img2img_controlnet.yaml +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/cfgs/infer/text2img.yaml +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/cfgs/infer/text2img_DA++.yaml +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/cfgs/infer/webui_model_infer.yaml +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/cfgs/plugins/plugin_controlnet.yaml +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/cfgs/te_struct.txt +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/cfgs/train/examples/CustomDiffusion.yaml +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/cfgs/train/examples/DreamArtist++.yaml +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/cfgs/train/examples/DreamArtist.yaml +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/cfgs/train/examples/DreamBooth.yaml +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/cfgs/train/examples/TextualInversion.yaml +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/cfgs/train/examples/controlnet.yaml +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/cfgs/train/examples/fine-tuning.yaml +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/cfgs/train/examples/locon.yaml +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/cfgs/train/examples/lora_conventional.yaml +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/cfgs/train/examples/min_snr.yaml +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/cfgs/train/train_base.yaml +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/cfgs/train/tuning_base.yaml +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/cfgs/unet_struct.txt +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/__init__.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/ckpt_manager/__init__.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/ckpt_manager/ckpt_pkl.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/ckpt_manager/ckpt_safetensor.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/data/__init__.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/data/cond_pair_dataset.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/data/pair_dataset.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/data/utils.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/loggers/__init__.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/loggers/base_logger.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/loggers/cli_logger.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/loggers/tensorboard_logger.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/loggers/wandb_logger.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/loss/__init__.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/loss/min_snr_loss.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/loss/mse_loss.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/models/__init__.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/models/cfg_context.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/models/controlnet.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/models/layers.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/models/lora_base.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/models/lora_layers.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/models/plugin.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/models/text_emb_ex.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/models/textencoder_ex.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/models/tokenizer_ex.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/tools/__init__.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/tools/create_embedding.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/tools/gen_from_ptlist.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/tools/init_proj.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/tools/lora_convert.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/tools/sd2diffusers.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/train_ac_single.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/train_colo.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/utils/__init__.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/utils/caption_tools.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/utils/cfg_net_tools.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/utils/colo_utils.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/utils/ema.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/utils/img_size_tool.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/utils/net_utils.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/utils/utils.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff/visualizer.py +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff.egg-info/SOURCES.txt +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff.egg-info/dependency_links.txt +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff.egg-info/entry_points.txt +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff.egg-info/requires.txt +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/hcpdiff.egg-info/top_level.txt +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/prompt_tuning_template/caption.txt +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/prompt_tuning_template/name.txt +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/prompt_tuning_template/name_2pt_caption.txt +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/prompt_tuning_template/name_caption.txt +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/prompt_tuning_template/object.txt +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/prompt_tuning_template/object_caption.txt +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/prompt_tuning_template/style.txt +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/prompt_tuning_template/style_caption.txt +0 -0
- {hcpdiff-0.3.6 → hcpdiff-0.3.7}/setup.cfg +0 -0
@@ -194,7 +194,7 @@ class RatioBucket(BaseBucket):
|
|
194
194
|
rs.shuffle(x)
|
195
195
|
|
196
196
|
# shuffle of batches
|
197
|
-
bucket_list = np.hstack(bucket_list).reshape(-1, self.bs)
|
197
|
+
bucket_list = np.hstack(bucket_list).reshape(-1, self.bs).astype(int)
|
198
198
|
rs.shuffle(bucket_list)
|
199
199
|
|
200
200
|
self.idx_arb = bucket_list.reshape(-1)
|
@@ -6,6 +6,7 @@ from hcpdiff.utils.img_size_tool import types_support
|
|
6
6
|
|
7
7
|
parser = argparse.ArgumentParser(description='Stable Diffusion Training')
|
8
8
|
parser.add_argument('--data_root', type=str, default='')
|
9
|
+
parser.add_argument('--with_imgs', action="store_true")
|
9
10
|
args = parser.parse_args()
|
10
11
|
|
11
12
|
|
@@ -16,10 +17,13 @@ def get_txt_caption(path):
|
|
16
17
|
|
17
18
|
captions = {}
|
18
19
|
for file in os.listdir(args.data_root):
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
file_name, file_ext = file.rsplit('.', 1)
|
21
|
+
if args.with_imgs:
|
22
|
+
if file_ext in types_support:
|
23
|
+
captions[file] = get_txt_caption(os.path.join(args.data_root, f'{file_name}.txt'))
|
24
|
+
else:
|
25
|
+
if file_ext == 'txt':
|
26
|
+
captions[file] = get_txt_caption(os.path.join(args.data_root, f'{file_name}.txt'))
|
23
27
|
|
24
28
|
with open(os.path.join(args.data_root, f'image_captions.json'), "w", encoding='utf8') as f:
|
25
29
|
json.dump(captions, f, indent=2, ensure_ascii=False)
|
@@ -338,7 +338,7 @@ class Trainer:
|
|
338
338
|
if isinstance(cfg_opt, partial):
|
339
339
|
if 'type' in cfg_opt.keywords:
|
340
340
|
del cfg_opt.keywords['type']
|
341
|
-
self.optimizer = cfg_opt(parameters, lr=self.lr)
|
341
|
+
self.optimizer = cfg_opt(params=parameters, lr=self.lr)
|
342
342
|
elif cfg_opt.type == 'adamw_8bit':
|
343
343
|
import bitsandbytes as bnb
|
344
344
|
self.optimizer = bnb.optim.AdamW8bit(params=parameters, lr=self.lr, weight_decay=cfg_opt.weight_decay)
|
@@ -362,7 +362,7 @@ class Trainer:
|
|
362
362
|
if isinstance(cfg_opt_pt, partial):
|
363
363
|
if 'type' in cfg_opt_pt.keywords:
|
364
364
|
del cfg_opt_pt.keywords['type']
|
365
|
-
self.optimizer_pt = cfg_opt_pt(parameters_pt, lr=self.lr)
|
365
|
+
self.optimizer_pt = cfg_opt_pt(params=parameters_pt, lr=self.lr)
|
366
366
|
else:
|
367
367
|
self.optimizer_pt = torch.optim.AdamW(params=parameters_pt, lr=self.lr, weight_decay=cfg_opt_pt.weight_decay)
|
368
368
|
|
@@ -23,7 +23,7 @@ def get_data_files(data_dir, prefix=''):
|
|
23
23
|
setuptools.setup(
|
24
24
|
name="hcpdiff",
|
25
25
|
py_modules=["hcpdiff"],
|
26
|
-
version="0.3.
|
26
|
+
version="0.3.7",
|
27
27
|
author="Ziyi Dong",
|
28
28
|
author_email="dzy7eu7d7@gmail.com",
|
29
29
|
description="A universal Stable-Diffusion toolbox",
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|