mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 17:24:32 +02:00
fonts and upscale fix
This commit is contained in:
Submodule extensions-builtin/sd-webui-controlnet updated: a482867ee5...8fd1fcdc53
@@ -16,7 +16,8 @@ onUiUpdate(function(){
|
||||
if (headImg.search(regExpTempImage) != -1) return;
|
||||
lastHeadImg = headImg;
|
||||
// play notification sound if available
|
||||
gradioApp().querySelector('#audio_notification audio')?.play();
|
||||
const audioNotification = gradioApp().querySelector('#audio_notification audio');
|
||||
if (audioNotification) audioNotification.play();
|
||||
if (document.hasFocus()) return;
|
||||
// Multiple copies of the images are in the DOM when one is selected. Dedup with a Set to get the real number generated.
|
||||
const imgs = new Set(Array.from(galleryPreviews).map(img => img.src));
|
||||
|
||||
+1
-1
Submodule modules/lora updated: bc803e01c7...b9085fc80a
@@ -84,7 +84,7 @@ def run_postprocessing(extras_mode, image, image_folder: List[tempfile.NamedTemp
|
||||
return outputs, ui_common.plaintext_to_html(infotext), ''
|
||||
|
||||
|
||||
def run_extras(extras_mode, resize_mode, image, image_folder, input_dir, output_dir, show_extras_results, gfpgan_visibility, codeformer_visibility, codeformer_weight, upscaling_resize, upscaling_resize_w, upscaling_resize_h, upscaling_crop, extras_upscaler_1, extras_upscaler_2, extras_upscaler_2_visibility, _upscale_first: bool, save_output: bool = True):
|
||||
def run_extras(extras_mode, resize_mode, image, image_folder, input_dir, output_dir, show_extras_results, gfpgan_visibility, codeformer_visibility, codeformer_weight, upscaling_resize, upscaling_resize_w, upscaling_resize_h, upscaling_crop, extras_upscaler_1, extras_upscaler_2, extras_upscaler_2_visibility, upscale_first: bool, save_output: bool = True): #pylint: disable=unused-argument
|
||||
"""old handler for API"""
|
||||
|
||||
args = scripts.scripts_postproc.create_args_for_run({
|
||||
|
||||
@@ -4,6 +4,7 @@ import sys
|
||||
from collections import namedtuple
|
||||
import gradio as gr
|
||||
from modules import paths, script_callbacks, extensions, script_loading, scripts_postprocessing, errors
|
||||
from installer import log
|
||||
|
||||
AlwaysVisible = object()
|
||||
|
||||
@@ -189,6 +190,7 @@ def list_scripts(scriptdirname, extension):
|
||||
else:
|
||||
priority = priority + script.priority
|
||||
priority_list.append(ScriptFile(script.basedir, script.filename, script.path, priority))
|
||||
# log.debug(f'Adding script: {script.basedir} {script.filename} {script.path} {priority}')
|
||||
priority_sort = sorted(priority_list, key=lambda item: item.priority + item.path.lower(), reverse=False)
|
||||
return priority_sort
|
||||
|
||||
@@ -217,6 +219,7 @@ def load_scripts():
|
||||
for _key, script_class in module.__dict__.items():
|
||||
if type(script_class) != type:
|
||||
continue
|
||||
log.debug(f'Registering script: {scriptfile.path}')
|
||||
if issubclass(script_class, Script):
|
||||
scripts_data.append(ScriptClassData(script_class, scriptfile.path, scriptfile.basedir, module))
|
||||
elif issubclass(script_class, scripts_postprocessing.ScriptPostprocessing):
|
||||
|
||||
+5
-5
@@ -3,9 +3,9 @@ import sys
|
||||
import time
|
||||
import json
|
||||
import datetime
|
||||
import urllib.request
|
||||
import gradio as gr
|
||||
import tqdm
|
||||
import urllib.request
|
||||
from modules import errors, ui_components, shared_items, cmd_args
|
||||
from modules.paths_internal import models_path, script_path, data_path, sd_configs_path, sd_default_config, sd_model_file, default_sd_model_file, extensions_dir, extensions_builtin_dir # pylint: disable=W0611
|
||||
import modules.interrogate
|
||||
@@ -625,13 +625,13 @@ def reload_gradio_theme(theme_name=None):
|
||||
if not theme_name:
|
||||
theme_name = opts.gradio_theme
|
||||
default_font_params = {}
|
||||
ret_code = 0
|
||||
res = 0
|
||||
try:
|
||||
req = urllib.request.Request("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono", method="HEAD")
|
||||
ret_code = urllib.request.urlopen(req, timeout=3.0).get_code()
|
||||
res = urllib.request.urlopen(req, timeout=3.0).status
|
||||
except:
|
||||
ret_code = 0
|
||||
if (ret_code != 200):
|
||||
res = 0
|
||||
if res != 200:
|
||||
log.info('No internet access detected, using default fonts')
|
||||
default_font_params = {
|
||||
'font':['Helvetica', 'ui-sans-serif', 'system-ui', 'sans-serif'],
|
||||
|
||||
+6
-4
@@ -52,10 +52,12 @@ class StyleDatabase:
|
||||
with open(self.path, "r", encoding="utf-8-sig", newline='') as file:
|
||||
reader = csv.DictReader(file)
|
||||
for row in reader:
|
||||
# Support loading old CSV format with "name, text"-columns
|
||||
prompt = row["prompt"] if "prompt" in row else row["text"]
|
||||
negative_prompt = row.get("negative_prompt", "")
|
||||
self.styles[row["name"]] = PromptStyle(row["name"], prompt, negative_prompt)
|
||||
try:
|
||||
prompt = row["prompt"] if "prompt" in row else row["text"]
|
||||
negative_prompt = row.get("negative_prompt", "")
|
||||
self.styles[row["name"]] = PromptStyle(row["name"], prompt, negative_prompt)
|
||||
except:
|
||||
pass
|
||||
|
||||
def get_style_prompts(self, styles):
|
||||
return [self.styles.get(x, self.no_style).prompt for x in styles]
|
||||
|
||||
Reference in New Issue
Block a user