From 8ba9716907ac49d815108982872194b2ab28ebff Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Sun, 5 Mar 2023 15:52:11 -0500 Subject: [PATCH] fix dreambooth style training --- cli/modules/process.py | 1 - cli/train-lora.py | 9 +++++---- config.json | 2 +- extensions-builtin/clip-interrogator-ext | 2 +- extensions-builtin/sd-extension-system-info | 2 +- extensions-builtin/sd-webui-controlnet | 2 +- extensions-builtin/seed_travel | 2 +- .../stable-diffusion-webui-images-browser | 2 +- modules/lora | 2 +- requirements_versions.txt | 4 +--- ui-config.json | 16 +++++++++++++++- wiki | 2 +- 12 files changed, 29 insertions(+), 17 deletions(-) diff --git a/cli/modules/process.py b/cli/modules/process.py index b90c803c3..28b9f699c 100755 --- a/cli/modules/process.py +++ b/cli/modules/process.py @@ -349,7 +349,6 @@ i = {} metadata = Map({}) def process_file(f: str, dst: str = None, preview: bool = False, offline: bool = False, txt = None): - def save(img, f, what): i[what] = i.get(what, 0) + 1 if dst is None: diff --git a/cli/train-lora.py b/cli/train-lora.py index 88f59ded7..c2454d9b8 100755 --- a/cli/train-lora.py +++ b/cli/train-lora.py @@ -196,11 +196,12 @@ if __name__ == '__main__': # preprocess for f in files: try: - res, metadata = modules.process.process_file(f = f, dst = dir, preview = False, offline = args.offline, txt = False) - with open(json_file, "w") as outfile: - outfile.write(json.dumps(metadata, indent=2)) + res, metadata = modules.process.process_file(f = f, dst = dir, preview = False, offline = args.offline, txt = args.dreambooth) + if not args.dreambooth: + with open(json_file, "w") as outfile: + outfile.write(json.dumps(metadata, indent=2)) except ValueError as e: - exit(1) + exit(1) modules.process.unload_models() mem_stats() if args.tag is not None: diff --git a/config.json b/config.json index b1e5c65ba..0d64d9eea 100644 --- a/config.json +++ b/config.json @@ -177,7 +177,7 @@ "sd_hypernetwork_strength": 1.0, "sd_hypernetwork": "None", "sd_lora": "", - "sd_model_checkpoint": "photomaxultra-v1.safetensors [c7f1c20497]", + "sd_model_checkpoint": "sd-v15-runwayml.ckpt [cc6cb27103]", "sd_vae_as_default": false, "sd_vae_checkpoint_cache": 0, "sd_vae": "vae-ft-mse-840000-ema-pruned.ckpt", diff --git a/extensions-builtin/clip-interrogator-ext b/extensions-builtin/clip-interrogator-ext index d99548fc8..6385cd862 160000 --- a/extensions-builtin/clip-interrogator-ext +++ b/extensions-builtin/clip-interrogator-ext @@ -1 +1 @@ -Subproject commit d99548fc83c920feacbc54dcb2bb2a1c3e3ac7bd +Subproject commit 6385cd862f510cf4942fc08bbb135eef6213040f diff --git a/extensions-builtin/sd-extension-system-info b/extensions-builtin/sd-extension-system-info index 4677d7ae1..b8140bc04 160000 --- a/extensions-builtin/sd-extension-system-info +++ b/extensions-builtin/sd-extension-system-info @@ -1 +1 @@ -Subproject commit 4677d7ae1f8cd665d3837c0c873cfd31209ab550 +Subproject commit b8140bc04d255de58e60d8b3b5a95177c9216f28 diff --git a/extensions-builtin/sd-webui-controlnet b/extensions-builtin/sd-webui-controlnet index 2ff1154f4..84a2b22d6 160000 --- a/extensions-builtin/sd-webui-controlnet +++ b/extensions-builtin/sd-webui-controlnet @@ -1 +1 @@ -Subproject commit 2ff1154f469c456188f77f6665916fc01cc1cd47 +Subproject commit 84a2b22d691a90e0fbc6b7af7656505f32880a7b diff --git a/extensions-builtin/seed_travel b/extensions-builtin/seed_travel index 40205cb27..892f7cde4 160000 --- a/extensions-builtin/seed_travel +++ b/extensions-builtin/seed_travel @@ -1 +1 @@ -Subproject commit 40205cb27e9fb2506e6c0481e75a07c94bb1fdf7 +Subproject commit 892f7cde424673e9254c0dc524e48e29532e80d6 diff --git a/extensions-builtin/stable-diffusion-webui-images-browser b/extensions-builtin/stable-diffusion-webui-images-browser index 9e1222d4a..3d95a7d26 160000 --- a/extensions-builtin/stable-diffusion-webui-images-browser +++ b/extensions-builtin/stable-diffusion-webui-images-browser @@ -1 +1 @@ -Subproject commit 9e1222d4a9c33113a705a8f16fa5fab6605380b9 +Subproject commit 3d95a7d2638eab7c9aef550741f4d22ac638cce0 diff --git a/modules/lora b/modules/lora index 4d9292e50..46aee85d2 160000 --- a/modules/lora +++ b/modules/lora @@ -1 +1 @@ -Subproject commit 4d9292e50a7724908bce29bd1907ed0f5f5e211b +Subproject commit 46aee85d2a88e279d9a0a286f579f5f3434a3c56 diff --git a/requirements_versions.txt b/requirements_versions.txt index 41ab847bc..853ce4836 100644 --- a/requirements_versions.txt +++ b/requirements_versions.txt @@ -13,16 +13,14 @@ jsonmerge==1.9.0 kornia==0.6.9 lark==1.1.5 numexpr==2.8.4 -numpy==1.23.5 omegaconf==2.3.0 pandas==1.5.3 -piexif==1.1.3 Pillow==9.4.0 protobuf==3.20.3 pytorch_lightning==1.7.7 realesrgan==0.3.0 resize-right==0.0.2 -safetensors==0.2.8 +safetensors==0.3.0 scikit-image==0.19.3 timm==0.6.12 torchdiffeq==0.2.3 diff --git a/ui-config.json b/ui-config.json index 41c77e18c..92c0ed7d4 100644 --- a/ui-config.json +++ b/ui-config.json @@ -1305,5 +1305,19 @@ "customscript/xyz_grid.py/txt2img/Z type/value": "Nothing", "customscript/xyz_grid.py/txt2img/Z type/visible": true, "customscript/xyz_grid.py/txt2img/Z values/value": "", - "customscript/xyz_grid.py/txt2img/Z values/visible": true + "customscript/xyz_grid.py/txt2img/Z values/visible": true, + "customscript/seed_travel.py/txt2img/SSIM threshold (1.0=exact copy)/visible": true, + "customscript/seed_travel.py/txt2img/SSIM threshold (1.0=exact copy)/value": 0.0, + "customscript/seed_travel.py/txt2img/SSIM threshold (1.0=exact copy)/minimum": 0.0, + "customscript/seed_travel.py/txt2img/SSIM threshold (1.0=exact copy)/maximum": 1.0, + "customscript/seed_travel.py/txt2img/SSIM threshold (1.0=exact copy)/step": 0.01, + "customscript/seed_travel.py/img2img/SSIM threshold (1.0=exact copy)/visible": true, + "customscript/seed_travel.py/img2img/SSIM threshold (1.0=exact copy)/value": 0.0, + "customscript/seed_travel.py/img2img/SSIM threshold (1.0=exact copy)/minimum": 0.0, + "customscript/seed_travel.py/img2img/SSIM threshold (1.0=exact copy)/maximum": 1.0, + "customscript/seed_travel.py/img2img/SSIM threshold (1.0=exact copy)/step": 0.01, + "customscript/posex.py/txt2img/Send this image to ControlNet./visible": true, + "customscript/posex.py/txt2img/Send this image to ControlNet./value": false, + "customscript/posex.py/img2img/Send this image to ControlNet./visible": true, + "customscript/posex.py/img2img/Send this image to ControlNet./value": false } \ No newline at end of file diff --git a/wiki b/wiki index 0b2fa9b81..7ee74bc5b 160000 --- a/wiki +++ b/wiki @@ -1 +1 @@ -Subproject commit 0b2fa9b81fd30809528c196d8d6d927691e15410 +Subproject commit 7ee74bc5bbdae23ef30750c9366c781615b7f834