diff --git a/CHANGELOG.md b/CHANGELOG.md index 4edfa26a5..d68ac05fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,10 +42,9 @@ Service release addressing all zero-day issues reported so far... its a distilled model, this time 50% smaller and faster version of SD-XL! test shows batch-size:4 with 1k images used less than 6.5GB of VRAM download using built-in **Huggingface** downloader: `segmind/SSD-1B` - - new model type: [OpenAI Consistency Models](https://github.com/openai/consistency_models) - near-instant generate in a one or two steps! - current list of models is very limited as they are not general purpose models, but that is expected to change - download using built-in **Huggingface** downloaded: `openai/diffusers` + - new model type: [LCM: Latent Consistency Models](https://github.com/openai/consistency_models) + near-instant generate in a as little as 3 steps! + download using built-in **Huggingface** downloaded: `SimianLuo/LCM_Dreamshaper_v7` - add support for **Custom pipelines**, thanks @disty0 custom pipelines can be downloaded using built-in **Huggingface** downloaded think of them as plugins for diffusers not unlike original extensions that modify behavior of `ldm` backend @@ -60,6 +59,8 @@ Service release addressing all zero-day issues reported so far... - new option: *settings -> images -> keep incomplete* can be used to skip vae decode on aborted/skipped/interrupted image generations - remove external clone of items in `/repositories` + - switch core font in default theme to **noto-sans** + previously system-ui font was used as default, but it lead to too much variations between browsers and platforms **Themes** diff --git a/extensions-builtin/sd-extension-chainner b/extensions-builtin/sd-extension-chainner index 2488b2357..1cdc8578a 160000 --- a/extensions-builtin/sd-extension-chainner +++ b/extensions-builtin/sd-extension-chainner @@ -1 +1 @@ -Subproject commit 2488b23571e86da6fc180c072870145f3b4fb32c +Subproject commit 1cdc8578a3c0538177c3ac13721b9764f8782c8f diff --git a/javascript/base.css b/javascript/base.css index cb28d8412..b5736cbf2 100644 --- a/javascript/base.css +++ b/javascript/base.css @@ -93,7 +93,7 @@ table.settings-value-table td { padding: 0.4em; border: 1px solid #ccc; max-widt .extra-network-cards { display: flex; flex-wrap: wrap; overflow-y: auto; overflow-x: hidden; align-content: flex-start; width: -moz-available; width: -webkit-fill-available; } .extra-network-cards .card { height: fit-content; margin: 0 0 0.5em 0.5em; position: relative; scroll-snap-align: start; scroll-margin-top: 0; } .extra-network-cards .card .overlay { position: absolute; bottom: 0; padding: 0.2em; z-index: 10; width: 100%; background: none; } -.extra-network-cards .card .overlay .name { font-size: 1.1em; font-weight: bold; text-shadow: 1px 1px black; color: white; overflow-wrap: break-word; } +.extra-network-cards .card .overlay .name { text-shadow: 1px 1px black; color: white; overflow-wrap: break-word; } .extra-network-cards .card .preview { box-shadow: var(--button-shadow); min-height: 30px; } .extra-network-cards .card:hover .overlay { background: rgba(0, 0, 0, 0.40); } .extra-network-cards .card:hover .preview { box-shadow: none; filter: grayscale(100%); } diff --git a/javascript/black-orange.css b/javascript/black-orange.css index 30e069777..4677d4db4 100644 --- a/javascript/black-orange.css +++ b/javascript/black-orange.css @@ -1,7 +1,8 @@ /* generic html tags */ +@font-face { font-family: 'NotoSans'; font-display: swap; font-style: normal; font-weight: 100; src: local('NotoSans'), url('notosans-nerdfont-regular.ttf') } :root, .light, .dark { - --font: "Source Sans Pro", 'ui-sans-serif', 'system-ui', "Roboto", sans-serif; - --font-mono: 'IBM Plex Mono', 'ui-monospace', 'Consolas', monospace; + --font: 'NotoSans'; + --font-mono: 'ui-monospace', 'Consolas', monospace; --font-size: 16px; --left-column: 490px; --highlight-color: #ce6400; @@ -18,15 +19,28 @@ --primary-800: #9a3412; --primary-900: #7c2d12; --primary-950: #6c2e12; -} -.light, .dark { + --highlight-color: var(--primary-200); + --inactive-color: var(--primary--800); + --body-text-color: var(--neutral-100); + --body-text-color-subdued: var(--neutral-300); + --background-color: #000000; + --background-fill-primary: var(--neutral-700); --input-padding: 4px; - --radius-lg: 2px; - --radius-sm: 1px; + --input-background-fill: var(--neutral-800); + --input-shadow: 2px 2px 2px 2px var(--background-color); + --button-secondary-text-color: white; + --button-secondary-background-fill: linear-gradient(to bottom right, var(--neutral-400), var(--neutral-700)); + --button-secondary-background-fill-hover: linear-gradient(to bottom right, var(--neutral-700), var(--neutral-400)); + --block-title-text-color: var(--neutral-300); + --radius-sm: 2px; + --radius-lg: 4px; --spacing-md: 4px; - --spacing-xxl: 12px; - --line-sm: 1.3em; - --line-md: 1.3em; + --spacing-xxl: 6px; + --line-sm: 1.2em; + --line-md: 1.4em; + --text-sm: 12px; + --text-md: 13px; + --text-lg: 15px; } html { font-size: var(--font-size); } @@ -244,9 +258,6 @@ svg.feather.feather-image, .feather .feather-image { display: none } --radius-xxl: 0; --text-xxs: 9px; --text-xs: 10px; - --text-sm: 12px; - --text-md: 14px; - --text-lg: 16px; --text-xl: 22px; --text-xxl: 26px; --body-text-size: var(--text-md); diff --git a/javascript/black-teal.css b/javascript/black-teal.css index bef9280ac..095c9c4d8 100644 --- a/javascript/black-teal.css +++ b/javascript/black-teal.css @@ -1,6 +1,7 @@ /* generic html tags */ +@font-face { font-family: 'NotoSans'; font-display: swap; font-style: normal; font-weight: 100; src: local('NotoSans'), url('notosans-nerdfont-regular.ttf') } :root, .light, .dark { - --font: 'system-ui', 'ui-sans-serif', 'system-ui', "Roboto", sans-serif; + --font: 'NotoSans'; --font-mono: 'ui-monospace', 'Consolas', monospace; --font-size: 16px; --left-column: 490px; @@ -34,10 +35,13 @@ --spacing-xxl: 6px; --line-sm: 1.2em; --line-md: 1.4em; + --text-sm: 12px; + --text-md: 13px; + --text-lg: 15px; } -html { font-size: var(--font-size); } -body, button, input, select, textarea { font-family: var(--font);} +html { font-size: var(--font-size); font-family: var(--font); } +body, button, input, select, textarea { font-family: var(--font); } button { font-size: 1.2rem; max-width: 400px; } img { background-color: var(--background-color); } input[type=range] { height: var(--line-sm) !important; appearance: none !important; margin-top: 0 !important; min-width: 160px !important; @@ -246,9 +250,6 @@ textarea[rows="1"] { height: 33px !important; width: 99% !important; padding: 8p --radius-xxl: 0; --text-xxs: 9px; --text-xs: 10px; - --text-sm: 12px; - --text-md: 14px; - --text-lg: 16px; --text-xl: 22px; --text-xxl: 26px; --body-text-size: var(--text-md); diff --git a/javascript/light-teal.css b/javascript/light-teal.css index 7778caded..b8c71d9c4 100644 --- a/javascript/light-teal.css +++ b/javascript/light-teal.css @@ -1,6 +1,7 @@ /* generic html tags */ +@font-face { font-family: 'NotoSans'; font-display: swap; font-style: normal; font-weight: 100; src: local('NotoSans'), url('notosans-nerdfont-regular.ttf') } :root, .light, .dark { - --font: 'system-ui', 'ui-sans-serif', 'system-ui', "Roboto", sans-serif; + --font: 'NotoSans'; --font-mono: 'ui-monospace', 'Consolas', monospace; --font-size: 16px; --left-column: 490px; @@ -34,6 +35,9 @@ --spacing-xxl: 8px; --line-sm: 1.2em; --line-md: 1.4em; + --text-sm: 12px; + --text-md: 13px; + --text-lg: 15px; } html { font-size: var(--font-size); } @@ -308,9 +312,6 @@ svg.feather.feather-image, .feather .feather-image { display: none } --table-radius: var(--radius-lg); --table-row-focus: var(--color-accent-soft); --text-lg: 16px; - --text-md: 14px; - --text-sm: 12px; - --text-xl: 22px; --text-xs: 10px; --text-xxl: 26px; --text-xxs: 9px; diff --git a/javascript/notosans-nerdfont-regular.ttf b/javascript/notosans-nerdfont-regular.ttf new file mode 100644 index 000000000..ba480dba3 Binary files /dev/null and b/javascript/notosans-nerdfont-regular.ttf differ diff --git a/javascript/progressBar.js b/javascript/progressBar.js index 55f5ac1ea..5d8e65323 100644 --- a/javascript/progressBar.js +++ b/javascript/progressBar.js @@ -46,7 +46,6 @@ function setProgress(res) { const perc = res && (progress > 0) ? `${Math.round(100.0 * progress)}%` : ''; let sec = res?.eta || 0; let eta = ''; - console.log('HERE', res); if (res?.paused) eta = 'Paused'; else if (res?.completed || (progress > 0.99)) eta = 'Finishing'; else if (sec === 0) eta = 'Starting'; diff --git a/html/roboto.ttf b/javascript/roboto.ttf similarity index 100% rename from html/roboto.ttf rename to javascript/roboto.ttf diff --git a/javascript/sdnext.css b/javascript/sdnext.css index f8344cbaf..65152da4a 100644 --- a/javascript/sdnext.css +++ b/javascript/sdnext.css @@ -1,3 +1,4 @@ +@font-face { font-family: 'Roboto'; font-display: swap; font-style: normal; font-weight: 100; src: local('Roboto'), url('roboto.ttf') } :root { --left-column: 490px; } a { font-weight: bold; cursor: pointer; } h2 { margin-top: 1em !important; font-size: 1.4em !important; } @@ -72,7 +73,7 @@ button.custom-button{ border-radius: var(--button-large-radius); padding: var(-- #txt2img_footer, #img2img_footer { height: fit-content; display: none; } #txt2img_generate_box, #img2img_generate_box { gap: 0.5em; flex-wrap: wrap-reverse; height: fit-content; } #txt2img_actions_column, #img2img_actions_column { gap: 0.5em; height: fit-content; } -#txt2img_generate_box > button, #img2img_generate_box > button, #txt2img_enqueue, #img2img_enqueue { min-height: 42px; max-height: 42px; font-size: var(--input-text-size); line-height: 1em; } +#txt2img_generate_box > button, #img2img_generate_box > button, #txt2img_enqueue, #img2img_enqueue { min-height: 42px; max-height: 42px; line-height: 1em; } #txt2img_generate_line2, #img2img_generate_line2, #txt2img_tools, #img2img_tools { display: flex; } #txt2img_generate_line2 > button, #img2img_generate_line2 > button, #extras_generate_box > button, #txt2img_tools > button, #img2img_tools > button { height: 2em; line-height: 0; font-size: var(--input-text-size); min-width: unset; display: block !important; margin-left: 0.4em; margin-right: 0.4em; } diff --git a/modules/images.py b/modules/images.py index 158c613ac..ad5cdd15b 100644 --- a/modules/images.py +++ b/modules/images.py @@ -135,9 +135,9 @@ def draw_grid_annotations(im, width, height, hor_texts, ver_texts, margin=0): def get_font(fontsize): try: - return ImageFont.truetype(shared.opts.font or 'html/roboto.ttf', fontsize) + return ImageFont.truetype(shared.opts.font or 'javascript/roboto.ttf', fontsize) except Exception: - return ImageFont.truetype('html/roboto.ttf', fontsize) + return ImageFont.truetype('javascript/roboto.ttf', fontsize) def draw_texts(drawing: ImageDraw, draw_x, draw_y, lines, initial_fnt, initial_fontsize): for line in lines: diff --git a/modules/sd_models.py b/modules/sd_models.py index 9aa30f388..012177008 100644 --- a/modules/sd_models.py +++ b/modules/sd_models.py @@ -848,6 +848,8 @@ def load_diffuser(checkpoint_info=None, already_loaded_state_dict=None, timer=No vae = sd_vae.load_vae_diffusers(checkpoint_info.path, vae_file, vae_source) if vae is not None: diffusers_load_config["vae"] = vae + if 'LCM' in checkpoint_info.path: + diffusers_load_config['custom_pipeline'] = 'latent_consistency_txt2img' if os.path.isdir(checkpoint_info.path): err1 = None @@ -858,18 +860,21 @@ def load_diffuser(checkpoint_info=None, already_loaded_state_dict=None, timer=No sd_model.model_type = sd_model.__class__.__name__ except Exception as e: err1 = e + shared.log.error(f'AutoPipeline: {e}') try: # try diffusion pipeline next second-best choice, works for most non-linked pipelines if err1 is not None: sd_model = diffusers.DiffusionPipeline.from_pretrained(checkpoint_info.path, cache_dir=shared.opts.diffusers_dir, **diffusers_load_config) sd_model.model_type = sd_model.__class__.__name__ except Exception as e: err2 = e + shared.log.error(f'DiffusionPipeline: {e}') try: # try basic pipeline next just in case if err2 is not None: sd_model = diffusers.StableDiffusionPipeline.from_pretrained(checkpoint_info.path, cache_dir=shared.opts.diffusers_dir, **diffusers_load_config) sd_model.model_type = sd_model.__class__.__name__ except Exception as e: err3 = e # ignore last error + shared.log.error(f'StableDiffusionPipeline: {e}') if err3 is not None: shared.log.error(f'Failed loading {op}: {checkpoint_info.path} auto={err1} diffusion={err2}') return @@ -1155,7 +1160,7 @@ def reload_model_weights(sd_model=None, info=None, reuse_dict=False, op='model') return None orig_state = copy.deepcopy(shared.state) shared.state = shared_state.State() - shared.state.begin(f'load') + shared.state.begin('load') if load_dict: shared.log.debug(f'Model dict: existing={sd_model is not None} target={checkpoint_info.filename} info={info}') else: diff --git a/modules/textual_inversion/image_embedding.py b/modules/textual_inversion/image_embedding.py index 7c9fe881d..a59798bb4 100644 --- a/modules/textual_inversion/image_embedding.py +++ b/modules/textual_inversion/image_embedding.py @@ -133,7 +133,7 @@ def caption_image_overlay(srcimage, title, footerLeft, footerMid, footerRight, t image = srcimage.copy() fontsize = 32 if textfont is None: - textfont = opts.font or 'html/roboto.ttf' + textfont = opts.font or 'javascript/roboto.ttf' factor = 1.5 gradient = Image.new('RGBA', (1, image.size[1]), color=(0, 0, 0, 0)) diff --git a/requirements.txt b/requirements.txt index ffb5dacc3..f7b583b7e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -51,7 +51,7 @@ opencv-python-headless==4.7.0.72 diffusers==0.21.4 einops==0.4.1 gradio==3.43.2 -huggingface_hub==0.17.1 +huggingface_hub==0.18.0 numexpr==2.8.4 numpy==1.24.4 numba==0.57.1 diff --git a/scripts/prompt_matrix.py b/scripts/prompt_matrix.py index a5f388feb..00d6edc7a 100644 --- a/scripts/prompt_matrix.py +++ b/scripts/prompt_matrix.py @@ -45,17 +45,17 @@ class Script(scripts.Script): gr.HTML('
') with gr.Row(): with gr.Column(): - put_at_start = gr.Checkbox(label='Put variable parts at start of prompt', value=False, elem_id=self.elem_id("put_at_start")) - different_seeds = gr.Checkbox(label='Use different seed for each picture', value=False, elem_id=self.elem_id("different_seeds")) + put_at_start = gr.Checkbox(label='Set at prompt start', value=False, elem_id=self.elem_id("put_at_start")) + different_seeds = gr.Checkbox(label='Random seeds', value=False, elem_id=self.elem_id("different_seeds")) with gr.Column(): - prompt_type = gr.Radio(["positive", "negative"], label="Select prompt", elem_id=self.elem_id("prompt_type"), value="positive") - variations_delimiter = gr.Radio(["comma", "space"], label="Select joining char", elem_id=self.elem_id("variations_delimiter"), value="comma") + prompt_type = gr.Radio(["positive", "negative"], label="Prompt type", elem_id=self.elem_id("prompt_type"), value="positive") + variations_delimiter = gr.Radio(["comma", "space"], label="Joining char", elem_id=self.elem_id("variations_delimiter"), value="comma") with gr.Column(): margin_size = gr.Slider(label="Grid margins", minimum=0, maximum=500, value=0, step=2, elem_id=self.elem_id("margin_size")) return [put_at_start, different_seeds, prompt_type, variations_delimiter, margin_size] - def run(self, p, put_at_start, different_seeds, prompt_type, variations_delimiter, margin_size): + def run(self, p, put_at_start, different_seeds, prompt_type, variations_delimiter, margin_size): # pylint: disable=arguments-differ modules.processing.fix_seed(p) # Raise error if promp type is not positive or negative if prompt_type not in ["positive", "negative"]: