diff --git a/ui/index.html b/ui/index.html index 3cff9ebd..efbb82c4 100644 --- a/ui/index.html +++ b/ui/index.html @@ -383,6 +383,7 @@ const USE_CPU_KEY = "useCPU" const USE_FULL_PRECISION_KEY = "useFullPrecision" const USE_TURBO_MODE_KEY = "useTurboMode" const HEALTH_PING_INTERVAL = 5 // seconds +const MAX_INIT_IMAGE_DIMENSION = 768 const IMAGE_REGEX = new RegExp('data:image/[A-Za-z]+;base64') @@ -565,6 +566,15 @@ async function doMakeImage(reqBody) { let msg = '' if (res.detail !== undefined) { msg = res.detail + + if (msg.toLowerCase().includes('out of memory')) { + msg += `

+ Suggestions: +
+ 1. If you have set an initial image, please try reducing its dimension to ${MAX_INIT_IMAGE_DIMENSION}x${MAX_INIT_IMAGE_DIMENSION} or smaller.
+ 2. Try disabling the 'Turbo mode' under 'Advanced Settings'.
+ 3. Try generating a smaller image.
` + } } else { msg = res } @@ -659,8 +669,6 @@ async function doMakeImage(reqBody) { } function validateInput() { - const MAX_INIT_IMAGE_DIMENSION = 768 - let width = parseInt(widthField.value) let height = parseInt(heightField.value)