mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-03-09 16:40:10 +01:00
Add swap SD dimensions button
This commit is contained in:
parent
a9c4422c87
commit
88b6331aed
@ -911,6 +911,16 @@ function onHeightInput() {
|
|||||||
saveSettingsDebounced();
|
saveSettingsDebounced();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onSwapDimensionsClick() {
|
||||||
|
const w = extension_settings.sd.height;
|
||||||
|
const h = extension_settings.sd.width;
|
||||||
|
extension_settings.sd.width = w;
|
||||||
|
extension_settings.sd.height = h;
|
||||||
|
$('#sd_width').val(w).trigger('input');
|
||||||
|
$('#sd_height').val(h).trigger('input');
|
||||||
|
saveSettingsDebounced();
|
||||||
|
}
|
||||||
|
|
||||||
async function onSourceChange() {
|
async function onSourceChange() {
|
||||||
extension_settings.sd.source = $('#sd_source').find(':selected').val();
|
extension_settings.sd.source = $('#sd_source').find(':selected').val();
|
||||||
extension_settings.sd.model = null;
|
extension_settings.sd.model = null;
|
||||||
@ -3439,6 +3449,7 @@ jQuery(async () => {
|
|||||||
$('#sd_wand_visible').on('input', onWandVisibleInput);
|
$('#sd_wand_visible').on('input', onWandVisibleInput);
|
||||||
$('#sd_command_visible').on('input', onCommandVisibleInput);
|
$('#sd_command_visible').on('input', onCommandVisibleInput);
|
||||||
$('#sd_interactive_visible').on('input', onInteractiveVisibleInput);
|
$('#sd_interactive_visible').on('input', onInteractiveVisibleInput);
|
||||||
|
$('#sd_swap_dimensions').on('click', onSwapDimensionsClick);
|
||||||
|
|
||||||
$('.sd_settings .inline-drawer-toggle').on('click', function () {
|
$('.sd_settings .inline-drawer-toggle').on('click', function () {
|
||||||
initScrollHeight($('#sd_prompt_prefix'));
|
initScrollHeight($('#sd_prompt_prefix'));
|
||||||
|
@ -244,7 +244,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex-container">
|
<div id="sd_dimensions_block" class="flex-container">
|
||||||
<div class="alignitemscenter flex-container flexFlowColumn flexGrow flexShrink gap0 flexBasis48p">
|
<div class="alignitemscenter flex-container flexFlowColumn flexGrow flexShrink gap0 flexBasis48p">
|
||||||
<small>
|
<small>
|
||||||
<span data-i18n="Width">Width</span>
|
<span data-i18n="Width">Width</span>
|
||||||
@ -260,6 +260,10 @@
|
|||||||
<input class="neo-range-slider" type="range" id="sd_height" name="sd_height" max="{{dimension_max}}" min="{{dimension_min}}" step="{{dimension_step}}" value="{{height}}" >
|
<input class="neo-range-slider" type="range" id="sd_height" name="sd_height" max="{{dimension_max}}" min="{{dimension_min}}" step="{{dimension_step}}" value="{{height}}" >
|
||||||
<input class="neo-range-input" type="number" id="sd_height_value" data-for="sd_height" max="{{dimension_max}}" min="{{dimension_min}}" step="{{dimension_step}}" value="{{height}}" >
|
<input class="neo-range-input" type="number" id="sd_height_value" data-for="sd_height" max="{{dimension_max}}" min="{{dimension_min}}" step="{{dimension_step}}" value="{{height}}" >
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div id="sd_swap_dimensions" class="right_menu_button" title="Swap width and height" data-i18n="[title]Swap width and height">
|
||||||
|
<i class="fa-solid fa-arrow-right-arrow-left"></i>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex-container">
|
<div class="flex-container">
|
||||||
|
@ -101,3 +101,14 @@
|
|||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#sd_dimensions_block {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
#sd_swap_dimensions {
|
||||||
|
position: absolute;
|
||||||
|
left: 50%;
|
||||||
|
top: 0;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user