minor updates

This commit is contained in:
Vladimir Mandic
2023-02-15 09:07:04 -05:00
parent b37ebe8b22
commit b0b326f3f8
6 changed files with 43 additions and 30 deletions
+4 -6
View File
@@ -44,7 +44,8 @@ Simplified start script: `automatic.sh`
> ./automatic.sh install
- Install dependencies *and* refresh extensions
- Installs and refreshes:
dependencies, submodules, extensions
<br>
@@ -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
<br>
@@ -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
+25
View File
@@ -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
+1 -1
View File
@@ -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) })
+11
View File
@@ -0,0 +1,11 @@
#!/bin/env python
"""
Custom Diffusion (CD) training script
Based on:
- <https://www.cs.cmu.edu/~custom-diffusion/>
- <https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/6751>
- <https://github.com/guaneec/custom-diffusion-webui>
"""
# TBD
+2 -19
View File
@@ -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:
-4
View File
@@ -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;
}