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:
parent
f7863e17ce
commit
c39fa75113
@ -11,11 +11,16 @@ const createIsTooLargeToUpscaleSelector = (imageDTO?: ImageDTO) =>
|
||||
const { maxUpscaleDimension } = config;
|
||||
|
||||
if (!maxUpscaleDimension || !upscaleModel || !imageDTO) {
|
||||
// When these are missing, another warning will be shown
|
||||
return false;
|
||||
}
|
||||
|
||||
const upscaledPixels = imageDTO.width * scale * imageDTO.height * scale;
|
||||
return upscaledPixels > maxUpscaleDimension * maxUpscaleDimension;
|
||||
const { width, height } = imageDTO;
|
||||
|
||||
const maxPixels = maxUpscaleDimension ** 2;
|
||||
const upscaledPixels = width * scale * height * scale;
|
||||
|
||||
return upscaledPixels > maxPixels;
|
||||
});
|
||||
|
||||
export const useIsTooLargeToUpscale = (imageDTO?: ImageDTO) => {
|
||||
|
Loading…
Reference in New Issue
Block a user