diff --git a/javascript/loader.js b/javascript/loader.js index 9b8ef4b3e..4fb85462f 100644 --- a/javascript/loader.js +++ b/javascript/loader.js @@ -39,7 +39,10 @@ async function createSplash() { document.getElementById('splash').insertAdjacentHTML('afterbegin', imgEl); fetch('/sdapi/v1/motd') .then((res) => res.text()) - .then((text) => document.getElementById('motd').innerHTML = text.replace(/["]+/g, '')) + .then((text) => { + const motdEl = document.getElementById('motd'); + if (motdEl) motdEl.innerHTML = text.replace(/["]+/g, ''); + }) .catch((err) => console.error('getMOTD:', err)); } diff --git a/javascript/logMonitor.js b/javascript/logMonitor.js index bca665672..7677cfced 100644 --- a/javascript/logMonitor.js +++ b/javascript/logMonitor.js @@ -39,7 +39,7 @@ async function initLogMonitor() {
| Time | +Time | Level | Facility | Module | diff --git a/javascript/sdnext.css b/javascript/sdnext.css index 94652f34f..31b8a8f5c 100644 --- a/javascript/sdnext.css +++ b/javascript/sdnext.css @@ -234,6 +234,7 @@ table.settings-value-table td { padding: 0.4em; border: 1px solid #ccc; max-widt .extras { gap: 0.2em 1em !important } #extras_generate, #extras_interrupt, #extras_skip { display: block !important; position: relative; height: 36px; } #extras_upscale { margin-top: 10px } +#pnginfo_html_info { line-height: 1.5em; } /* log monitor */ .log-monitor { display: none; justify-content: unset !important; overflow: hidden; padding: 0; margin-top: auto; font-family: monospace; font-size: 0.85em; } diff --git a/launch.py b/launch.py index aeb3a1475..f47876240 100755 --- a/launch.py +++ b/launch.py @@ -233,7 +233,7 @@ if __name__ == "__main__": if round(time.time()) % 120 == 0: state = f'job="{instance.state.job}" {instance.state.job_no}/{instance.state.job_count}' if instance.state.job != '' or instance.state.job_no != 0 or instance.state.job_count != 0 else 'idle' uptime = round(time.time() - instance.state.server_start) - installer.log.debug(f'Server: alive={alive} jobs={instance.state.total_jobs} requests={requests} uptime={uptime} memory={get_memory_stats()} backend={instance.backend} {state}') + installer.log.debug(f'Server: alive={alive} jobs={instance.state.total_jobs} requests={requests} uptime={uptime} memory={get_memory_stats()} backend={instance.backend} state={state}') if not alive: if uv is not None and uv.wants_restart: installer.log.info('Server restarting...') diff --git a/modules/images.py b/modules/images.py index 652551b08..9c8def630 100644 --- a/modules/images.py +++ b/modules/images.py @@ -18,10 +18,8 @@ import piexif.helper from PIL import Image, ImageFont, ImageDraw, PngImagePlugin, ExifTags from modules import sd_samplers, shared, script_callbacks, errors, paths -LANCZOS = (Image.Resampling.LANCZOS if hasattr(Image, 'Resampling') else Image.LANCZOS) + debug = errors.log.info if os.environ.get('SD_PATH_DEBUG', None) is not None else lambda *args, **kwargs: None - - try: from pi_heif import register_heif_opener register_heif_opener() @@ -143,8 +141,8 @@ def draw_grid_annotations(im, width, height, hor_texts, ver_texts, margin=0, tit for line in lines: font = initial_fnt fontsize = initial_fontsize - while drawing.multiline_textsize(line.text, font=font)[0] > line.allowed_width and fontsize > 0: - fontsize -= 2 + while drawing.multiline_textbbox((0,0), text=line.text, font=font)[0] > line.allowed_width and fontsize > 0: + fontsize -= 1 font = get_font(fontsize) drawing.multiline_text((draw_x, draw_y + line.size[1] / 2), line.text, font=font, fill=shared.opts.font_color if line.is_active else color_inactive, anchor="mm", align="center") if not line.is_active: @@ -230,7 +228,7 @@ def resize_image(resize_mode, im, width, height, upscaler_name=None, output_type def resize(im, w, h): if upscaler_name is None or upscaler_name == "None" or im.mode == 'L': - return im.resize((w, h), resample=LANCZOS) + return im.resize((w, h), resample=Image.Resampling.LANCZOS) scale = max(w / im.width, h / im.height) if scale > 1.0: upscalers = [x for x in shared.sd_upscalers if x.name == upscaler_name] @@ -241,7 +239,7 @@ def resize_image(resize_mode, im, width, height, upscaler_name=None, output_type upscaler = upscalers[0] im = upscaler.scaler.upscale(im, scale, upscaler.data_path) if im.width != w or im.height != h: - im = im.resize((w, h), resample=LANCZOS) + im = im.resize((w, h), resample=Image.Resampling.LANCZOS) return im if resize_mode == 0: diff --git a/modules/sd_models.py b/modules/sd_models.py index fc96b00c5..e0a9d359b 100644 --- a/modules/sd_models.py +++ b/modules/sd_models.py @@ -595,51 +595,52 @@ def change_backend(): refresh_vae_list() -def detect_pipeline(f: str, op: str = 'model'): +def detect_pipeline(f: str, op: str = 'model', warning=True): if not f.endswith('.safetensors'): return None, None guess = shared.opts.diffusers_pipeline + warn = shared.log.warning if warning else lambda *args, **kwargs: None if guess == 'Autodetect': try: size = round(os.path.getsize(f) / 1024 / 1024) if size < 128: - shared.log.warning(f'Model size smaller than expected: {f} size={size} MB') + warn(f'Model size smaller than expected: {f} size={size} MB') elif (size >= 316 and size <= 324) or (size >= 156 and size <= 164): # 320 or 160 - shared.log.warning(f'Model detected as VAE model, but attempting to load as model: {op}={f} size={size} MB') + warn(f'Model detected as VAE model, but attempting to load as model: {op}={f} size={size} MB') guess = 'VAE' elif size >= 5351 and size <= 5359: # 5353 guess = 'Stable Diffusion' # SD v2 elif size >= 5791 and size <= 5799: # 5795 if shared.backend == shared.Backend.ORIGINAL: - shared.log.warning(f'Model detected as SD-XL refiner model, but attempting to load using backend=original: {op}={f} size={size} MB') + warn(f'Model detected as SD-XL refiner model, but attempting to load using backend=original: {op}={f} size={size} MB') if op == 'model': - shared.log.warning(f'Model detected as SD-XL refiner model, but attempting to load a base model: {op}={f} size={size} MB') + warn(f'Model detected as SD-XL refiner model, but attempting to load a base model: {op}={f} size={size} MB') guess = 'Stable Diffusion XL' elif (size >= 6611 and size <= 6619) or (size >= 6771 and size <= 6779): # 6617, HassakuXL is 6776 if shared.backend == shared.Backend.ORIGINAL: - shared.log.warning(f'Model detected as SD-XL base model, but attempting to load using backend=original: {op}={f} size={size} MB') + warn(f'Model detected as SD-XL base model, but attempting to load using backend=original: {op}={f} size={size} MB') guess = 'Stable Diffusion XL' elif size >= 3361 and size <= 3369: # 3368 if shared.backend == shared.Backend.ORIGINAL: - shared.log.warning(f'Model detected as SD upscale model, but attempting to load using backend=original: {op}={f} size={size} MB') + warn(f'Model detected as SD upscale model, but attempting to load using backend=original: {op}={f} size={size} MB') guess = 'Stable Diffusion Upscale' elif size >= 4891 and size <= 4899: # 4897 if shared.backend == shared.Backend.ORIGINAL: - shared.log.warning(f'Model detected as SD XL inpaint model, but attempting to load using backend=original: {op}={f} size={size} MB') + warn(f'Model detected as SD XL inpaint model, but attempting to load using backend=original: {op}={f} size={size} MB') guess = 'Stable Diffusion XL Inpaint' elif size >= 9791 and size <= 9799: # 9794 if shared.backend == shared.Backend.ORIGINAL: - shared.log.warning(f'Model detected as SD XL instruct pix2pix model, but attempting to load using backend=original: {op}={f} size={size} MB') + warn(f'Model detected as SD XL instruct pix2pix model, but attempting to load using backend=original: {op}={f} size={size} MB') guess = 'Stable Diffusion XL Instruct' else: guess = 'Stable Diffusion' if 'LCM_' in f or 'LCM-' in f: if shared.backend == shared.Backend.ORIGINAL: - shared.log.warning(f'Model detected as LCM model, but attempting to load using backend=original: {op}={f} size={size} MB') + warn(f'Model detected as LCM model, but attempting to load using backend=original: {op}={f} size={size} MB') guess = 'Latent Consistency Model' if 'PixArt' in f: if shared.backend == shared.Backend.ORIGINAL: - shared.log.warning(f'Model detected as PixArt Alpha model, but attempting to load using backend=original: {op}={f} size={size} MB') + warn(f'Model detected as PixArt Alpha model, but attempting to load using backend=original: {op}={f} size={size} MB') guess = 'PixArt Alpha' pipeline = shared_items.get_pipelines().get(guess, None) shared.log.info(f'Autodetect: {op}="{guess}" class={pipeline.__name__} file="{f}" size={size}MB') diff --git a/requirements.txt b/requirements.txt index 4207bf910..04dd5360f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -50,10 +50,10 @@ requests==2.31.0 tqdm==4.66.1 accelerate==0.20.3 opencv-python-headless==4.7.0.72 -diffusers==0.23.0 +diffusers==0.23.1 einops==0.4.1 gradio==3.43.2 -huggingface_hub==0.19.2 +huggingface_hub==0.19.4 numexpr==2.8.4 numpy==1.24.4 numba==0.57.1 @@ -63,7 +63,7 @@ pytorch_lightning==1.9.4 transformers==4.35.1 tomesd==0.1.3 urllib3==1.26.15 -Pillow==9.5.0 +Pillow==10.1.0 timm==0.9.7 pydantic==1.10.13 typing-extensions==4.8.0
|---|