diff --git a/automatic.sh b/automatic.sh index 295fb7237..6effb15a2 100755 --- a/automatic.sh +++ b/automatic.sh @@ -59,19 +59,15 @@ for i in "$@"; do shift done -echo "SD server: $MODE" +echo "Stable Diffusion 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) -SMI=$(nvidia-smi --query-gpu=name,driver_version --format=csv,noheader --id=0 2>/dev/null) +# SMI=$(nvidia-smi --query-gpu=name,driver_version --format=csv,noheader --id=0 2>/dev/null) echo "Version: $VER" echo "Repository: $URL" -echo "Last Merge: $MERGE" -echo "System" -echo "- Platform: $LSB $UNAME" -echo "- nVIDIA: $SMI" +echo "Platform: $LSB $UNAME" git-version () { pushd $1 >/dev/null @@ -92,6 +88,9 @@ git-update () { } if [ "$MODE" == update ]; then + MERGE=$(git log --pretty=format:"%ad %s" | grep "Merge pull" | head -1) + echo "Last Merge: $MERGE" + echo "Updating main repository" git-update . @@ -115,6 +114,9 @@ if [ "$MODE" == help ]; then fi if [ "$MODE" == install ]; then + MERGE=$(git log --pretty=format:"%ad %s" | grep "Merge pull" | head -1) + echo "Last Merge: $MERGE" + "$PYTHON" -m pip --version "$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());' diff --git a/config.json b/config.json index be232f081..3ee167823 100644 --- a/config.json +++ b/config.json @@ -18,7 +18,7 @@ "control_net_detectedmap_dir": "detected_maps", "control_net_models_path": "", "control_net_max_models_num": 1, - "control_net_model_cache_size": 2, + "control_net_model_cache_size": 1, "control_net_control_transfer": false, "control_net_no_detectmap": false, "control_net_detectmap_autosaving": true, diff --git a/extensions-builtin/sd-extension-system-info b/extensions-builtin/sd-extension-system-info index f97627885..4fb4f2395 160000 --- a/extensions-builtin/sd-extension-system-info +++ b/extensions-builtin/sd-extension-system-info @@ -1 +1 @@ -Subproject commit f976278850dfb6efcfa235bfe5ca86a8b45c29c1 +Subproject commit 4fb4f239569a962bf5692097426eb84256f34bd9 diff --git a/extensions-builtin/sd-webui-controlnet b/extensions-builtin/sd-webui-controlnet index de8fdeff3..dbdd6b1b0 160000 --- a/extensions-builtin/sd-webui-controlnet +++ b/extensions-builtin/sd-webui-controlnet @@ -1 +1 @@ -Subproject commit de8fdeff373695431440b9c29e9a6fe24155e795 +Subproject commit dbdd6b1b027b8dd02c1f13310f82cf359c617dc6 diff --git a/javascript/localization.disabled b/javascript/localization.disabled deleted file mode 100644 index 1a5a1dbb6..000000000 --- a/javascript/localization.disabled +++ /dev/null @@ -1,165 +0,0 @@ - -// localization = {} -- the dict with translations is created by the backend - -ignore_ids_for_localization={ - setting_sd_hypernetwork: 'OPTION', - setting_sd_model_checkpoint: 'OPTION', - setting_realesrgan_enabled_models: 'OPTION', - modelmerger_primary_model_name: 'OPTION', - modelmerger_secondary_model_name: 'OPTION', - modelmerger_tertiary_model_name: 'OPTION', - train_embedding: 'OPTION', - train_hypernetwork: 'OPTION', - txt2img_styles: 'OPTION', - img2img_styles: 'OPTION', - setting_random_artist_categories: 'SPAN', - setting_face_restoration_model: 'SPAN', - setting_realesrgan_enabled_models: 'SPAN', - extras_upscaler_1: 'SPAN', - extras_upscaler_2: 'SPAN', -} - -re_num = /^[\.\d]+$/ -re_emoji = /[\p{Extended_Pictographic}\u{1F3FB}-\u{1F3FF}\u{1F9B0}-\u{1F9B3}]/u - -original_lines = {} -translated_lines = {} - -function textNodesUnder(el){ - var n, a=[], walk=document.createTreeWalker(el,NodeFilter.SHOW_TEXT,null,false); - while(n=walk.nextNode()) a.push(n); - return a; -} - -function canBeTranslated(node, text){ - if(! text) return false; - if(! node.parentElement) return false; - - parentType = node.parentElement.nodeName - if(parentType=='SCRIPT' || parentType=='STYLE' || parentType=='TEXTAREA') return false; - - if (parentType=='OPTION' || parentType=='SPAN'){ - pnode = node - for(var level=0; level<4; level++){ - pnode = pnode.parentElement - if(! pnode) break; - - if(ignore_ids_for_localization[pnode.id] == parentType) return false; - } - } - - if(re_num.test(text)) return false; - if(re_emoji.test(text)) return false; - return true -} - -function getTranslation(text){ - if(! text) return undefined - - if(translated_lines[text] === undefined){ - original_lines[text] = 1 - } - - tl = localization[text] - if(tl !== undefined){ - translated_lines[tl] = 1 - } - - return tl -} - -function processTextNode(node){ - text = node.textContent.trim() - - if(! canBeTranslated(node, text)) return - - tl = getTranslation(text) - if(tl !== undefined){ - node.textContent = tl - } -} - -function processNode(node){ - if(node.nodeType == 3){ - processTextNode(node) - return - } - - if(node.title){ - tl = getTranslation(node.title) - if(tl !== undefined){ - node.title = tl - } - } - - if(node.placeholder){ - tl = getTranslation(node.placeholder) - if(tl !== undefined){ - node.placeholder = tl - } - } - - textNodesUnder(node).forEach(function(node){ - processTextNode(node) - }) -} - -function dumpTranslations(){ - dumped = {} - if (localization.rtl) { - dumped.rtl = true - } - - Object.keys(original_lines).forEach(function(text){ - if(dumped[text] !== undefined) return - - dumped[text] = localization[text] || text - }) - - return dumped -} - -onUiUpdate(function(m){ - m.forEach(function(mutation){ - mutation.addedNodes.forEach(function(node){ - processNode(node) - }) - }); -}) - - -document.addEventListener("DOMContentLoaded", function() { - processNode(gradioApp()) - - if (localization.rtl) { // if the language is from right to left, - (new MutationObserver((mutations, observer) => { // wait for the style to load - mutations.forEach(mutation => { - mutation.addedNodes.forEach(node => { - if (node.tagName === 'STYLE') { - observer.disconnect(); - - for (const x of node.sheet.rules) { // find all rtl media rules - if (Array.from(x.media || []).includes('rtl')) { - x.media.appendMedium('all'); // enable them - } - } - } - }) - }); - })).observe(gradioApp(), { childList: true }); - } -}) - -function download_localization() { - text = JSON.stringify(dumpTranslations(), null, 4) - - var element = document.createElement('a'); - element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text)); - element.setAttribute('download', "localization.json"); - element.style.display = 'none'; - document.body.appendChild(element); - - element.click(); - - document.body.removeChild(element); -} diff --git a/javascript/localization.js b/javascript/localization.js new file mode 100644 index 000000000..e69de29bb diff --git a/webui.py b/webui.py index a6d64abc7..f786cd739 100644 --- a/webui.py +++ b/webui.py @@ -66,6 +66,16 @@ else: def initialize(): + if torch.cuda.is_available(): + if torch.version.cuda: cuda_version = f'CUDA {torch.version.cuda} cuDNN {torch.backends.cudnn.version()}' + elif torch.version.hip: cuda_version = f'HIP {torch.version.hip}' + else: cuda_version = '' + print(f'Torch {getattr(torch, "__long_version__", torch.__version__)} {cuda_version}') + for device in [torch.cuda.device(i) for i in range(torch.cuda.device_count())]: + print(f'GPU {torch.cuda.get_device_name(device)} VRAM {round(torch.cuda.get_device_properties(device).total_memory / 1024 / 1024)} Arch {torch.cuda.get_device_capability(device)} Cores {torch.cuda.get_device_properties(device).multi_processor_count}') + else: + print(f'Torch {getattr(torch, "__long_version__", torch.__version__)} running on CPU') + extensions.list_extensions() startup_timer.record("list extensions") @@ -156,7 +166,7 @@ def load_model(): def setup_middleware(app): app.middleware_stack = None # reset current middleware to allow modifying user provided list - app.add_middleware(GZipMiddleware, minimum_size=1000) + app.add_middleware(GZipMiddleware, minimum_size=1024) if cmd_opts.cors_allow_origins and cmd_opts.cors_allow_origins_regex: app.add_middleware(CORSMiddleware, allow_origins=cmd_opts.cors_allow_origins.split(','), allow_origin_regex=cmd_opts.cors_allow_origins_regex, allow_methods=['*'], allow_credentials=True, allow_headers=['*']) elif cmd_opts.cors_allow_origins: