mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-04-03 21:51:04 +02:00
Only snap resolution if pixel counts change
This commit is contained in:
parent
b8387df15e
commit
8d4c4c1945
@ -1799,6 +1799,8 @@ function setTypeSpecificDimensions(generationType) {
|
|||||||
// Force to use roughly the same pixel count as before rescaling
|
// Force to use roughly the same pixel count as before rescaling
|
||||||
const prevPixelCount = prevSDHeight * prevSDWidth;
|
const prevPixelCount = prevSDHeight * prevSDWidth;
|
||||||
const newPixelCount = extension_settings.sd.height * extension_settings.sd.width;
|
const newPixelCount = extension_settings.sd.height * extension_settings.sd.width;
|
||||||
|
|
||||||
|
if (prevPixelCount !== newPixelCount) {
|
||||||
const ratio = Math.sqrt(prevPixelCount / newPixelCount);
|
const ratio = Math.sqrt(prevPixelCount / newPixelCount);
|
||||||
extension_settings.sd.height = Math.round(extension_settings.sd.height * ratio / 64) * 64;
|
extension_settings.sd.height = Math.round(extension_settings.sd.height * ratio / 64) * 64;
|
||||||
extension_settings.sd.width = Math.round(extension_settings.sd.width * ratio / 64) * 64;
|
extension_settings.sd.width = Math.round(extension_settings.sd.width * ratio / 64) * 64;
|
||||||
@ -1813,6 +1815,7 @@ function setTypeSpecificDimensions(generationType) {
|
|||||||
console.warn('Snap to resolution failed, using custom dimensions');
|
console.warn('Snap to resolution failed, using custom dimensions');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return { height: prevSDHeight, width: prevSDWidth };
|
return { height: prevSDHeight, width: prevSDWidth };
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user