From 4151883cb2ea00dac33ce083cc11e9e0d2b40bb4 Mon Sep 17 00:00:00 2001 From: Ryan Cao <70191398+ryanccn@users.noreply.github.com> Date: Thu, 29 Dec 2022 08:32:38 +0800 Subject: [PATCH 1/4] i18n: simplified chinese translations for model manager --- .../public/locales/modelmanager/zh_cn.json | 51 ++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/frontend/public/locales/modelmanager/zh_cn.json b/frontend/public/locales/modelmanager/zh_cn.json index 0967ef424b..c4c296703f 100644 --- a/frontend/public/locales/modelmanager/zh_cn.json +++ b/frontend/public/locales/modelmanager/zh_cn.json @@ -1 +1,50 @@ -{} +{ + "modelManager": "模型管理器", + "model": "模型", + "modelAdded": "模型已添加", + "modelUpdated": "模型已更新", + "modelEntryDeleted": "模型已删除", + "cannotUseSpaces": "不能使用空格", + "addNew": "添加", + "addNewModel": "添加新模型", + "addManually": "手动添加", + "manual": "手动", + "name": "名称", + "nameValidationMsg": "输入模型的名称", + "description": "描述", + "descriptionValidationMsg": "添加模型的描述", + "config": "配置", + "configValidationMsg": "模型配置文件的路径", + "modelLocation": "模型位置", + "modelLocationValidationMsg": "模型文件的路径", + "vaeLocation": "VAE 位置", + "vaeLocationValidationMsg": "VAE 文件的路径", + "width": "宽度", + "widthValidationMsg": "模型的默认宽度", + "height": "高度", + "heightValidationMsg": "模型的默认高度", + "addModel": "添加模型", + "updateModel": "更新模型", + "availableModels": "可用模型", + "search": "搜索", + "load": "加载", + "active": "活跃", + "notLoaded": "未加载", + "cached": "缓存", + "checkpointFolder": "模型检查点文件夹", + "clearCheckpointFolder": "清除模型检查点文件夹", + "findModels": "寻找模型", + "modelsFound": "找到的模型", + "selectFolder": "选择文件夹", + "selected": "已选择", + "selectAll": "选择所有", + "deselectAll": "取消选择所有", + "showExisting": "显示已存在", + "addSelected": "添加选择", + "modelExists": "模型已存在", + "delete": "删除", + "deleteModel": "删除模型", + "deleteConfig": "删除配置", + "deleteMsg1": "您确定要将这个模型从 InvokeAI 删除吗?", + "deleteMsg2": "这不会从磁盘中删除模型检查点文件。如果您愿意,可以重新添加它们。" +} From d456aea8f35c30110193760e37bde4c07adc2134 Mon Sep 17 00:00:00 2001 From: Yorzaren <55202832+Yorzaren@users.noreply.github.com> Date: Mon, 26 Dec 2022 16:35:51 -0600 Subject: [PATCH 2/4] Update WEBUIHOTKEYS.md Fixed display errors so it no longer show extra plus signs on the site --- docs/features/WEBUIHOTKEYS.md | 116 +++++++++++++++++----------------- 1 file changed, 58 insertions(+), 58 deletions(-) diff --git a/docs/features/WEBUIHOTKEYS.md b/docs/features/WEBUIHOTKEYS.md index 7f4e8093d7..ca0e6837a9 100644 --- a/docs/features/WEBUIHOTKEYS.md +++ b/docs/features/WEBUIHOTKEYS.md @@ -6,70 +6,70 @@ title: WebUI Hotkey List ## App Hotkeys -| Setting | Hotkey | -| -------------- | ------------------ | -| ++Ctrl+Enter++ | Invoke | -| ++Shift+X++ | Cancel | -| ++Alt+A++ | Focus Prompt | -| ++O++ | Toggle Options | -| ++Shift+O++ | Pin Options | -| ++Z++ | Toggle Viewer | -| ++G++ | Toggle Gallery | -| ++F++ | Maximize Workspace | -| ++1-5++ | Change Tabs | -| ++"`"++ | Toggle Console | +| Setting | Hotkey | +| ----------------- | ------------------ | +| ++"Ctrl\+Enter"++ | Invoke | +| ++"Shift\+X"++ | Cancel | +| ++"Alt\+A"++ | Focus Prompt | +| ++"O"++ | Toggle Options | +| ++"Shift\+O"++ | Pin Options | +| ++"Z"++ | Toggle Viewer | +| ++"G"++ | Toggle Gallery | +| ++"F"++ | Maximize Workspace | +| ++"1-5"++ | Change Tabs | +| ++"`"++ | Toggle Console | ## General Hotkeys -| Setting | Hotkey | -| ----------- | ---------------------- | -| ++P++ | Set Prompt | -| ++S++ | Set Seed | -| ++A++ | Set Parameters | -| ++Shift+R++ | Restore Faces | -| ++Shift+U++ | Upscale | -| ++I++ | Show Info | -| ++Shift+I++ | Send To Image To Image | -| ++Del++ | Delete Image | -| ++Esc++ | Close Panels | +| Setting | Hotkey | +| --------------- | ---------------------- | +| ++"P"++ | Set Prompt | +| ++"S"++ | Set Seed | +| ++"A"++ | Set Parameters | +| ++"Shift\+R"++ | Restore Faces | +| ++"Shift\+U"++ | Upscale | +| ++"I"++ | Show Info | +| ++"Shift\+I"++ | Send To Image To Image | +| ++"Del"++ | Delete Image | +| ++"Esc"++ | Close Panels | ## Gallery Hotkeys -| Setting | Hotkey | -| --------------- | --------------------------- | -| ++Arrow Left++ | Previous Image | -| ++Arrow Right++ | Next Image | -| ++Shift+G++ | Toggle Gallery Pin | -| ++Shift+Up++ | Increase Gallery Image Size | -| ++Shift+Down++ | Decrease Gallery Image Size | +| Setting | Hotkey | +| ------------------ | --------------------------- | +| ++"Arrow Left"++ | Previous Image | +| ++"Arrow Right"++ | Next Image | +| ++"Shift\+G"++ | Toggle Gallery Pin | +| ++"Shift\+Up"++ | Increase Gallery Image Size | +| ++"Shift\+Down"++ | Decrease Gallery Image Size | ## Unified Canvas Hotkeys -| Setting | Hotkey | -| ------------------------- | ---------------------- | -| ++B++ | Select Brush | -| ++E++ | Select Eraser | -| ++[++ | Decrease Brush Size | -| ++]++ | Increase Brush Size | -| ++Shift+[++ | Decrease Brush Opacity | -| ++Shift+]++ | Increase Brush Opacity | -| ++V++ | Move Tool | -| ++Shift+F++ | Fill Bounding Box | -| ++Delete/Backspace++ | Erase Bounding Box | -| ++C++ | Select Color Picker | -| ++N++ | Toggle Snap | -| ++Hold Space++ | Quick Toggle Move | -| ++Q++ | Toggle Layer | -| ++Shift+C++ | Clear Mask | -| ++H++ | Hide Mask | -| ++Shift+H++ | Show/Hide Bounding Box | -| ++Shift+M++ | Merge Visible | -| ++Shift+S++ | Save To Gallery | -| ++Ctrl+C++ | Copy To Clipboard | -| ++Shift+D++ | Download Image | -| ++Ctrl+Z++ | Undo | -| ++Ctrl+Y / Ctrl+Shift+Z++ | Redo | -| ++R++ | Reset View | -| ++Arrow Left++ | Previous Staging Image | -| ++Arrow Right++ | Next Staging Image | -| ++Enter++ | Accept Staging Image | +| Setting | Hotkey | +| ------------------------------ | ---------------------- | +| ++"B"++ | Select Brush | +| ++"E"++ | Select Eraser | +| ++"["++ | Decrease Brush Size | +| ++"]"++ | Increase Brush Size | +| ++"Shift\+["++ | Decrease Brush Opacity | +| ++"Shift\+]"++ | Increase Brush Opacity | +| ++"V"++ | Move Tool | +| ++"Shift\+F"++ | Fill Bounding Box | +| ++"Delete/Backspace"++ | Erase Bounding Box | +| ++"C"++ | Select Color Picker | +| ++"N"++ | Toggle Snap | +| ++"Hold Space"++ | Quick Toggle Move | +| ++"Q"++ | Toggle Layer | +| ++"Shift\+C"++ | Clear Mask | +| ++"H"++ | Hide Mask | +| ++"Shift\+H"++ | Show/Hide Bounding Box | +| ++"Shift\+M"++ | Merge Visible | +| ++"Shift\+S"++ | Save To Gallery | +| ++"Ctrl\+C"++ | Copy To Clipboard | +| ++"Shift\+D"++ | Download Image | +| ++"Ctrl\+Z"++ | Undo | +| ++"Ctrl\+Y / Ctrl\+Shift\+Z"++ | Redo | +| ++"R"++ | Reset View | +| ++"Arrow Left"++ | Previous Staging Image | +| ++"Arrow Right"++ | Next Staging Image | +| ++"Enter"++ | Accept Staging Image | From 4cc60669c1a8e7d793d48183bb5b6352f662d16e Mon Sep 17 00:00:00 2001 From: pejotr <3056813+prvdph@users.noreply.github.com> Date: Thu, 29 Dec 2022 09:19:57 +0100 Subject: [PATCH 3/4] [WebUI] Localize tooltips (#2136) * [WebUI]: Localize tooltips * fix: typo in seamCorrection translation * [WebUI]: Localize tooltips * fix: typo in seamCorrection translation * Add Missing Language Placeholders for Tooltip Localization * Fix UI displacement in RU localization for options * Fix double options during merge. * Fix tkinter lefover Co-authored-by: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com> --- backend/invoke_ai_web_server.py | 1 - frontend/public/locales/options/ru.json | 2 +- frontend/public/locales/settings/pl.json | 2 +- frontend/public/locales/tooltip/de.json | 1 + frontend/public/locales/tooltip/en-US.json | 15 +++ frontend/public/locales/tooltip/en.json | 15 +++ frontend/public/locales/tooltip/it.json | 1 + frontend/public/locales/tooltip/pl.json | 15 +++ frontend/public/locales/tooltip/pt_br.json | 1 + frontend/public/locales/tooltip/ru.json | 1 + frontend/src/app/features.ts | 126 ++++++++++-------- .../src/common/components/GuidePopover.tsx | 4 +- frontend/src/i18.d.ts | 2 + frontend/src/i18n.ts | 7 +- 14 files changed, 129 insertions(+), 64 deletions(-) create mode 100644 frontend/public/locales/tooltip/de.json create mode 100644 frontend/public/locales/tooltip/en-US.json create mode 100644 frontend/public/locales/tooltip/en.json create mode 100644 frontend/public/locales/tooltip/it.json create mode 100644 frontend/public/locales/tooltip/pl.json create mode 100644 frontend/public/locales/tooltip/pt_br.json create mode 100644 frontend/public/locales/tooltip/ru.json diff --git a/backend/invoke_ai_web_server.py b/backend/invoke_ai_web_server.py index f9a65a914f..0f05dbe0ea 100644 --- a/backend/invoke_ai_web_server.py +++ b/backend/invoke_ai_web_server.py @@ -17,7 +17,6 @@ from PIL import Image, ImageOps from PIL.Image import Image as ImageType from uuid import uuid4 from threading import Event -from tkinter import filedialog from ldm.generate import Generate from ldm.invoke.args import Args, APP_ID, APP_VERSION, calculate_init_img_hash diff --git a/frontend/public/locales/options/ru.json b/frontend/public/locales/options/ru.json index afd0bdbd9b..02ea25f929 100644 --- a/frontend/public/locales/options/ru.json +++ b/frontend/public/locales/options/ru.json @@ -5,7 +5,7 @@ "width": "Ширина", "height": "Высота", "sampler": "Семплер", - "seed": "Сид (Seed)", + "seed": "Сид", "randomizeSeed": "Случайный сид", "shuffle": "Обновить", "noiseThreshold": "Порог шума", diff --git a/frontend/public/locales/settings/pl.json b/frontend/public/locales/settings/pl.json index b7846fde2e..1fb901c30c 100644 --- a/frontend/public/locales/settings/pl.json +++ b/frontend/public/locales/settings/pl.json @@ -4,7 +4,7 @@ "saveSteps": "Zapisuj obrazy co X kroków", "confirmOnDelete": "Potwierdzaj usuwanie", "displayHelpIcons": "Wyświetlaj ikony pomocy", - "useCanvasBeta": "Nowego układ trybu uniwersalnego", + "useCanvasBeta": "Nowy układ trybu uniwersalnego", "enableImageDebugging": "Włącz debugowanie obrazu", "resetWebUI": "Zresetuj interfejs", "resetWebUIDesc1": "Resetowanie interfejsu wyczyści jedynie dane i ustawienia zapisane w pamięci przeglądarki. Nie usunie żadnych obrazów z dysku.", diff --git a/frontend/public/locales/tooltip/de.json b/frontend/public/locales/tooltip/de.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/frontend/public/locales/tooltip/de.json @@ -0,0 +1 @@ +{} diff --git a/frontend/public/locales/tooltip/en-US.json b/frontend/public/locales/tooltip/en-US.json new file mode 100644 index 0000000000..1d03f54b7f --- /dev/null +++ b/frontend/public/locales/tooltip/en-US.json @@ -0,0 +1,15 @@ +{ + "feature": { + "prompt": "This field will take all prompt text, including both content and stylistic terms. While weights can be included in the prompt, standard CLI Commands/parameters will not work.", + "gallery": "As new invocations are generated, files from the output directory will be displayed here. Generations have additional options to configure new generations.", + "other": "These options will enable alternative processing modes for Invoke. Seamless tiling will work to generate repeating patterns in the output. High Resolution Optimization performs a two-step generation cycle, and should be used at higher resolutions when you desire a more coherent image/composition.", + "seed": "Seed values provide an initial set of noise which guide the denoising process, and can be randomized or populated with a seed from a previous invocation. The Threshold feature can be used to mitigate undesirable outcomes at higher CFG values (try between 0-10), and Perlin can be used to add Perlin noise into the denoising process - Both serve to add variation to your outputs.", + "variations": "Try a variation with an amount of between 0 and 1 to change the output image for the set seed - Interesting variations on the seed are found between 0.1 and 0.3.", + "upscale": "Using ESRGAN you can increase the output resolution without requiring a higher width/height in the initial generation.", + "faceCorrection": "Using GFPGAN or Codeformer, Face Correction will attempt to identify faces in outputs, and correct any defects/abnormalities. Higher strength values will apply a stronger corrective pressure on outputs, resulting in more appealing faces. With Codeformer, a higher fidelity will attempt to preserve the original image, at the expense of face correction strength.", + "imageToImage": "Image to Image allows the upload of an initial image, which InvokeAI will use to guide the generation process, along with a prompt. A lower value for this setting will more closely resemble the original image. Values between 0-1 are accepted, and a range of .25-.75 is recommended.", + "boundingBox": "The bounding box is analogous to the Width and Height settings for Text to Image or Image to Image. Only the area in the box will be processed.", + "seamCorrection": "Control the handling of visible seams which may occur when a generated image is pasted back onto the canvas.", + "infillAndScaling": "Manage infill methods (used on masked or erased areas of the canvas) and scaling (useful for small bounding box sizes)." + } +} diff --git a/frontend/public/locales/tooltip/en.json b/frontend/public/locales/tooltip/en.json new file mode 100644 index 0000000000..1d03f54b7f --- /dev/null +++ b/frontend/public/locales/tooltip/en.json @@ -0,0 +1,15 @@ +{ + "feature": { + "prompt": "This field will take all prompt text, including both content and stylistic terms. While weights can be included in the prompt, standard CLI Commands/parameters will not work.", + "gallery": "As new invocations are generated, files from the output directory will be displayed here. Generations have additional options to configure new generations.", + "other": "These options will enable alternative processing modes for Invoke. Seamless tiling will work to generate repeating patterns in the output. High Resolution Optimization performs a two-step generation cycle, and should be used at higher resolutions when you desire a more coherent image/composition.", + "seed": "Seed values provide an initial set of noise which guide the denoising process, and can be randomized or populated with a seed from a previous invocation. The Threshold feature can be used to mitigate undesirable outcomes at higher CFG values (try between 0-10), and Perlin can be used to add Perlin noise into the denoising process - Both serve to add variation to your outputs.", + "variations": "Try a variation with an amount of between 0 and 1 to change the output image for the set seed - Interesting variations on the seed are found between 0.1 and 0.3.", + "upscale": "Using ESRGAN you can increase the output resolution without requiring a higher width/height in the initial generation.", + "faceCorrection": "Using GFPGAN or Codeformer, Face Correction will attempt to identify faces in outputs, and correct any defects/abnormalities. Higher strength values will apply a stronger corrective pressure on outputs, resulting in more appealing faces. With Codeformer, a higher fidelity will attempt to preserve the original image, at the expense of face correction strength.", + "imageToImage": "Image to Image allows the upload of an initial image, which InvokeAI will use to guide the generation process, along with a prompt. A lower value for this setting will more closely resemble the original image. Values between 0-1 are accepted, and a range of .25-.75 is recommended.", + "boundingBox": "The bounding box is analogous to the Width and Height settings for Text to Image or Image to Image. Only the area in the box will be processed.", + "seamCorrection": "Control the handling of visible seams which may occur when a generated image is pasted back onto the canvas.", + "infillAndScaling": "Manage infill methods (used on masked or erased areas of the canvas) and scaling (useful for small bounding box sizes)." + } +} diff --git a/frontend/public/locales/tooltip/it.json b/frontend/public/locales/tooltip/it.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/frontend/public/locales/tooltip/it.json @@ -0,0 +1 @@ +{} diff --git a/frontend/public/locales/tooltip/pl.json b/frontend/public/locales/tooltip/pl.json new file mode 100644 index 0000000000..be473bfb84 --- /dev/null +++ b/frontend/public/locales/tooltip/pl.json @@ -0,0 +1,15 @@ +{ + "feature": { + "prompt": "To pole musi zawierać cały tekst sugestii, w tym zarówno opis oczekiwanej zawartości, jak i terminy stylistyczne. Chociaż wagi mogą być zawarte w sugestiach, inne parametry znane z linii poleceń nie będą działać.", + "gallery": "W miarę generowania nowych wywołań w tym miejscu będą wyświetlane pliki z katalogu wyjściowego. Obrazy mają dodatkowo opcje konfiguracji nowych wywołań.", + "other": "Opcje umożliwią alternatywne tryby przetwarzania. Płynne scalanie będzie pomocne przy generowaniu powtarzających się wzorów. Optymalizacja wysokiej rozdzielczości wykonuje dwuetapowy cykl generowania i powinna być używana przy wyższych rozdzielczościach, gdy potrzebny jest bardziej spójny obraz/kompozycja.", + "seed": "Inicjator określa początkowy zestaw szumów, który kieruje procesem odszumiania i może być losowy lub pobrany z poprzedniego wywołania. Funkcja \"Poziom szumu\" może być użyta do złagodzenia saturacji przy wyższych wartościach CFG (spróbuj między 0-10), a Perlin może być użyty w celu dodania wariacji do twoich wyników.", + "variations": "Poziom zróżnicowania przyjmuje wartości od 0 do 1 i pozwala zmienić obraz wyjściowy dla ustawionego inicjatora. Interesujące wyniki uzyskuje się zwykle między 0,1 a 0,3.", + "upscale": "Korzystając z ESRGAN, możesz zwiększyć rozdzielczość obrazu wyjściowego bez konieczności zwiększania szerokości/wysokości w ustawieniach początkowych.", + "faceCorrection": "Poprawianie twarzy próbuje identyfikować twarze na obrazie wyjściowym i korygować wszelkie defekty/nieprawidłowości. W GFPGAN im większa siła, tym mocniejszy efekt. W metodzie Codeformer wyższa wartość oznacza bardziej wierne odtworzenie oryginalnej twarzy, nawet kosztem siły korekcji.", + "imageToImage": "Tryb \"Obraz na obraz\" pozwala na załadowanie obrazu wzorca, który obok wprowadzonych sugestii zostanie użyty porzez InvokeAI do wygenerowania nowego obrazu. Niższa wartość tego ustawienia będzie bardziej przypominać oryginalny obraz. Akceptowane są wartości od 0 do 1, a zalecany jest zakres od 0,25 do 0,75.", + "boundingBox": "Zaznaczony obszar odpowiada ustawieniom wysokości i szerokości w trybach Tekst na obraz i Obraz na obraz. Jedynie piksele znajdujące się w obszarze zaznaczenia zostaną uwzględnione podczas wywoływania nowego obrazu.", + "seamCorrection": "Opcje wpływające na poziom widoczności szwów, które mogą wystąpić, gdy wygenerowany obraz jest ponownie wklejany na płótno.", + "infillAndScaling": "Zarządzaj metodami wypełniania (używanymi na zamaskowanych lub wymazanych obszarach płótna) i skalowaniem (przydatne w przypadku zaznaczonego obszaru o b. małych rozmiarach)." + } +} diff --git a/frontend/public/locales/tooltip/pt_br.json b/frontend/public/locales/tooltip/pt_br.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/frontend/public/locales/tooltip/pt_br.json @@ -0,0 +1 @@ +{} diff --git a/frontend/public/locales/tooltip/ru.json b/frontend/public/locales/tooltip/ru.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/frontend/public/locales/tooltip/ru.json @@ -0,0 +1 @@ +{} diff --git a/frontend/src/app/features.ts b/frontend/src/app/features.ts index 0480e443fe..b4ed89f22e 100644 --- a/frontend/src/app/features.ts +++ b/frontend/src/app/features.ts @@ -1,3 +1,6 @@ +import { useMemo } from 'react'; +import { useTranslation } from 'react-i18next'; + type FeatureHelpInfo = { text: string; href: string; @@ -21,60 +24,71 @@ export enum Feature { * * To-do: href & GuideImages are placeholders, and are not currently utilized, but will be updated (along with the tooltip UI) as feature and UI develop and we get a better idea on where things "forever homes" will be . */ -export const FEATURES: Record = { - [Feature.PROMPT]: { - text: 'This field will take all prompt text, including both content and stylistic terms. While weights can be included in the prompt, standard CLI Commands/parameters will not work.', - href: 'link/to/docs/feature3.html', - guideImage: 'asset/path.gif', - }, - [Feature.GALLERY]: { - text: 'As new invocations are generated, files from the output directory will be displayed here. Generations have additional options to configure new generations.', - href: 'link/to/docs/feature3.html', - guideImage: 'asset/path.gif', - }, - [Feature.OTHER]: { - text: 'These options will enable alternative processing modes for Invoke. Seamless tiling will work to generate repeating patterns in the output. High Resolution Optimization performs a two-step generation cycle, and should be used at higher resolutions when you desire a more coherent image/composition. ', - href: 'link/to/docs/feature3.html', - guideImage: 'asset/path.gif', - }, - [Feature.SEED]: { - text: 'Seed values provide an initial set of noise which guide the denoising process, and can be randomized or populated with a seed from a previous invocation. The Threshold feature can be used to mitigate undesirable outcomes at higher CFG values (try between 0-10), and Perlin can be used to add Perlin noise into the denoising process - Both serve to add variation to your outputs. ', - href: 'link/to/docs/feature3.html', - guideImage: 'asset/path.gif', - }, - [Feature.VARIATIONS]: { - text: 'Try a variation with an amount of between 0 and 1 to change the output image for the set seed - Interesting variations on the seed are found between 0.1 and 0.3.', - href: 'link/to/docs/feature3.html', - guideImage: 'asset/path.gif', - }, - [Feature.UPSCALE]: { - text: 'Using ESRGAN you can increase the output resolution without requiring a higher width/height in the initial generation.', - href: 'link/to/docs/feature1.html', - guideImage: 'asset/path.gif', - }, - [Feature.FACE_CORRECTION]: { - text: 'Using GFPGAN or Codeformer, Face Correction will attempt to identify faces in outputs, and correct any defects/abnormalities. Higher strength values will apply a stronger corrective pressure on outputs, resulting in more appealing faces. With Codeformer, a higher fidelity will attempt to preserve the original image, at the expense of face correction strength.', - href: 'link/to/docs/feature3.html', - guideImage: 'asset/path.gif', - }, - [Feature.IMAGE_TO_IMAGE]: { - text: 'Image to Image allows the upload of an initial image, which InvokeAI will use to guide the generation process, along with a prompt. A lower value for this setting will more closely resemble the original image. Values between 0-1 are accepted, and a range of .25-.75 is recommended ', - href: 'link/to/docs/feature3.html', - guideImage: 'asset/path.gif', - }, - [Feature.BOUNDING_BOX]: { - text: 'The bounding box is analogous to the Width and Height settings for Text to Image or Image to Image. Only the area in the box will be processed.', - href: 'link/to/docs/feature3.html', - guideImage: 'asset/path.gif', - }, - [Feature.SEAM_CORRECTION]: { - text: 'Control the handling of visible seams which may occur when a generated image is pasted back onto the canvas.', - href: 'link/to/docs/feature3.html', - guideImage: 'asset/path.gif', - }, - [Feature.INFILL_AND_SCALING]: { - text: 'Manage infill methods (used on masked or erased areas of the canvas) and scaling (useful for small bounding box sizes).', - href: 'link/to/docs/feature3.html', - guideImage: 'asset/path.gif', - }, +const useFeatures = (): Record => { + const { t } = useTranslation(); + return useMemo( + () => ({ + [Feature.PROMPT]: { + text: t('tooltip:feature.prompt'), + href: 'link/to/docs/feature3.html', + guideImage: 'asset/path.gif', + }, + [Feature.GALLERY]: { + text: t('tooltip:feature.gallery'), + href: 'link/to/docs/feature3.html', + guideImage: 'asset/path.gif', + }, + [Feature.OTHER]: { + text: t('tooltip:feature.other'), + href: 'link/to/docs/feature3.html', + guideImage: 'asset/path.gif', + }, + [Feature.SEED]: { + text: t('tooltip:feature.seed'), + href: 'link/to/docs/feature3.html', + guideImage: 'asset/path.gif', + }, + [Feature.VARIATIONS]: { + text: t('tooltip:feature.variations'), + href: 'link/to/docs/feature3.html', + guideImage: 'asset/path.gif', + }, + [Feature.UPSCALE]: { + text: t('tooltip:feature.upscale'), + href: 'link/to/docs/feature1.html', + guideImage: 'asset/path.gif', + }, + [Feature.FACE_CORRECTION]: { + text: t('tooltip:feature.faceCorrection'), + href: 'link/to/docs/feature3.html', + guideImage: 'asset/path.gif', + }, + [Feature.IMAGE_TO_IMAGE]: { + text: t('tooltip:feature.imageToImage'), + href: 'link/to/docs/feature3.html', + guideImage: 'asset/path.gif', + }, + [Feature.BOUNDING_BOX]: { + text: t('tooltip:feature.boundingBox'), + href: 'link/to/docs/feature3.html', + guideImage: 'asset/path.gif', + }, + [Feature.SEAM_CORRECTION]: { + text: t('tooltip:feature.seamCorrection'), + href: 'link/to/docs/feature3.html', + guideImage: 'asset/path.gif', + }, + [Feature.INFILL_AND_SCALING]: { + text: t('tooltip:feature.infillAndScaling'), + href: 'link/to/docs/feature3.html', + guideImage: 'asset/path.gif', + }, + }), + [t] + ); +}; + +export const useFeatureHelpInfo = (feature: Feature): FeatureHelpInfo => { + const features = useFeatures(); + return features[feature]; }; diff --git a/frontend/src/common/components/GuidePopover.tsx b/frontend/src/common/components/GuidePopover.tsx index 61f076976c..5de8db0b9a 100644 --- a/frontend/src/common/components/GuidePopover.tsx +++ b/frontend/src/common/components/GuidePopover.tsx @@ -10,7 +10,7 @@ import { useAppSelector } from 'app/storeHooks'; import { RootState } from 'app/store'; import { createSelector } from '@reduxjs/toolkit'; import { ReactElement } from 'react'; -import { Feature, FEATURES } from 'app/features'; +import { Feature, useFeatureHelpInfo } from 'app/features'; type GuideProps = { children: ReactElement; @@ -24,7 +24,7 @@ const systemSelector = createSelector( const GuidePopover = ({ children, feature }: GuideProps) => { const shouldDisplayGuides = useAppSelector(systemSelector); - const { text } = FEATURES[feature]; + const { text } = useFeatureHelpInfo(feature); if (!shouldDisplayGuides) return null; diff --git a/frontend/src/i18.d.ts b/frontend/src/i18.d.ts index 887d6abcc1..cc224b962a 100644 --- a/frontend/src/i18.d.ts +++ b/frontend/src/i18.d.ts @@ -8,6 +8,7 @@ import gallery from '../public/locales/gallery/en.json'; import toast from '../public/locales/toast/en.json'; import hotkeys from '../public/locales/hotkeys/en.json'; import settings from '../public/locales/settings/en.json'; +import tooltip from '../public/locales/tooltip/en.json'; import modelmanager from '../public/locales/modelmanager/en.json'; declare module 'i18next' { @@ -24,6 +25,7 @@ declare module 'i18next' { toast: typeof toast; hotkeys: typeof hotkeys; settings: typeof settings; + tooltip: typeof tooltip; modelmanager: typeof modelmanager; }; // Never Return Null diff --git a/frontend/src/i18n.ts b/frontend/src/i18n.ts index 682cd60286..bb9a7b6e48 100644 --- a/frontend/src/i18n.ts +++ b/frontend/src/i18n.ts @@ -12,13 +12,14 @@ i18n debug: false, ns: [ 'common', - 'options', - 'unifiedcanvas', 'gallery', - 'toast', 'hotkeys', + 'options', 'settings', 'modelmanager', + 'toast', + 'tooltip', + 'unifiedcanvas', ], backend: { loadPath: '/locales/{{ns}}/{{lng}}.json', From 9d103ef03045e5e1db0c012e1368b8eb5619a58b Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Thu, 29 Dec 2022 09:00:50 -0500 Subject: [PATCH 4/4] attempt to address memory issues when loading ckpt models (#2128) - A couple of users have reported that switching back and forth between ckpt models is causing a "GPU out of memory" crash. Traceback suggests there is actually a CPU RAM issue. - This speculative test simply performs a round of garbage collection before the point where the crash occurs. --- ldm/invoke/model_cache.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ldm/invoke/model_cache.py b/ldm/invoke/model_cache.py index 623160e67d..e09e5323fa 100644 --- a/ldm/invoke/model_cache.py +++ b/ldm/invoke/model_cache.py @@ -242,6 +242,9 @@ class ModelCache(object): # merged models from auto11 merge board are flat for some reason if 'state_dict' in sd: sd = sd['state_dict'] + + print(f' | Forcing garbage collection prior to loading new model') + gc.collect() model = instantiate_from_config(omega_config.model) model.load_state_dict(sd, strict=False)