diff --git a/js/index.js b/js/index.js index ab9b767..5341df9 100644 --- a/js/index.js +++ b/js/index.js @@ -890,14 +890,6 @@ async function upscaleAndDownload() { function loadSettings() { // set default values if not set - var _prompt = - localStorage.getItem("prompt") == null - ? "ocean floor scientific expedition, underwater wildlife" - : localStorage.getItem("prompt"); - var _negprompt = - localStorage.getItem("neg_prompt") == null - ? "people, person, humans, human, divers, diver, glitch, error, text, watermark, bad quality, blurry" - : localStorage.getItem("neg_prompt"); var _mask_blur = localStorage.getItem("mask_blur") == null ? 0 diff --git a/js/prompt.js b/js/prompt.js index 5b9c55b..53ebf3e 100644 --- a/js/prompt.js +++ b/js/prompt.js @@ -76,9 +76,12 @@ async function getStyles() { }; // Load from local storage if set - const promptDefaultValue = localStorage.getItem("prompt") || defaultPrompt; + const storedPrompt = localStorage.getItem("prompt"); + const storedNeg = localStorage.getItem("neg_prompt"); + const promptDefaultValue = + storedPrompt === null ? defaultPrompt : storedPrompt; const negativePromptDefaultValue = - localStorage.getItem("neg_prompt") || defaultNegativePrompt; + storedNeg === null ? defaultNegativePrompt : storedNeg; promptEl.value = promptEl.title = promptDefaultValue; negativePromptEl.value = negativePromptEl.title = negativePromptDefaultValue; diff --git a/js/ui/tool/dream.js b/js/ui/tool/dream.js index 2a1015d..8a74ad8 100644 --- a/js/ui/tool/dream.js +++ b/js/ui/tool/dream.js @@ -1024,10 +1024,29 @@ const dreamTool = () => state.selected.bb = bb; - state.erasePrevReticle = _reticle_draw(bb, state, "Dream", { - w: bb.w, - h: bb.h, - }); + const style = + state.cursorSize > stableDiffusionData.width + ? "#FBB5" + : state.cursorSize < stableDiffusionData.width + ? "#BFB5" + : "#FFF5"; + + state.erasePrevReticle = _reticle_draw( + bb, + state, + "Dream", + { + w: Math.round( + bb.w * (stableDiffusionData.width / state.cursorSize) + ), + h: Math.round( + bb.h * (stableDiffusionData.height / state.cursorSize) + ), + }, + { + sizeTextStyle: style, + } + ); return; } @@ -1315,10 +1334,22 @@ const img2imgTool = () => request = {width: bb.w, height: bb.h}; - state.erasePrevReticle = _reticle_draw(bb, state, "Img2Img", { - w: bb.w, - h: bb.h, - }); + state.erasePrevReticle = _reticle_draw( + bb, + state, + "Img2Img", + { + w: Math.round( + bb.w * (stableDiffusionData.width / state.cursorSize) + ), + h: Math.round( + bb.h * (stableDiffusionData.height / state.cursorSize) + ), + }, + { + sizeTextStyle: style, + } + ); } else { bb = getBoundingBox( evn.x,