File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
invokeai/frontend/web/src/common/hooks Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -213,9 +213,13 @@ const createSelector = (templates: Templates) =>
213
213
if ( ! upscale . upscaleInitialImage ) {
214
214
reasons . push ( { content : i18n . t ( 'upscaling.missingUpscaleInitialImage' ) } ) ;
215
215
} else if ( config . maxUpscaleDimension ) {
216
- const upscaledPixels =
217
- upscale . upscaleInitialImage . width * upscale . scale * upscale . upscaleInitialImage . height * upscale . scale ;
218
- if ( upscaledPixels > config . maxUpscaleDimension ) {
216
+ const { width, height } = upscale . upscaleInitialImage ;
217
+ const { scale } = upscale ;
218
+
219
+ const maxPixels = config . maxUpscaleDimension ** 2 ;
220
+ const upscaledPixels = width * scale * height * scale ;
221
+
222
+ if ( upscaledPixels > maxPixels ) {
219
223
reasons . push ( { content : i18n . t ( 'upscaling.exceedsMaxSize' ) } ) ;
220
224
}
221
225
}
You can’t perform that action at this time.
0 commit comments