diff --git a/README.md b/README.md index b16e6f265..c0255f188 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,8 @@ Simplified start script: `automatic.sh` > ./automatic.sh install -- Install dependencies *and* refresh extensions +- Installs and refreshes: + dependencies, submodules, extensions
@@ -55,10 +56,6 @@ Simplified start script: `automatic.sh` > git clone --depth 1 https://github.com/vladmandic/automatic > cd automatic -> git submodule update --init --recursive - -3. Install dependencies - > ./automatic.sh install
@@ -77,7 +74,8 @@ Fork does differ in few things: - Uses simplified folder structure e.g. `/train`, `/outputs/*` - Modified training templates -- End-to-end `LoRA` training support +- Built-in `LoRA` training +- Built-in `Custom Diffusion` training Only Python library which is not auto-updated is `PyTorch` itself as that is very system specific For some Torch optimizations notes, see Wiki diff --git a/automatic.sh b/automatic.sh index 48a05dea8..e29ff52ee 100755 --- a/automatic.sh +++ b/automatic.sh @@ -44,20 +44,45 @@ done echo "SD server: $MODE" VER=$(git log -1 --pretty=format:"%h %ad") +URL=$(git remote get-url origin) LSB=$(lsb_release -ds 2>/dev/null) UNAME=$(uname -rm 2>/dev/null) +MERGE=$(git log --pretty=format:"%ad %s" | grep "Merge pull" | head -1) echo "Version: $VER" +echo "Repository: $URL" +echo "Last Merge: $MERGE" echo "Platform: $LSB $UNAME" "$PYTHON" -c 'import torch; import platform; print("Python:", platform.python_version(), "Torch:", torch.__version__, "CUDA:", torch.version.cuda, "cuDNN:", torch.backends.cudnn.version(), "GPU:", torch.cuda.get_device_name(torch.cuda.current_device()), "Arch:", torch.cuda.get_device_capability());' if [ "$MODE" == install ]; then "$PYTHON" -m pip --version + echo "Installing general requirements" "$PYTHON" -m pip install --disable-pip-version-check --quiet --no-warn-conflicts --requirement requirements.txt + echo "Installing versioned requirements" "$PYTHON" -m pip install --disable-pip-version-check --quiet --no-warn-conflicts --requirement requirements_versions.txt + echo "Updating submodules" + git submodule update --init --recursive git submodule update --rebase --remote + echo "Modules:" + git submodule foreach --quiet 'VER=$(git log -1 --pretty=format:"%h %ad"); URL=$(git remote get-url origin); echo "- $VER $URL"' + + echo "Updating extensions" + echo "Extensions:" + ls extensions/ | while read LINE; do + pushd extensions/$LINE >/dev/null + git pull --quiet + VER=$(git log -1 --pretty=format:"%h %ad") + URL=$(git remote get-url origin) + popd >/dev/null + echo "- $VER $URL" + done + + echo "Local changes" + git status --untracked=no --ignore-submodules=all --short + exit 0 fi diff --git a/cli/modules/lora-extract.py b/cli/modules/lora-extract.py index 85bfaafaa..102728308 100755 --- a/cli/modules/lora-extract.py +++ b/cli/modules/lora-extract.py @@ -96,7 +96,7 @@ def svd(args): # pylint: disable=redefined-outer-name t2 = time.time() # make state dict for LoRA - lora_network_o.apply_to(text_encoder_o, unet_o, text_encoder_different, True) # to make state dict + lora_network_o.apply_to(text_encoder_o, unet_o, text_encoder_different, True) lora_sd = lora_network_o.state_dict() log.info({ 'lora extracted weights': len(lora_sd), 'time': round(t2 - t1, 2) }) diff --git a/cli/train-cd.py b/cli/train-cd.py new file mode 100644 index 000000000..5f75113ae --- /dev/null +++ b/cli/train-cd.py @@ -0,0 +1,11 @@ +#!/bin/env python +""" +Custom Diffusion (CD) training script +Based on: +- +- +- +""" + +# TBD + diff --git a/cli/train-ti.py b/cli/train-ti.py index c06c4168a..43052e0de 100755 --- a/cli/train-ti.py +++ b/cli/train-ti.py @@ -17,7 +17,6 @@ import math import os import sys import time -import json import importlib from pathlib import Path, PurePath @@ -109,10 +108,6 @@ args = Map({ "preview_height": 512, "varsize": False, }, - "create_hypernetwork": { - }, - "train_hypernetwork": { - } }) @@ -573,18 +568,6 @@ async def main(): params.src = os.path.abspath(params.src) params.dst = os.path.abspath(params.dst) - """ - await session() - await check(params) - a = asyncio.create_task(pipeline(params)) - b = asyncio.create_task(monitor(params)) - await asyncio.gather(a, b) # wait for both pipeline and monitor to finish - if not params.nocleanup: - await preprocess_cleanup(params) - await close() - return - """ - try: await session() await check(params) @@ -599,8 +582,8 @@ async def main(): await close() return -if __name__ == "__main__": # create & train test embedding when used from cli - log.info({ 'train script' }) +if __name__ == "__main__": + log.info({ 'train textual inversion' }) try: asyncio.run(main()) except KeyboardInterrupt: diff --git a/user.css b/user.css index 4783bbbf9..14825fdd5 100644 --- a/user.css +++ b/user.css @@ -86,7 +86,3 @@ div.gradio-container.dark > div.w-full.flex.flex-col.min-h-screen > div { backgr /* custom elements overrides */ #steps-animation { border-width: 0; } - -#txt2img_gallery, #img2img_gallery { - min-height: 718px; -} \ No newline at end of file