diff --git a/js/index.js b/js/index.js index 2821b27..a47c49e 100644 --- a/js/index.js +++ b/js/index.js @@ -482,7 +482,7 @@ const resSlider = makeSlider( stableDiffusionData.width = stableDiffusionData.height = v; stableDiffusionData.firstphase_width = stableDiffusionData.firstphase_height = v / 2; - informSliders(); + informCursorSizeSlider(); } ); makeSlider( @@ -553,6 +553,9 @@ function changeSyncCursorSize() { "sync_cursor_size", stableDiffusionData.sync_cursor_size ); + if (stableDiffusionData.sync_cursor_size) { + resSlider.value = stableDiffusionData.width; + } } function changeSmoothRendering() { @@ -991,7 +994,9 @@ imageCollection.element.addEventListener( "wheel", (evn) => { evn.preventDefault(); - _resolution_onwheel(evn); + if (!evn.ctrlKey) { + _resolution_onwheel(evn); + } }, {passive: false} ); @@ -1010,7 +1015,7 @@ function resetToDefaults() { } } -function informSliders() { +function informCursorSizeSlider() { if (stableDiffusionData.sync_cursor_size) { if (!toolbar._current_tool.state.ignorePrevious) { toolbar._current_tool.state.setCursorSize(stableDiffusionData.width); diff --git a/js/ui/tool/dream.js b/js/ui/tool/dream.js index fe5e0f5..efcf38c 100644 --- a/js/ui/tool/dream.js +++ b/js/ui/tool/dream.js @@ -990,6 +990,12 @@ const dreamTool = () => max: 2048, step: 128, textStep: 2, + cb: () => { + if (stableDiffusionData.sync_cursor_size) { + state.ignorePrevious = true; + resSlider.value = state.cursorSize; + } + }, } ); @@ -1236,6 +1242,12 @@ const img2imgTool = () => max: 2048, step: 128, textStep: 2, + // cb: () => { + // if (stableDiffusionData.sync_cursor_size) { + // state.ignorePrevious = true; + // resSlider.value = state.cursorSize; + // } + // }, } );