mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): compare upscaledPixels vs square of max dimension
This commit is contained in:
parent
2cff20f87a
commit
7c526390ed
@ -213,9 +213,13 @@ const createSelector = (templates: Templates) =>
|
|||||||
if (!upscale.upscaleInitialImage) {
|
if (!upscale.upscaleInitialImage) {
|
||||||
reasons.push({ content: i18n.t('upscaling.missingUpscaleInitialImage') });
|
reasons.push({ content: i18n.t('upscaling.missingUpscaleInitialImage') });
|
||||||
} else if (config.maxUpscaleDimension) {
|
} else if (config.maxUpscaleDimension) {
|
||||||
const upscaledPixels =
|
const { width, height } = upscale.upscaleInitialImage;
|
||||||
upscale.upscaleInitialImage.width * upscale.scale * upscale.upscaleInitialImage.height * upscale.scale;
|
const { scale } = upscale;
|
||||||
if (upscaledPixels > config.maxUpscaleDimension) {
|
|
||||||
|
const maxPixels = config.maxUpscaleDimension ** 2;
|
||||||
|
const upscaledPixels = width * scale * height * scale;
|
||||||
|
|
||||||
|
if (upscaledPixels > maxPixels) {
|
||||||
reasons.push({ content: i18n.t('upscaling.exceedsMaxSize') });
|
reasons.push({ content: i18n.t('upscaling.exceedsMaxSize') });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user