From dc5b5238c83c63b4d7814ba210da074ddc341213 Mon Sep 17 00:00:00 2001 From: Chris Rohrer Date: Wed, 10 Jan 2024 02:50:47 +0100 Subject: [PATCH 1/2] fix: prevent cutting off overlay (#1829) Co-authored-by: Christoph Rohrer --- css/style.css | 9 ++++++++- javascript/script.js | 5 +++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/css/style.css b/css/style.css index 6ebfd432..010c8e7f 100644 --- a/css/style.css +++ b/css/style.css @@ -198,7 +198,8 @@ } #stylePreviewOverlay { - display: none; + opacity: 0; + pointer-events: none; width: 128px; height: 128px; position: fixed; @@ -208,6 +209,12 @@ transform: translate(-140px, 20px); background-size: cover; background-position: center; + background-color: rgba(0, 0, 0, 0.3); border-radius: 5px; z-index: 100; + transition: transform 0.1s ease, opacity 0.3s ease; +} + +#stylePreviewOverlay.lower-half { + transform: translate(-140px, -140px); } diff --git a/javascript/script.js b/javascript/script.js index d3d16ffb..8f4cac58 100644 --- a/javascript/script.js +++ b/javascript/script.js @@ -158,7 +158,7 @@ function initStylePreviewOverlay() { label.removeEventListener("mouseout", onMouseLeave); label.addEventListener("mouseout", onMouseLeave); overlayVisible = true; - overlay.style.display = "block"; + overlay.style.opacity = "1"; const originalText = label.querySelector("span").getAttribute("data-original-text"); const name = originalText || label.querySelector("span").textContent; overlay.style.backgroundImage = `url("${samplesPath.replace( @@ -167,7 +167,7 @@ function initStylePreviewOverlay() { ).replaceAll("\\", "\\\\")}")`; function onMouseLeave() { overlayVisible = false; - overlay.style.display = "none"; + overlay.style.opacity = "0"; overlay.style.backgroundImage = ""; label.removeEventListener("mouseout", onMouseLeave); } @@ -176,6 +176,7 @@ function initStylePreviewOverlay() { if(!overlayVisible) return; overlay.style.left = `${e.clientX}px`; overlay.style.top = `${e.clientY}px`; + overlay.className = e.clientY > window.innerHeight / 2 ? "lower-half" : "upper-half"; }); } From 92684132b5bd85b04ee4763a95cd99aaba3bc8c3 Mon Sep 17 00:00:00 2001 From: Manuel Schmid Date: Wed, 10 Jan 2024 11:00:39 +0100 Subject: [PATCH 2/2] clean up model download URL query parameters --- modules/config.py | 2 +- presets/default.json | 2 +- presets/lcm.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/config.py b/modules/config.py index 1acb2128..b580230c 100644 --- a/modules/config.py +++ b/modules/config.py @@ -256,7 +256,7 @@ default_image_number = get_config_item_or_set_default( checkpoint_downloads = get_config_item_or_set_default( key='checkpoint_downloads', default_value={ - "juggernautXL_v8Rundiffusion.safetensors": "https://civitai.com/api/download/models/288982?type=Model&format=SafeTensor&size=full&fp=fp16" + "juggernautXL_v8Rundiffusion.safetensors": "https://civitai.com/api/download/models/288982" }, validator=lambda x: isinstance(x, dict) and all(isinstance(k, str) and isinstance(v, str) for k, v in x.items()) ) diff --git a/presets/default.json b/presets/default.json index 55360f96..8ce9ad36 100644 --- a/presets/default.json +++ b/presets/default.json @@ -38,7 +38,7 @@ ], "default_aspect_ratio": "1152*896", "checkpoint_downloads": { - "juggernautXL_v8Rundiffusion.safetensors": "https://civitai.com/api/download/models/288982?type=Model&format=SafeTensor&size=full&fp=fp16" + "juggernautXL_v8Rundiffusion.safetensors": "https://civitai.com/api/download/models/288982" }, "embeddings_downloads": {}, "lora_downloads": { diff --git a/presets/lcm.json b/presets/lcm.json index 8d959c24..db35321d 100644 --- a/presets/lcm.json +++ b/presets/lcm.json @@ -38,7 +38,7 @@ ], "default_aspect_ratio": "1152*896", "checkpoint_downloads": { - "juggernautXL_v8Rundiffusion.safetensors": "https://civitai.com/api/download/models/288982?type=Model&format=SafeTensor&size=full&fp=fp16" + "juggernautXL_v8Rundiffusion.safetensors": "https://civitai.com/api/download/models/288982" }, "embeddings_downloads": {}, "lora_downloads": {}