mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
docs(ui): add comment in useIsTooLargeToUpscale
This commit is contained in:
@ -11,11 +11,16 @@ const createIsTooLargeToUpscaleSelector = (imageDTO?: ImageDTO) =>
|
|||||||
const { maxUpscaleDimension } = config;
|
const { maxUpscaleDimension } = config;
|
||||||
|
|
||||||
if (!maxUpscaleDimension || !upscaleModel || !imageDTO) {
|
if (!maxUpscaleDimension || !upscaleModel || !imageDTO) {
|
||||||
|
// When these are missing, another warning will be shown
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const upscaledPixels = imageDTO.width * scale * imageDTO.height * scale;
|
const { width, height } = imageDTO;
|
||||||
return upscaledPixels > maxUpscaleDimension * maxUpscaleDimension;
|
|
||||||
|
const maxPixels = maxUpscaleDimension ** 2;
|
||||||
|
const upscaledPixels = width * scale * height * scale;
|
||||||
|
|
||||||
|
return upscaledPixels > maxPixels;
|
||||||
});
|
});
|
||||||
|
|
||||||
export const useIsTooLargeToUpscale = (imageDTO?: ImageDTO) => {
|
export const useIsTooLargeToUpscale = (imageDTO?: ImageDTO) => {
|
||||||
|
Reference in New Issue
Block a user