Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.
TypeScript ai-artartificial-intelligencegenerative-artimage-generationimg2imginpaintinglatent-diffusionlinuxmacosoutpaintingstable-diffusiontxt2imgwindows
fix(ui): adversarial-review findings for components-only H3 installs
Lincoln Stein81f163fa4401
diff --git a/invokeai/backend/model_manager/configs/main.py b/invokeai/backend/model_manager/configs/main.pyindex 7ef1be7749..825a8ef7ed 100644--- a/invokeai/backend/model_manager/configs/main.py+++ b/invokeai/backend/model_manager/configs/main.py@@ -1529,7 +1529,7 @@ class Main_Diffusers_MiniMaxH3_Config(Diffusers_Config_Base, Main_Config_Base, Cif components_only is None:transformer_dir = mod.path / "transformer"components_only = not any(- any(transformer_dir.glob(pattern)) for pattern in ("*.safetensors", "*.bin", "*.pt", "*.ckpt")+ any(transformer_dir.glob(pattern)) for pattern in ("*.safetensors", "*.bin", "*.pth", "*.pt", "*.ckpt"))return cls(diff --git a/invokeai/backend/model_manager/load/model_loaders/minimax_h3.py b/invokeai/backend/model_manager/load/model_loaders/minimax_h3.pyindex 5ce263b826..da38598519 100644--- a/invokeai/backend/model_manager/load/model_loaders/minimax_h3.py+++ b/invokeai/backend/model_manager/load/model_loaders/minimax_h3.py@@ -53,7 +53,7 @@ def _raise_if_no_weight_shards(submodel_path: Path, submodel_label: str) -> Noneconfig JSONs, so a generic from_pretrained() here would otherwise die on a crypticmissing-shard error deep inside diffusers/transformers."""- if not any(any(submodel_path.glob(pattern)) for pattern in ("*.safetensors", "*.bin", "*.pt", "*.ckpt")):+ if not any(any(submodel_path.glob(pattern)) for pattern in ("*.safetensors", "*.bin", "*.pth", "*.pt", "*.ckpt")):raise ValueError(f"This MiniMax H3 model folder has no {submodel_label} weights - it is a components-only "f"(slim) install. In the MiniMax H3 Model Loader, select a single-file {submodel_label} "diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/modelsLoaded.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/modelsLoaded.tsindex f92317a150..058097a225 100644--- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/modelsLoaded.ts+++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/modelsLoaded.ts@@ -7,6 +7,8 @@ import {fluxVAESelected,krea2Qwen3VlEncoderModelSelected,krea2VaeModelSelected,+ minimaxH3TextEncoderModelSelected,+ minimaxH3TransformerModelSelected,modelChanged,refinerModelChanged,t5EncoderModelSelected,@@ -84,6 +86,7 @@ export const addModelsLoadedListener = (startAppListening: AppStartListening) =>handleMainModels(models, state, dispatch, log);handleKrea2Components(models, state, dispatch, log);+ handleMiniMaxH3Overrides(models, state, dispatch, log);handleRefinerModels(models, state, dispatch, log);handleVAEModels(models, state, dispatch, log);handleLoRAModels(models, state, dispatch, log);@@ -125,6 +128,19 @@ export const handleKrea2Components: ModelHandler = (models, state, dispatch) =>}};+export const handleMiniMaxH3Overrides: ModelHandler = (models, state, dispatch) => {+ // The MiniMax H3 single-file transformer / text-encoder overrides are optional (null = use the+ // main folder's submodels), so never auto-select - but a selection whose model was uninstalled+ // must be cleared, or it passes the components-only readiness gate and fails at invoke time.+ const { minimaxH3TransformerModel, minimaxH3TextEncoderModel } = state.params;+ if (minimaxH3TransformerModel && !models.some((m) => m.key === minimaxH3TransformerModel.key)) {+ dispatch(minimaxH3TransformerModelSelected(null));+ }+ if (minimaxH3TextEncoderModel && !models.some((m) => m.key === minimaxH3TextEncoderModel.key)) {+ dispatch(minimaxH3TextEncoderModelSelected(null));+ }+};+type ModelHandler = (models: AnyModelConfig[],state: RootState,diff --git a/invokeai/frontend/web/src/features/parameters/components/MainModel/mainModelPickerUtils.ts b/invokeai/frontend/web/src/features/parameters/components/MainModel/mainModelPickerUtils.tsindex 3c1d83f4bc..735dd6e65c 100644--- a/invokeai/frontend/web/src/features/parameters/components/MainModel/mainModelPickerUtils.ts+++ b/invokeai/frontend/web/src/features/parameters/components/MainModel/mainModelPickerUtils.ts@@ -12,3 +12,22 @@ export const isExternalModelUnsupportedForTab = (model: AnyModelConfigWithExternreturn false;};++/**+ * Some type=main configs are not selectable primary models: they fill a secondary slot in a+ * family's advanced section, and selecting them as the main model always fails at load time.+ * Every picker that offers main models must filter with this predicate.+ */+export const isSecondarySlotMainModelConfig = (c: AnyModelConfigWithExternal): boolean => {+ // Low-noise Wan GGUFs belong in the Transformer (Low Noise) slot of the Wan advanced section,+ // not as a primary main - filter them out so users can't accidentally wire them backwards.+ if (c.type === 'main' && c.base === 'wan' && c.format === 'gguf_quantized' && 'expert' in c && c.expert === 'low') {+ return true;+ }+ // MiniMax H3 single-file transformers belong in the Transformer (single file) slot of the+ // MiniMax H3 advanced section - they carry no text encoder or VAEs.+ if (c.type === 'main' && c.base === 'minimax-h3' && c.format === 'checkpoint') {+ return true;+ }+ return false;+};diff --git a/invokeai/frontend/web/src/features/settingsAccordions/components/GenerationSettingsAccordion/MainModelPicker.tsx b/invokeai/frontend/web/src/features/settingsAccordions/components/GenerationSettingsAccordion/MainModelPicker.tsxindex 57d7ded983..7baafd9851 100644--- a/invokeai/frontend/web/src/features/settingsAccordions/components/GenerationSettingsAccordion/MainModelPicker.tsx+++ b/invokeai/frontend/web/src/features/settingsAccordions/components/GenerationSettingsAccordion/MainModelPicker.tsx@@ -1,7 +1,10 @@import { Flex, FormLabel, Icon } from '@invoke-ai/ui-library';import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';import { InformationalPopover } from 'common/components/InformationalPopover/InformationalPopover';-import { isExternalModelUnsupportedForTab } from 'features/parameters/components/MainModel/mainModelPickerUtils';+import {+ isExternalModelUnsupportedForTab,+ isSecondarySlotMainModelConfig,+} from 'features/parameters/components/MainModel/mainModelPickerUtils';import { UseDefaultSettingsButton } from 'features/parameters/components/MainModel/UseDefaultSettingsButton';import { ModelPicker } from 'features/parameters/components/ModelPicker';import { modelSelected } from 'features/parameters/store/actions';@@ -18,28 +21,8 @@ export const MainModelPicker = memo(() => {const dispatch = useAppDispatch();const activeTab = useAppSelector(selectActiveTab);const [allModelConfigs] = useMainModels();- // Low-noise Wan GGUFs belong in the Transformer (Low Noise) slot of the- // Wan advanced section, not as a primary main. Filter them out of the main- // model dropdown so users can't accidentally wire them backwards.const modelConfigs = useMemo(- () =>- allModelConfigs.filter((c) => {- if (- c.type === 'main' &&- c.base === 'wan' &&- c.format === 'gguf_quantized' &&- 'expert' in c &&- c.expert === 'low'- ) {- return false;- }- // MiniMax H3 single-file transformers belong in the Transformer (single file) slot of- // the MiniMax H3 advanced section - they carry no text encoder or VAEs.- if (c.type === 'main' && c.base === 'minimax-h3' && c.format === 'checkpoint') {- return false;- }- return true;- }),+ () => allModelConfigs.filter((c) => !isSecondarySlotMainModelConfig(c)),[allModelConfigs]);const selectedModelConfig = useSelectedModelConfig();diff --git a/invokeai/frontend/web/src/features/ui/layouts/InitialStateMainModelPicker.tsx b/invokeai/frontend/web/src/features/ui/layouts/InitialStateMainModelPicker.tsxindex 5c5a304a30..e995e0ecd2 100644--- a/invokeai/frontend/web/src/features/ui/layouts/InitialStateMainModelPicker.tsx+++ b/invokeai/frontend/web/src/features/ui/layouts/InitialStateMainModelPicker.tsx@@ -1,7 +1,10 @@import { Flex, FormControl, FormLabel, Icon } from '@invoke-ai/ui-library';import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';import { InformationalPopover } from 'common/components/InformationalPopover/InformationalPopover';-import { isExternalModelUnsupportedForTab } from 'features/parameters/components/MainModel/mainModelPickerUtils';+import {+ isExternalModelUnsupportedForTab,+ isSecondarySlotMainModelConfig,+} from 'features/parameters/components/MainModel/mainModelPickerUtils';import { ModelPicker } from 'features/parameters/components/ModelPicker';import { modelSelected } from 'features/parameters/store/actions';import { selectActiveTab } from 'features/ui/store/uiSelectors';@@ -16,7 +19,11 @@ export const InitialStateMainModelPicker = memo(() => {const { t } = useTranslation();const dispatch = useAppDispatch();const activeTab = useAppSelector(selectActiveTab);- const [modelConfigs] = useMainModels();+ const [allModelConfigs] = useMainModels();+ const modelConfigs = useMemo(+ () => allModelConfigs.filter((c) => !isSecondarySlotMainModelConfig(c)),+ [allModelConfigs]+ );const selectedModelConfig = useSelectedModelConfig();const onChange = useCallback((modelConfig: AnyModelConfigWithExternal) => {