Commit 68f336bd authored by AUTOMATIC1111's avatar AUTOMATIC1111
Browse files

Merge branch 'release_candidate'

parents a3ddf464 50973ec7
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
## 1.5.1

### Minor:
 * support parsing text encoder blocks in some new LoRAs
 * delete scale checker script due to user demand

### Extensions and API:
 * add postprocess_batch_list script callback

### Bug Fixes:
 * fix TI training for SD1
 * fix reload altclip model error
 * prepend the pythonpath instead of overriding it
 * fix typo in SD_WEBUI_RESTARTING
 * if txt2img/img2img raises an exception, finally call state.end()
 * fix composable diffusion weight parsing
 * restyle Startup profile for black users
 * fix webui not launching with --nowebui
 * catch exception for non git extensions
 * fix some options missing from /sdapi/v1/options
 * fix for extension update status always saying "unknown"
 * fix display of extra network cards that have `<>` in the name
 * update lora extension to work with python 3.8


## 1.5.0

### Features:
+1 −0
Original line number Diff line number Diff line
from __future__ import annotations
import os
from collections import namedtuple
import enum
+5 −0
Original line number Diff line number Diff line
@@ -163,6 +163,11 @@ def load_network(name, network_on_disk):
            key = key_network_without_network_parts.replace("lora_te1_text_model", "0_transformer_text_model")
            sd_module = shared.sd_model.network_layer_mapping.get(key, None)

            # some SD1 Loras also have correct compvis keys
            if sd_module is None:
                key = key_network_without_network_parts.replace("lora_te1_text_model", "transformer_text_model")
                sd_module = shared.sd_model.network_layer_mapping.get(key, None)

        if sd_module is None:
            keys_failed_to_match[key_network] = key
            continue

javascript/badScaleChecker.js

deleted100644 → 0
+0 −108
Original line number Diff line number Diff line
(function() {
    var ignore = localStorage.getItem("bad-scale-ignore-it") == "ignore-it";

    function getScale() {
        var ratio = 0,
            screen = window.screen,
            ua = navigator.userAgent.toLowerCase();

        if (window.devicePixelRatio !== undefined) {
            ratio = window.devicePixelRatio;
        } else if (~ua.indexOf('msie')) {
            if (screen.deviceXDPI && screen.logicalXDPI) {
                ratio = screen.deviceXDPI / screen.logicalXDPI;
            }
        } else if (window.outerWidth !== undefined && window.innerWidth !== undefined) {
            ratio = window.outerWidth / window.innerWidth;
        }

        return ratio == 0 ? 0 : Math.round(ratio * 100);
    }

    var showing = false;

    var div = document.createElement("div");
    div.style.position = "fixed";
    div.style.top = "0px";
    div.style.left = "0px";
    div.style.width = "100vw";
    div.style.backgroundColor = "firebrick";
    div.style.textAlign = "center";
    div.style.zIndex = 99;

    var b = document.createElement("b");
    b.innerHTML = 'Bad Scale: ??% ';

    div.appendChild(b);

    var note1 = document.createElement("p");
    note1.innerHTML = "Change your browser or your computer settings!";
    note1.title = 'Just make sure "computer-scale" * "browser-scale" = 100% ,\n' +
        "you can keep your computer-scale and only change this page's scale,\n" +
        "for example: your computer-scale is 125%, just use [\"CTRL\"+\"-\"] to make your browser-scale of this page to 80%.";
    div.appendChild(note1);

    var note2 = document.createElement("p");
    note2.innerHTML = " Otherwise, it will cause this page to not function properly!";
    note2.title = "When you click \"Copy image to: [inpaint sketch]\" in some img2img's tab,\n" +
        "if scale<100% the canvas will be invisible,\n" +
        "else if scale>100% this page will take large amount of memory and CPU performance.";
    div.appendChild(note2);

    var btn = document.createElement("button");
    btn.innerHTML = "Click here to ignore";

    div.appendChild(btn);

    function tryShowTopBar(scale) {
        if (showing) return;

        b.innerHTML = 'Bad Scale: ' + scale + '% ';

        var updateScaleTimer = setInterval(function() {
            var newScale = getScale();
            b.innerHTML = 'Bad Scale: ' + newScale + '% ';
            if (newScale == 100) {
                var p = div.parentNode;
                if (p != null) p.removeChild(div);
                showing = false;
                clearInterval(updateScaleTimer);
                check();
            }
        }, 999);

        btn.onclick = function() {
            clearInterval(updateScaleTimer);
            var p = div.parentNode;
            if (p != null) p.removeChild(div);
            ignore = true;
            showing = false;
            localStorage.setItem("bad-scale-ignore-it", "ignore-it");
        };

        document.body.appendChild(div);
    }

    function check() {
        if (!ignore) {
            var timer = setInterval(function() {
                var scale = getScale();
                if (scale != 100 && !ignore) {
                    tryShowTopBar(scale);
                    clearInterval(timer);
                }
                if (ignore) {
                    clearInterval(timer);
                }
            }, 999);
        }
    }

    if (document.readyState != "complete") {
        document.onreadystatechange = function() {
            if (document.readyState != "complete") check();
        };
    } else {
        check();
    }
})();
+22 −18
Original line number Diff line number Diff line
@@ -333,6 +333,7 @@ class Api:
                p.outpath_grids = opts.outdir_txt2img_grids
                p.outpath_samples = opts.outdir_txt2img_samples

                try:
                    shared.state.begin(job="scripts_txt2img")
                    if selectable_scripts is not None:
                        p.script_args = script_args
@@ -340,6 +341,7 @@ class Api:
                    else:
                        p.script_args = tuple(script_args) # Need to pass args as tuple here
                        processed = process_images(p)
                finally:
                    shared.state.end()

        b64images = list(map(encode_pil_to_base64, processed.images)) if send_images else []
@@ -390,6 +392,7 @@ class Api:
                p.outpath_grids = opts.outdir_img2img_grids
                p.outpath_samples = opts.outdir_img2img_samples

                try:
                    shared.state.begin(job="scripts_img2img")
                    if selectable_scripts is not None:
                        p.script_args = script_args
@@ -397,6 +400,7 @@ class Api:
                    else:
                        p.script_args = tuple(script_args) # Need to pass args as tuple here
                        processed = process_images(p)
                finally:
                    shared.state.end()

        b64images = list(map(encode_pil_to_base64, processed.images)) if send_images else []
@@ -720,9 +724,9 @@ class Api:
            cuda = {'error': f'{err}'}
        return models.MemoryResponse(ram=ram, cuda=cuda)

    def launch(self, server_name, port):
    def launch(self, server_name, port, root_path):
        self.app.include_router(self.router)
        uvicorn.run(self.app, host=server_name, port=port, timeout_keep_alive=shared.cmd_opts.timeout_keep_alive)
        uvicorn.run(self.app, host=server_name, port=port, timeout_keep_alive=shared.cmd_opts.timeout_keep_alive, root_path=root_path)

    def kill_webui(self):
        restart.stop_program()
Loading