Skip to content

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.

Merge branch 'main' into refactor/invocations-by-architecture

Alexander Eichhorn36cede7ad487
diff --cc invokeai/app/api/routers/model_manager.py
index 60857d6bfe,713a26cc92..b29a92de64
--- a/invokeai/app/api/routers/model_manager.py
+++ b/invokeai/app/api/routers/model_manager.py
@@@ -30,10 -32,9 +32,10 @@@ from invokeai.app.services.model_record
ModelRecordOrderBy,
UnknownModelException,
)
- from invokeai.app.services.orphaned_models import OrphanedModelInfo
+ from invokeai.app.services.orphaned_models import CONVERSION_SCRATCH_DIRNAME, OrphanedModelInfo
from invokeai.app.services.shared.sqlite.sqlite_common import SQLiteDirection
from invokeai.app.util.suppress_output import SuppressOutput
+from invokeai.backend.architectures import ArchitectureCapabilities, architecture_capabilities
from invokeai.backend.model_manager.configs.external_api import ExternalApiModelConfig
from invokeai.backend.model_manager.configs.factory import AnyModelConfig, ModelConfigFactory
from invokeai.backend.model_manager.configs.main import (
@@@ -158,27 -229,6 +230,30 @@@ example_model_input =
##############################################################################
+@model_manager_router.get(
+ "/capabilities",
+ operation_id="list_architecture_capabilities",
+ responses={200: {"description": "What each model architecture supports"}},
+)
- async def list_architecture_capabilities(current_user: CurrentUserOrDefault) -> list[ArchitectureCapabilities]:
++def list_architecture_capabilities(current_user: CurrentUserOrDefault) -> list[ArchitectureCapabilities]:
+ """What each model architecture can generate, and which generation features it supports.
+
+ A static table, the same for every install and every user, derived from what the architectures
+ declare under `invokeai/backend/architectures/defs/`. Fetch it once and join it against model
+ records locally: look up `(base, variant)`, fall back to `(base, null)`.
+
+ Deliberately not a field on the model records themselves — it is the same for every model of an
+ architecture, and putting it there would add these fields to all 115 config schemas.
+
+ Authenticated like every other route here even though the response holds nothing user-specific:
+ the allowlist for public routes is short and deliberate, and this is not a reason to lengthen it.
++
++ Declared `def`, not `async def`: it awaits nothing, so FastAPI runs it in a threadpool instead of
++ on the event loop. See docs/contributing/blocking-work-in-api-routes.
+ """
+ return architecture_capabilities()
+
+
@model_manager_router.get(
"/",
operation_id="list_model_records",
diff --cc invokeai/backend/architectures/defs/minimax_h3.py
index 5cc5fa36ba,0000000000..e64a64ecb9
mode 100644,000000..100644
--- a/invokeai/backend/architectures/defs/minimax_h3.py
+++ b/invokeai/backend/architectures/defs/minimax_h3.py
@@@ -1,30 -1,0 +1,32 @@@
+"""What the minimax-h3 architecture declares."""
+
+from invokeai.backend.architectures.facets.conditioning import ConditioningFacet
+from invokeai.backend.architectures.facets.default_settings import DefaultSettingsFacet
+from invokeai.backend.architectures.facets.features import FeaturesFacet, NegativePrompt
+from invokeai.backend.architectures.facets.latent_space import MINIMAX_H3_24, LatentSpaceFacet
+from invokeai.backend.architectures.facets.modality import ModalityFacet
+from invokeai.backend.architectures.registry import register
+from invokeai.backend.model_manager.configs.default_settings import MainModelDefaultSettings
+from invokeai.backend.model_manager.taxonomy import BaseModelType
+from invokeai.backend.stable_diffusion.diffusion.conditioning_data import MiniMaxH3ConditioningInfo
+
+register(
+ BaseModelType.MiniMaxH3,
+ LatentSpaceFacet(MINIMAX_H3_24),
+ ConditioningFacet(MiniMaxH3ConditioningInfo),
+ # H3 is guidance-distilled (cfg_scale 1.0 means no guidance) and was released for a fixed
+ # 768px short edge; 1344x768 is its native 16:9 canvas. Dimensions must be multiples of 32.
+ DefaultSettingsFacet({None: MainModelDefaultSettings(steps=50, cfg_scale=1.0, width=1344, height=768)}),
+ # Video first, with a single-frame still-image path. No img2img, inpaint or outpaint.
- ModalityFacet(frozenset({"txt2img", "t2v", "i2v"}), metadata_slug="minimax_h3"),
++ # lf2v / flf2v / extend_video are H3's keyframe-conditioned video modes: continue from a last
++ # frame, interpolate between a first and last frame, and extend an existing clip.
++ ModalityFacet(frozenset({"txt2img", "t2v", "i2v", "lf2v", "flf2v", "extend_video"}), metadata_slug="minimax_h3"),
+ # minimax_h3_denoise is explicit: 'guidance-distilled: no negative prompt, no CFG, one
+ # forward per step'. It steps video and audio down two hardcoded flow schedules, so
+ # there is no scheduler to choose either.
+ FeaturesFacet(
+ negative_prompt=NegativePrompt(visible=False, usage="never"),
+ dimension_grid=32,
+ guidance_label="Guidance",
+ ),
+)
diff --cc invokeai/backend/architectures/facets/modality.py
index ae76dd0d01,0000000000..28836a80f6
mode 100644,000000..100644
--- a/invokeai/backend/architectures/facets/modality.py
+++ b/invokeai/backend/architectures/facets/modality.py
@@@ -1,59 -1,0 +1,63 @@@
+"""What an architecture can generate, and what its modes are called in image metadata.
+
+Two separate facts that happen to travel together. The first is a capability the UI needs — an
+architecture that cannot inpaint must not offer the tool. The second is a naming convention: every
+generated image records a mode string like `flux_inpaint` in its metadata, and those strings are
+persisted in user galleries and workflow files. They cannot be changed, only declared.
+
+The slug is not the base value. It is `z_image` where the enum says `z-image`, `krea2` where the enum
+says `krea-2`, `ideogram4`, `sd3`, `ernie_image` — and SD 1.x and 2.x use no prefix at all, emitting
+a bare `txt2img`. Deriving it from `BaseModelType` would be wrong in seven of fourteen cases, so it
+is declared, and a test reconstructs `GENERATION_MODES` from the declarations to prove the set is
+complete and unchanged.
+"""
+
+from dataclasses import dataclass
+from typing import ClassVar, Literal
+
+from invokeai.backend.architectures.facet import Facet
+from invokeai.backend.architectures.registry import generative_bases, get
+
- GenerationModeKind = Literal["txt2img", "img2img", "inpaint", "outpaint", "t2v", "i2v"]
- """The kinds of generation a mode string names. `t2v`/`i2v` produce video, the rest images."""
++GenerationModeKind = Literal["txt2img", "img2img", "inpaint", "outpaint", "t2v", "i2v", "lf2v", "flf2v", "extend_video"]
++"""The kinds of generation a mode string names.
++
++`t2v`/`i2v` produce video, as do the three MiniMax H3 conditioning variants: `lf2v` (last frame to
++video), `flf2v` (first and last frame to video) and `extend_video` (continue an existing clip). The
++rest produce images."""
+
+
+@dataclass(frozen=True)
+class ModalityFacet(Facet):
+ """What this architecture can produce."""
+
+ REQUIRED: ClassVar[bool] = True
+
+ modes: frozenset[GenerationModeKind]
+ """Empty is meaningful: the SDXL refiner generates nothing on its own."""
+
+ metadata_slug: str | None = None
+ """The prefix its mode strings carry in image metadata. `None` means unprefixed.
+
+ Persisted in every image a user has ever generated. Changing one does not migrate anything — it
+ orphans the old value.
+ """
+
+ def metadata_modes(self) -> frozenset[str]:
+ """The mode strings this architecture writes into image metadata."""
+ prefix = f"{self.metadata_slug}_" if self.metadata_slug else ""
+ return frozenset(f"{prefix}{mode}" for mode in self.modes)
+
+
+def generation_modes() -> frozenset[str]:
+ """Every mode string any architecture can write.
+
+ Compared against `GENERATION_MODES` in a test rather than used to define it: that literal is a
+ type, and it is what pydantic validates metadata against.
+ """
+ return frozenset(
+ mode
+ for base in generative_bases()
+ for facet in [get(base, ModalityFacet)]
+ if facet is not None
+ for mode in facet.metadata_modes()
+ )
diff --cc invokeai/backend/model_manager/starter_models/__init__.py
index d9ea1c2737,0000000000..22f114abf1
mode 100644,000000..100644
--- a/invokeai/backend/model_manager/starter_models/__init__.py
+++ b/invokeai/backend/model_manager/starter_models/__init__.py
@@@ -1,1051 -1,0 +1,1058 @@@
+"""The starter model catalogue.
+
+`STARTER_MODELS` is a curated order, not a derived one: it is what the install dialog shows, in
+the sequence someone decided on. It stays written out here rather than assembled from the
+per-architecture modules, because assembling it would lose that sequence and nothing could
+reconstruct it.
+
+Every name is re-exported, so `from ...starter_models import <anything>` keeps working.
+"""
+
+from invokeai.backend.model_manager.starter_models.anima import (
+ anima_base as anima_base,
+)
+from invokeai.backend.model_manager.starter_models.anima import (
+ anima_lllite_depth_preview3 as anima_lllite_depth_preview3,
+)
+from invokeai.backend.model_manager.starter_models.anima import (
+ anima_lllite_inpainting as anima_lllite_inpainting,
+)
+from invokeai.backend.model_manager.starter_models.anima import (
+ anima_lllite_lineart_preview3 as anima_lllite_lineart_preview3,
+)
+from invokeai.backend.model_manager.starter_models.anima import (
+ anima_lllite_pose_preview3 as anima_lllite_pose_preview3,
+)
+from invokeai.backend.model_manager.starter_models.anima import (
+ anima_lllite_scribble_preview3 as anima_lllite_scribble_preview3,
+)
+from invokeai.backend.model_manager.starter_models.anima import (
+ anima_lllite_sketch as anima_lllite_sketch,
+)
+from invokeai.backend.model_manager.starter_models.anima import (
+ anima_vae as anima_vae,
+)
+from invokeai.backend.model_manager.starter_models.cogview4 import (
+ cogview4 as cogview4,
+)
+from invokeai.backend.model_manager.starter_models.common import (
+ anima_qwen3_encoder as anima_qwen3_encoder,
+)
+from invokeai.backend.model_manager.starter_models.common import (
+ animesharp_v4_rcan as animesharp_v4_rcan,
+)
+from invokeai.backend.model_manager.starter_models.common import (
+ clip_l_encoder as clip_l_encoder,
+)
+from invokeai.backend.model_manager.starter_models.common import (
+ clip_vit_l_image_encoder as clip_vit_l_image_encoder,
+)
+from invokeai.backend.model_manager.starter_models.common import (
+ esrgan_srx4 as esrgan_srx4,
+)
+from invokeai.backend.model_manager.starter_models.common import (
+ flux2_dev_comfy_mistral_bf16 as flux2_dev_comfy_mistral_bf16,
+)
+from invokeai.backend.model_manager.starter_models.common import (
+ flux2_dev_comfy_mistral_fp4 as flux2_dev_comfy_mistral_fp4,
+)
+from invokeai.backend.model_manager.starter_models.common import (
+ flux2_dev_comfy_mistral_fp8 as flux2_dev_comfy_mistral_fp8,
+)
+from invokeai.backend.model_manager.starter_models.common import (
+ flux2_dev_cow_mistral_iq4_xs as flux2_dev_cow_mistral_iq4_xs,
+)
+from invokeai.backend.model_manager.starter_models.common import (
+ flux2_dev_cow_mistral_q4 as flux2_dev_cow_mistral_q4,
+)
+from invokeai.backend.model_manager.starter_models.common import (
+ flux2_dev_cow_mistral_q8 as flux2_dev_cow_mistral_q8,
+)
+from invokeai.backend.model_manager.starter_models.common import (
+ flux2_klein_qwen3_4b_encoder as flux2_klein_qwen3_4b_encoder,
+)
+from invokeai.backend.model_manager.starter_models.common import (
+ flux2_klein_qwen3_8b_encoder as flux2_klein_qwen3_8b_encoder,
+)
+from invokeai.backend.model_manager.starter_models.common import (
+ gemma2_2b_encoder as gemma2_2b_encoder,
+)
+from invokeai.backend.model_manager.starter_models.common import (
+ ip_adapter_sd_image_encoder as ip_adapter_sd_image_encoder,
+)
+from invokeai.backend.model_manager.starter_models.common import (
+ ip_adapter_sdxl_image_encoder as ip_adapter_sdxl_image_encoder,
+)
+from invokeai.backend.model_manager.starter_models.common import (
+ llava_onevision as llava_onevision,
+)
+from invokeai.backend.model_manager.starter_models.common import (
+ llava_onevision_7b as llava_onevision_7b,
+)
+from invokeai.backend.model_manager.starter_models.common import (
+ qwen2_5_1_5b_instruct as qwen2_5_1_5b_instruct,
+)
+from invokeai.backend.model_manager.starter_models.common import (
+ qwen2_5_3b_instruct as qwen2_5_3b_instruct,
+)
+from invokeai.backend.model_manager.starter_models.common import (
+ qwen3_vl_encoder_4b as qwen3_vl_encoder_4b,
+)
+from invokeai.backend.model_manager.starter_models.common import (
+ qwen_vl_encoder_diffusers as qwen_vl_encoder_diffusers,
+)
+from invokeai.backend.model_manager.starter_models.common import (
+ qwen_vl_encoder_fp8 as qwen_vl_encoder_fp8,
+)
+from invokeai.backend.model_manager.starter_models.common import (
+ realesrgan_x2 as realesrgan_x2,
+)
+from invokeai.backend.model_manager.starter_models.common import (
+ realesrgan_x4 as realesrgan_x4,
+)
+from invokeai.backend.model_manager.starter_models.common import (
+ siglip as siglip,
+)
+from invokeai.backend.model_manager.starter_models.common import (
+ smollm2_1_7b_instruct as smollm2_1_7b_instruct,
+)
+from invokeai.backend.model_manager.starter_models.common import (
+ swinir as swinir,
+)
+from invokeai.backend.model_manager.starter_models.common import (
+ t5_8b_quantized_encoder as t5_8b_quantized_encoder,
+)
+from invokeai.backend.model_manager.starter_models.common import (
+ t5_base_encoder as t5_base_encoder,
+)
+from invokeai.backend.model_manager.starter_models.common import (
+ t5_gguf_q3_k_s_encoder as t5_gguf_q3_k_s_encoder,
+)
+from invokeai.backend.model_manager.starter_models.common import (
+ t5_gguf_q6_k_encoder as t5_gguf_q6_k_encoder,
+)
+from invokeai.backend.model_manager.starter_models.common import (
+ wan_22_t5_encoder as wan_22_t5_encoder,
+)
+from invokeai.backend.model_manager.starter_models.common import (
+ z_image_qwen3_encoder as z_image_qwen3_encoder,
+)
+from invokeai.backend.model_manager.starter_models.common import (
+ z_image_qwen3_encoder_quantized as z_image_qwen3_encoder_quantized,
+)
+from invokeai.backend.model_manager.starter_models.ernie_image import (
+ ernie_image as ernie_image,
+)
+from invokeai.backend.model_manager.starter_models.ernie_image import (
+ ernie_image_turbo as ernie_image_turbo,
+)
+from invokeai.backend.model_manager.starter_models.external import (
+ GEMINI_3_1_FLASH_RESOLUTION_PRESETS as GEMINI_3_1_FLASH_RESOLUTION_PRESETS,
+)
+from invokeai.backend.model_manager.starter_models.external import (
+ GEMINI_3_IMAGE_ALLOWED_ASPECT_RATIOS as GEMINI_3_IMAGE_ALLOWED_ASPECT_RATIOS,
+)
+from invokeai.backend.model_manager.starter_models.external import (
+ GEMINI_3_IMAGE_MAX_SIZE as GEMINI_3_IMAGE_MAX_SIZE,
+)
+from invokeai.backend.model_manager.starter_models.external import (
+ GEMINI_3_PRO_RESOLUTION_PRESETS as GEMINI_3_PRO_RESOLUTION_PRESETS,
+)
+from invokeai.backend.model_manager.starter_models.external import (
+ OPENAI_GPT_IMAGE_ASPECT_RATIO_SIZES as OPENAI_GPT_IMAGE_ASPECT_RATIO_SIZES,
+)
+from invokeai.backend.model_manager.starter_models.external import (
+ OPENAI_GPT_IMAGE_ASPECT_RATIOS as OPENAI_GPT_IMAGE_ASPECT_RATIOS,
+)
+from invokeai.backend.model_manager.starter_models.external import (
+ OPENAI_GPT_IMAGE_PANEL_SCHEMA as OPENAI_GPT_IMAGE_PANEL_SCHEMA,
+)
+from invokeai.backend.model_manager.starter_models.external import (
+ QWEN_IMAGE_2_ALLOWED_ASPECT_RATIOS as QWEN_IMAGE_2_ALLOWED_ASPECT_RATIOS,
+)
+from invokeai.backend.model_manager.starter_models.external import (
+ QWEN_IMAGE_MAX_ALLOWED_ASPECT_RATIOS as QWEN_IMAGE_MAX_ALLOWED_ASPECT_RATIOS,
+)
+from invokeai.backend.model_manager.starter_models.external import (
+ SEEDREAM_1K_SIZES as SEEDREAM_1K_SIZES,
+)
+from invokeai.backend.model_manager.starter_models.external import (
+ SEEDREAM_2K_SIZES as SEEDREAM_2K_SIZES,
+)
+from invokeai.backend.model_manager.starter_models.external import (
+ SEEDREAM_ASPECT_RATIOS as SEEDREAM_ASPECT_RATIOS,
+)
+from invokeai.backend.model_manager.starter_models.external import (
+ SEEDREAM_PANEL_SCHEMA as SEEDREAM_PANEL_SCHEMA,
+)
+from invokeai.backend.model_manager.starter_models.external import (
+ WAN_V2_ALLOWED_ASPECT_RATIOS as WAN_V2_ALLOWED_ASPECT_RATIOS,
+)
+from invokeai.backend.model_manager.starter_models.external import (
+ _gemini_3_resolution_presets as _gemini_3_resolution_presets,
+)
+from invokeai.backend.model_manager.starter_models.external import (
+ alibabacloud_qwen_image_2 as alibabacloud_qwen_image_2,
+)
+from invokeai.backend.model_manager.starter_models.external import (
+ alibabacloud_qwen_image_2_pro as alibabacloud_qwen_image_2_pro,
+)
+from invokeai.backend.model_manager.starter_models.external import (
+ alibabacloud_qwen_image_edit_max as alibabacloud_qwen_image_edit_max,
+)
+from invokeai.backend.model_manager.starter_models.external import (
+ alibabacloud_qwen_image_max as alibabacloud_qwen_image_max,
+)
+from invokeai.backend.model_manager.starter_models.external import (
+ alibabacloud_wan26_t2i as alibabacloud_wan26_t2i,
+)
+from invokeai.backend.model_manager.starter_models.external import (
+ gemini_3_1_flash_image_preview as gemini_3_1_flash_image_preview,
+)
+from invokeai.backend.model_manager.starter_models.external import (
+ gemini_flash_image as gemini_flash_image,
+)
+from invokeai.backend.model_manager.starter_models.external import (
+ gemini_pro_image_preview as gemini_pro_image_preview,
+)
+from invokeai.backend.model_manager.starter_models.external import (
+ openai_dall_e_3 as openai_dall_e_3,
+)
+from invokeai.backend.model_manager.starter_models.external import (
+ openai_gpt_image_1 as openai_gpt_image_1,
+)
+from invokeai.backend.model_manager.starter_models.external import (
+ openai_gpt_image_1_5 as openai_gpt_image_1_5,
+)
+from invokeai.backend.model_manager.starter_models.external import (
+ openai_gpt_image_1_mini as openai_gpt_image_1_mini,
+)
+from invokeai.backend.model_manager.starter_models.external import (
+ openai_gpt_image_2 as openai_gpt_image_2,
+)
+from invokeai.backend.model_manager.starter_models.external import (
+ seedream_4_0 as seedream_4_0,
+)
+from invokeai.backend.model_manager.starter_models.external import (
+ seedream_4_5 as seedream_4_5,
+)
+from invokeai.backend.model_manager.starter_models.external import (
+ seedream_5_0 as seedream_5_0,
+)
+from invokeai.backend.model_manager.starter_models.external import (
+ seedream_5_0_lite as seedream_5_0_lite,
+)
+from invokeai.backend.model_manager.starter_models.flux import (
+ flux_canny_control_lora as flux_canny_control_lora,
+)
+from invokeai.backend.model_manager.starter_models.flux import (
+ flux_depth_control_lora as flux_depth_control_lora,
+)
+from invokeai.backend.model_manager.starter_models.flux import (
+ flux_dev as flux_dev,
+)
+from invokeai.backend.model_manager.starter_models.flux import (
+ flux_dev_quantized as flux_dev_quantized,
+)
+from invokeai.backend.model_manager.starter_models.flux import (
+ flux_fill as flux_fill,
+)
+from invokeai.backend.model_manager.starter_models.flux import (
+ flux_kontext as flux_kontext,
+)
+from invokeai.backend.model_manager.starter_models.flux import (
+ flux_kontext_quantized as flux_kontext_quantized,
+)
+from invokeai.backend.model_manager.starter_models.flux import (
+ flux_krea as flux_krea,
+)
+from invokeai.backend.model_manager.starter_models.flux import (
+ flux_krea_quantized as flux_krea_quantized,
+)
+from invokeai.backend.model_manager.starter_models.flux import (
+ flux_redux as flux_redux,
+)
+from invokeai.backend.model_manager.starter_models.flux import (
+ flux_schnell as flux_schnell,
+)
+from invokeai.backend.model_manager.starter_models.flux import (
+ flux_schnell_quantized as flux_schnell_quantized,
+)
+from invokeai.backend.model_manager.starter_models.flux import (
+ flux_schnell_sdnq as flux_schnell_sdnq,
+)
+from invokeai.backend.model_manager.starter_models.flux import (
+ flux_vae as flux_vae,
+)
+from invokeai.backend.model_manager.starter_models.flux import (
+ ip_adapter_flux as ip_adapter_flux,
+)
+from invokeai.backend.model_manager.starter_models.flux import (
+ pid_decoder_flux_2k as pid_decoder_flux_2k,
+)
+from invokeai.backend.model_manager.starter_models.flux import (
+ pid_decoder_flux_2kto4k as pid_decoder_flux_2kto4k,
+)
+from invokeai.backend.model_manager.starter_models.flux import (
+ union_cnet_flux as union_cnet_flux,
+)
+from invokeai.backend.model_manager.starter_models.flux2 import (
+ flux2_dev_diffusers as flux2_dev_diffusers,
+)
+from invokeai.backend.model_manager.starter_models.flux2 import (
+ flux2_dev_diffusers_nf4 as flux2_dev_diffusers_nf4,
+)
+from invokeai.backend.model_manager.starter_models.flux2 import (
+ flux2_dev_gguf_q3_k_m as flux2_dev_gguf_q3_k_m,
+)
+from invokeai.backend.model_manager.starter_models.flux2 import (
+ flux2_dev_gguf_q4_k_m as flux2_dev_gguf_q4_k_m,
+)
+from invokeai.backend.model_manager.starter_models.flux2 import (
+ flux2_dev_gguf_q5_k_m as flux2_dev_gguf_q5_k_m,
+)
+from invokeai.backend.model_manager.starter_models.flux2 import (
+ flux2_dev_gguf_q6_k as flux2_dev_gguf_q6_k,
+)
+from invokeai.backend.model_manager.starter_models.flux2 import (
+ flux2_dev_gguf_q8_0 as flux2_dev_gguf_q8_0,
+)
+from invokeai.backend.model_manager.starter_models.flux2 import (
+ flux2_klein_4b as flux2_klein_4b,
+)
+from invokeai.backend.model_manager.starter_models.flux2 import (
+ flux2_klein_4b_fp8 as flux2_klein_4b_fp8,
+)
+from invokeai.backend.model_manager.starter_models.flux2 import (
+ flux2_klein_4b_gguf_q4 as flux2_klein_4b_gguf_q4,
+)
+from invokeai.backend.model_manager.starter_models.flux2 import (
+ flux2_klein_4b_gguf_q8 as flux2_klein_4b_gguf_q8,
+)
+from invokeai.backend.model_manager.starter_models.flux2 import (
+ flux2_klein_4b_sdnq as flux2_klein_4b_sdnq,
+)
+from invokeai.backend.model_manager.starter_models.flux2 import (
+ flux2_klein_4b_single as flux2_klein_4b_single,
+)
+from invokeai.backend.model_manager.starter_models.flux2 import (
+ flux2_klein_9b as flux2_klein_9b,
+)
+from invokeai.backend.model_manager.starter_models.flux2 import (
+ flux2_klein_9b_fp8 as flux2_klein_9b_fp8,
+)
+from invokeai.backend.model_manager.starter_models.flux2 import (
+ flux2_klein_9b_gguf_q4 as flux2_klein_9b_gguf_q4,
+)
+from invokeai.backend.model_manager.starter_models.flux2 import (
+ flux2_klein_9b_gguf_q8 as flux2_klein_9b_gguf_q8,
+)
+from invokeai.backend.model_manager.starter_models.flux2 import (
+ flux2_klein_9b_sdnq as flux2_klein_9b_sdnq,
+)
+from invokeai.backend.model_manager.starter_models.flux2 import (
+ flux2_vae as flux2_vae,
+)
+from invokeai.backend.model_manager.starter_models.flux2 import (
+ pid_decoder_flux2_2k as pid_decoder_flux2_2k,
+)
+from invokeai.backend.model_manager.starter_models.flux2 import (
+ pid_decoder_flux2_2kto4k as pid_decoder_flux2_2kto4k,
+)
+from invokeai.backend.model_manager.starter_models.ideogram_4 import (
+ ideogram_4_fp8 as ideogram_4_fp8,
+)
+from invokeai.backend.model_manager.starter_models.ideogram_4 import (
+ ideogram_4_nf4 as ideogram_4_nf4,
+)
+from invokeai.backend.model_manager.starter_models.krea_2 import (
+ krea2_raw as krea2_raw,
+)
+from invokeai.backend.model_manager.starter_models.krea_2 import (
+ krea2_turbo as krea2_turbo,
+)
+from invokeai.backend.model_manager.starter_models.krea_2 import (
+ krea2_turbo_gguf_q4_k_m as krea2_turbo_gguf_q4_k_m,
+)
+from invokeai.backend.model_manager.starter_models.krea_2 import (
+ krea2_turbo_gguf_q8_0 as krea2_turbo_gguf_q8_0,
+)
+from invokeai.backend.model_manager.starter_models.minimax_h3 import (
+ minimax_h3_components as minimax_h3_components,
+)
+from invokeai.backend.model_manager.starter_models.minimax_h3 import (
+ minimax_h3_int8_text_encoder as minimax_h3_int8_text_encoder,
+)
+from invokeai.backend.model_manager.starter_models.minimax_h3 import (
+ minimax_h3_int8_transformer as minimax_h3_int8_transformer,
+)
++from invokeai.backend.model_manager.starter_models.minimax_h3 import (
++ minimax_h3_lightx2v_turbo_lora as minimax_h3_lightx2v_turbo_lora,
++)
+from invokeai.backend.model_manager.starter_models.minimax_h3 import (
+ minimax_h3_turbo_lora as minimax_h3_turbo_lora,
+)
+from invokeai.backend.model_manager.starter_models.qwen_image import (
+ pid_decoder_qwenimage_2kto4k as pid_decoder_qwenimage_2kto4k,
+)
+from invokeai.backend.model_manager.starter_models.qwen_image import (
+ qwen_image as qwen_image,
+)
+from invokeai.backend.model_manager.starter_models.qwen_image import (
+ qwen_image_edit as qwen_image_edit,
+)
+from invokeai.backend.model_manager.starter_models.qwen_image import (
+ qwen_image_edit_gguf_q2_k as qwen_image_edit_gguf_q2_k,
+)
+from invokeai.backend.model_manager.starter_models.qwen_image import (
+ qwen_image_edit_gguf_q4_k_m as qwen_image_edit_gguf_q4_k_m,
+)
+from invokeai.backend.model_manager.starter_models.qwen_image import (
+ qwen_image_edit_gguf_q6_k as qwen_image_edit_gguf_q6_k,
+)
+from invokeai.backend.model_manager.starter_models.qwen_image import (
+ qwen_image_edit_gguf_q8_0 as qwen_image_edit_gguf_q8_0,
+)
+from invokeai.backend.model_manager.starter_models.qwen_image import (
+ qwen_image_edit_lightning_4step as qwen_image_edit_lightning_4step,
+)
+from invokeai.backend.model_manager.starter_models.qwen_image import (
+ qwen_image_edit_lightning_8step as qwen_image_edit_lightning_8step,
+)
+from invokeai.backend.model_manager.starter_models.qwen_image import (
+ qwen_image_gguf_q2_k as qwen_image_gguf_q2_k,
+)
+from invokeai.backend.model_manager.starter_models.qwen_image import (
+ qwen_image_gguf_q4_k_m as qwen_image_gguf_q4_k_m,
+)
+from invokeai.backend.model_manager.starter_models.qwen_image import (
+ qwen_image_gguf_q6_k as qwen_image_gguf_q6_k,
+)
+from invokeai.backend.model_manager.starter_models.qwen_image import (
+ qwen_image_gguf_q8_0 as qwen_image_gguf_q8_0,
+)
+from invokeai.backend.model_manager.starter_models.qwen_image import (
+ qwen_image_lightning_4step as qwen_image_lightning_4step,
+)
+from invokeai.backend.model_manager.starter_models.qwen_image import (
+ qwen_image_lightning_8step as qwen_image_lightning_8step,
+)
+from invokeai.backend.model_manager.starter_models.qwen_image import (
+ qwen_image_vae as qwen_image_vae,
+)
+from invokeai.backend.model_manager.starter_models.sd_1 import (
+ canny_sd1 as canny_sd1,
+)
+from invokeai.backend.model_manager.starter_models.sd_1 import (
+ cyberrealistic_negative as cyberrealistic_negative,
+)
+from invokeai.backend.model_manager.starter_models.sd_1 import (
+ cyberrealistic_sd1 as cyberrealistic_sd1,
+)
+from invokeai.backend.model_manager.starter_models.sd_1 import (
+ deliberate_inpainting_sd1 as deliberate_inpainting_sd1,
+)
+from invokeai.backend.model_manager.starter_models.sd_1 import (
+ deliberate_sd1 as deliberate_sd1,
+)
+from invokeai.backend.model_manager.starter_models.sd_1 import (
+ depth_sd1 as depth_sd1,
+)
+from invokeai.backend.model_manager.starter_models.sd_1 import (
+ dreamshaper_8_inpainting_sd1 as dreamshaper_8_inpainting_sd1,
+)
+from invokeai.backend.model_manager.starter_models.sd_1 import (
+ dreamshaper_8_sd1 as dreamshaper_8_sd1,
+)
+from invokeai.backend.model_manager.starter_models.sd_1 import (
+ easy_neg_sd1 as easy_neg_sd1,
+)
+from invokeai.backend.model_manager.starter_models.sd_1 import (
+ inpaint_cnet_sd1 as inpaint_cnet_sd1,
+)
+from invokeai.backend.model_manager.starter_models.sd_1 import (
+ ip_adapter_plus_face_sd1 as ip_adapter_plus_face_sd1,
+)
+from invokeai.backend.model_manager.starter_models.sd_1 import (
+ ip_adapter_plus_sd1 as ip_adapter_plus_sd1,
+)
+from invokeai.backend.model_manager.starter_models.sd_1 import (
+ ip_adapter_sd1 as ip_adapter_sd1,
+)
+from invokeai.backend.model_manager.starter_models.sd_1 import (
+ lineart_anime_sd1 as lineart_anime_sd1,
+)
+from invokeai.backend.model_manager.starter_models.sd_1 import (
+ lineart_sd1 as lineart_sd1,
+)
+from invokeai.backend.model_manager.starter_models.sd_1 import (
+ mlsd_sd1 as mlsd_sd1,
+)
+from invokeai.backend.model_manager.starter_models.sd_1 import (
+ normal_bae_sd1 as normal_bae_sd1,
+)
+from invokeai.backend.model_manager.starter_models.sd_1 import (
+ openpose_sd1 as openpose_sd1,
+)
+from invokeai.backend.model_manager.starter_models.sd_1 import (
+ qr_code_cnet_sd1 as qr_code_cnet_sd1,
+)
+from invokeai.backend.model_manager.starter_models.sd_1 import (
+ rev_animated_sd1 as rev_animated_sd1,
+)
+from invokeai.backend.model_manager.starter_models.sd_1 import (
+ scribble_sd1 as scribble_sd1,
+)
+from invokeai.backend.model_manager.starter_models.sd_1 import (
+ seg_sd1 as seg_sd1,
+)
+from invokeai.backend.model_manager.starter_models.sd_1 import (
+ shuffle_sd1 as shuffle_sd1,
+)
+from invokeai.backend.model_manager.starter_models.sd_1 import (
+ softedge_sd1 as softedge_sd1,
+)
+from invokeai.backend.model_manager.starter_models.sd_1 import (
+ t2i_canny_sd1 as t2i_canny_sd1,
+)
+from invokeai.backend.model_manager.starter_models.sd_1 import (
+ t2i_depth_sd1 as t2i_depth_sd1,
+)
+from invokeai.backend.model_manager.starter_models.sd_1 import (
+ t2i_sketch_sd1 as t2i_sketch_sd1,
+)
+from invokeai.backend.model_manager.starter_models.sd_1 import (
+ tile_sd1 as tile_sd1,
+)
+from invokeai.backend.model_manager.starter_models.sd_3 import (
+ pid_decoder_sd3_2k as pid_decoder_sd3_2k,
+)
+from invokeai.backend.model_manager.starter_models.sd_3 import (
+ pid_decoder_sd3_2kto4k as pid_decoder_sd3_2kto4k,
+)
+from invokeai.backend.model_manager.starter_models.sd_3 import (
+ sd35_large as sd35_large,
+)
+from invokeai.backend.model_manager.starter_models.sd_3 import (
+ sd35_medium as sd35_medium,
+)
+from invokeai.backend.model_manager.starter_models.sdxl import (
+ alien_lora_sdxl as alien_lora_sdxl,
+)
+from invokeai.backend.model_manager.starter_models.sdxl import (
+ archvis_sdxl as archvis_sdxl,
+)
+from invokeai.backend.model_manager.starter_models.sdxl import (
+ canny_sdxl as canny_sdxl,
+)
+from invokeai.backend.model_manager.starter_models.sdxl import (
+ depth_sdxl as depth_sdxl,
+)
+from invokeai.backend.model_manager.starter_models.sdxl import (
+ dreamshaper_sdxl as dreamshaper_sdxl,
+)
+from invokeai.backend.model_manager.starter_models.sdxl import (
+ ip_adapter_plus_sdxl as ip_adapter_plus_sdxl,
+)
+from invokeai.backend.model_manager.starter_models.sdxl import (
+ ip_adapter_sdxl as ip_adapter_sdxl,
+)
+from invokeai.backend.model_manager.starter_models.sdxl import (
+ juggernaut_sdxl as juggernaut_sdxl,
+)
+from invokeai.backend.model_manager.starter_models.sdxl import (
+ noodle_lora_sdxl as noodle_lora_sdxl,
+)
+from invokeai.backend.model_manager.starter_models.sdxl import (
+ openpose_sdxl as openpose_sdxl,
+)
+from invokeai.backend.model_manager.starter_models.sdxl import (
+ pid_decoder_sdxl_2kto4k as pid_decoder_sdxl_2kto4k,
+)
+from invokeai.backend.model_manager.starter_models.sdxl import (
+ qr_code_cnet_sdxl as qr_code_cnet_sdxl,
+)
+from invokeai.backend.model_manager.starter_models.sdxl import (
+ scribble_sdxl as scribble_sdxl,
+)
+from invokeai.backend.model_manager.starter_models.sdxl import (
+ sdxl_fp16_vae_fix as sdxl_fp16_vae_fix,
+)
+from invokeai.backend.model_manager.starter_models.sdxl import (
+ softedge_sdxl as softedge_sdxl,
+)
+from invokeai.backend.model_manager.starter_models.sdxl import (
+ t2i_canny_sdxl as t2i_canny_sdxl,
+)
+from invokeai.backend.model_manager.starter_models.sdxl import (
+ t2i_lineart_sdxl as t2i_lineart_sdxl,
+)
+from invokeai.backend.model_manager.starter_models.sdxl import (
+ t2i_sketch_sdxl as t2i_sketch_sdxl,
+)
+from invokeai.backend.model_manager.starter_models.sdxl import (
+ tile_sdxl as tile_sdxl,
+)
+from invokeai.backend.model_manager.starter_models.sdxl import (
+ union_cnet_sdxl as union_cnet_sdxl,
+)
+from invokeai.backend.model_manager.starter_models.sdxl_refiner import (
+ sdxl_refiner as sdxl_refiner,
+)
+from invokeai.backend.model_manager.starter_models.types import (
+ StarterModel as StarterModel,
+)
+from invokeai.backend.model_manager.starter_models.types import (
+ StarterModelBundle as StarterModelBundle,
+)
+from invokeai.backend.model_manager.starter_models.types import (
+ StarterModelWithoutDependencies as StarterModelWithoutDependencies,
+)
+from invokeai.backend.model_manager.starter_models.wan import (
+ wan_22_5b_vae as wan_22_5b_vae,
+)
+from invokeai.backend.model_manager.starter_models.wan import (
+ wan_22_a14b_vae as wan_22_a14b_vae,
+)
+from invokeai.backend.model_manager.starter_models.wan import (
+ wan_22_i2v_a14b_diffusers as wan_22_i2v_a14b_diffusers,
+)
+from invokeai.backend.model_manager.starter_models.wan import (
+ wan_22_i2v_a14b_gguf_q4_k_m as wan_22_i2v_a14b_gguf_q4_k_m,
+)
+from invokeai.backend.model_manager.starter_models.wan import (
+ wan_22_i2v_a14b_gguf_q8_0 as wan_22_i2v_a14b_gguf_q8_0,
+)
+from invokeai.backend.model_manager.starter_models.wan import (
+ wan_22_i2v_a14b_low_gguf_q4_k_m as wan_22_i2v_a14b_low_gguf_q4_k_m,
+)
+from invokeai.backend.model_manager.starter_models.wan import (
+ wan_22_i2v_a14b_low_gguf_q8_0 as wan_22_i2v_a14b_low_gguf_q8_0,
+)
+from invokeai.backend.model_manager.starter_models.wan import (
+ wan_22_i2v_lightning_high as wan_22_i2v_lightning_high,
+)
+from invokeai.backend.model_manager.starter_models.wan import (
+ wan_22_i2v_lightning_low as wan_22_i2v_lightning_low,
+)
+from invokeai.backend.model_manager.starter_models.wan import (
+ wan_22_t2v_a14b_diffusers as wan_22_t2v_a14b_diffusers,
+)
+from invokeai.backend.model_manager.starter_models.wan import (
+ wan_22_t2v_a14b_gguf_q4_k_m as wan_22_t2v_a14b_gguf_q4_k_m,
+)
+from invokeai.backend.model_manager.starter_models.wan import (
+ wan_22_t2v_a14b_gguf_q8_0 as wan_22_t2v_a14b_gguf_q8_0,
+)
+from invokeai.backend.model_manager.starter_models.wan import (
+ wan_22_t2v_a14b_low_gguf_q4_k_m as wan_22_t2v_a14b_low_gguf_q4_k_m,
+)
+from invokeai.backend.model_manager.starter_models.wan import (
+ wan_22_t2v_a14b_low_gguf_q8_0 as wan_22_t2v_a14b_low_gguf_q8_0,
+)
+from invokeai.backend.model_manager.starter_models.wan import (
+ wan_22_t2v_lightning_high as wan_22_t2v_lightning_high,
+)
+from invokeai.backend.model_manager.starter_models.wan import (
+ wan_22_t2v_lightning_low as wan_22_t2v_lightning_low,
+)
+from invokeai.backend.model_manager.starter_models.wan import (
+ wan_22_ti2v_5b_diffusers as wan_22_ti2v_5b_diffusers,
+)
+from invokeai.backend.model_manager.starter_models.wan import (
+ wan_22_ti2v_5b_gguf_q4_k_m as wan_22_ti2v_5b_gguf_q4_k_m,
+)
+from invokeai.backend.model_manager.starter_models.wan import (
+ wan_22_ti2v_5b_gguf_q8_0 as wan_22_ti2v_5b_gguf_q8_0,
+)
+from invokeai.backend.model_manager.starter_models.z_image import (
+ z_image_controlnet_tile as z_image_controlnet_tile,
+)
+from invokeai.backend.model_manager.starter_models.z_image import (
+ z_image_controlnet_union as z_image_controlnet_union,
+)
+from invokeai.backend.model_manager.starter_models.z_image import (
+ z_image_turbo as z_image_turbo,
+)
+from invokeai.backend.model_manager.starter_models.z_image import (
+ z_image_turbo_q8 as z_image_turbo_q8,
+)
+from invokeai.backend.model_manager.starter_models.z_image import (
+ z_image_turbo_quantized as z_image_turbo_quantized,
+)
+from invokeai.backend.model_manager.starter_models.z_image import (
+ z_image_turbo_sdnq as z_image_turbo_sdnq,
+)
+from invokeai.backend.model_manager.taxonomy import BaseModelType
+
+# List of starter models, displayed on the frontend.
+# The order/sort of this list is not changed by the frontend - set it how you want it here.
+STARTER_MODELS: list[StarterModel] = [
+ flux_kontext_quantized,
+ flux_schnell_quantized,
+ flux_dev_quantized,
+ flux_schnell,
+ flux_dev,
+ flux_schnell_sdnq,
+ sd35_medium,
+ sd35_large,
+ ideogram_4_nf4,
+ ideogram_4_fp8,
+ cyberrealistic_sd1,
+ rev_animated_sd1,
+ dreamshaper_8_sd1,
+ dreamshaper_8_inpainting_sd1,
+ deliberate_sd1,
+ deliberate_inpainting_sd1,
+ juggernaut_sdxl,
+ dreamshaper_sdxl,
+ archvis_sdxl,
+ sdxl_refiner,
+ sdxl_fp16_vae_fix,
+ flux_vae,
+ alien_lora_sdxl,
+ noodle_lora_sdxl,
+ easy_neg_sd1,
+ ip_adapter_sd1,
+ ip_adapter_plus_sd1,
+ ip_adapter_plus_face_sd1,
+ ip_adapter_sdxl,
+ ip_adapter_plus_sdxl,
+ ip_adapter_flux,
+ qr_code_cnet_sd1,
+ qr_code_cnet_sdxl,
+ canny_sd1,
+ inpaint_cnet_sd1,
+ mlsd_sd1,
+ depth_sd1,
+ normal_bae_sd1,
+ seg_sd1,
+ lineart_sd1,
+ lineart_anime_sd1,
+ openpose_sd1,
+ scribble_sd1,
+ softedge_sd1,
+ shuffle_sd1,
+ tile_sd1,
+ canny_sdxl,
+ depth_sdxl,
+ softedge_sdxl,
+ openpose_sdxl,
+ scribble_sdxl,
+ tile_sdxl,
+ union_cnet_sdxl,
+ union_cnet_flux,
+ flux_canny_control_lora,
+ flux_depth_control_lora,
+ t2i_canny_sd1,
+ t2i_sketch_sd1,
+ t2i_depth_sd1,
+ t2i_canny_sdxl,
+ t2i_lineart_sdxl,
+ t2i_sketch_sdxl,
+ realesrgan_x4,
+ animesharp_v4_rcan,
+ realesrgan_x2,
+ swinir,
+ t5_base_encoder,
+ t5_8b_quantized_encoder,
+ t5_gguf_q3_k_s_encoder,
+ t5_gguf_q6_k_encoder,
+ clip_l_encoder,
+ clip_vit_l_image_encoder,
+ siglip,
+ flux_redux,
+ llava_onevision,
+ llava_onevision_7b,
+ qwen2_5_1_5b_instruct,
+ qwen2_5_3b_instruct,
+ smollm2_1_7b_instruct,
+ flux_fill,
+ flux2_vae,
+ flux2_klein_4b,
+ flux2_klein_4b_single,
+ flux2_klein_4b_fp8,
+ flux2_klein_9b,
+ flux2_klein_9b_fp8,
+ flux2_klein_4b_sdnq,
+ flux2_klein_9b_sdnq,
+ flux2_klein_4b_gguf_q4,
+ flux2_klein_4b_gguf_q8,
+ flux2_klein_9b_gguf_q4,
+ flux2_klein_9b_gguf_q8,
+ flux2_klein_qwen3_4b_encoder,
+ flux2_klein_qwen3_8b_encoder,
+ flux2_dev_comfy_mistral_bf16,
+ flux2_dev_comfy_mistral_fp4,
+ flux2_dev_comfy_mistral_fp8,
+ flux2_dev_cow_mistral_iq4_xs,
+ flux2_dev_cow_mistral_q4,
+ flux2_dev_cow_mistral_q8,
+ flux2_dev_diffusers,
+ flux2_dev_diffusers_nf4,
+ flux2_dev_gguf_q3_k_m,
+ flux2_dev_gguf_q4_k_m,
+ flux2_dev_gguf_q5_k_m,
+ flux2_dev_gguf_q6_k,
+ flux2_dev_gguf_q8_0,
+ cogview4,
+ qwen_image_vae,
+ qwen_vl_encoder_fp8,
+ qwen_vl_encoder_diffusers,
+ qwen_image_edit,
+ qwen_image_edit_gguf_q2_k,
+ qwen_image_edit_gguf_q4_k_m,
+ qwen_image_edit_gguf_q6_k,
+ qwen_image_edit_gguf_q8_0,
+ qwen_image_edit_lightning_4step,
+ qwen_image_edit_lightning_8step,
+ qwen_image,
+ qwen_image_gguf_q2_k,
+ qwen_image_gguf_q4_k_m,
+ qwen_image_gguf_q6_k,
+ qwen_image_gguf_q8_0,
+ qwen_image_lightning_4step,
+ qwen_image_lightning_8step,
+ flux_krea,
+ flux_krea_quantized,
+ z_image_turbo,
+ z_image_turbo_quantized,
+ z_image_turbo_q8,
+ z_image_turbo_sdnq,
+ z_image_qwen3_encoder,
+ z_image_qwen3_encoder_quantized,
+ z_image_controlnet_union,
+ z_image_controlnet_tile,
+ ernie_image,
+ ernie_image_turbo,
+ krea2_turbo,
+ krea2_raw,
+ krea2_turbo_gguf_q4_k_m,
+ krea2_turbo_gguf_q8_0,
+ qwen3_vl_encoder_4b,
+ wan_22_t5_encoder,
+ wan_22_a14b_vae,
+ wan_22_5b_vae,
+ wan_22_t2v_a14b_diffusers,
+ wan_22_t2v_a14b_low_gguf_q4_k_m,
+ wan_22_t2v_a14b_gguf_q4_k_m,
+ wan_22_t2v_a14b_low_gguf_q8_0,
+ wan_22_t2v_a14b_gguf_q8_0,
+ wan_22_t2v_lightning_high,
+ wan_22_t2v_lightning_low,
+ wan_22_i2v_a14b_diffusers,
+ wan_22_i2v_a14b_low_gguf_q4_k_m,
+ wan_22_i2v_a14b_gguf_q4_k_m,
+ wan_22_i2v_a14b_low_gguf_q8_0,
+ wan_22_i2v_a14b_gguf_q8_0,
+ wan_22_i2v_lightning_high,
+ wan_22_i2v_lightning_low,
+ wan_22_ti2v_5b_diffusers,
+ wan_22_ti2v_5b_gguf_q4_k_m,
+ wan_22_ti2v_5b_gguf_q8_0,
+ minimax_h3_int8_transformer,
+ minimax_h3_int8_text_encoder,
+ minimax_h3_components,
+ minimax_h3_turbo_lora,
++ minimax_h3_lightx2v_turbo_lora,
+ gemini_flash_image,
+ gemini_pro_image_preview,
+ gemini_3_1_flash_image_preview,
+ openai_gpt_image_2,
+ openai_gpt_image_1_5,
+ openai_gpt_image_1,
+ openai_gpt_image_1_mini,
+ openai_dall_e_3,
+ seedream_5_0,
+ seedream_5_0_lite,
+ seedream_4_5,
+ seedream_4_0,
+ alibabacloud_qwen_image_2_pro,
+ alibabacloud_qwen_image_2,
+ alibabacloud_qwen_image_max,
+ alibabacloud_wan26_t2i,
+ alibabacloud_qwen_image_edit_max,
+ anima_base,
+ anima_qwen3_encoder,
+ anima_vae,
+ anima_lllite_inpainting,
+ anima_lllite_sketch,
+ anima_lllite_depth_preview3,
+ anima_lllite_scribble_preview3,
+ anima_lllite_lineart_preview3,
+ anima_lllite_pose_preview3,
+ gemma2_2b_encoder,
+ pid_decoder_flux_2k,
+ pid_decoder_flux_2kto4k,
+ pid_decoder_flux2_2k,
+ pid_decoder_flux2_2kto4k,
+ pid_decoder_sd3_2k,
+ pid_decoder_sd3_2kto4k,
+ pid_decoder_sdxl_2kto4k,
+ pid_decoder_qwenimage_2kto4k,
+]
+
+sd1_bundle: list[StarterModel] = [
+ dreamshaper_8_sd1,
+ easy_neg_sd1,
+ ip_adapter_sd1,
+ ip_adapter_plus_sd1,
+ ip_adapter_plus_face_sd1,
+ canny_sd1,
+ inpaint_cnet_sd1,
+ mlsd_sd1,
+ depth_sd1,
+ normal_bae_sd1,
+ seg_sd1,
+ lineart_sd1,
+ lineart_anime_sd1,
+ openpose_sd1,
+ scribble_sd1,
+ softedge_sd1,
+ shuffle_sd1,
+ tile_sd1,
+ swinir,
+]
+
+sdxl_bundle: list[StarterModel] = [
+ juggernaut_sdxl,
+ sdxl_fp16_vae_fix,
+ ip_adapter_sdxl,
+ ip_adapter_plus_sdxl,
+ canny_sdxl,
+ depth_sdxl,
+ softedge_sdxl,
+ openpose_sdxl,
+ scribble_sdxl,
+ tile_sdxl,
+ swinir,
+]
+
+flux_bundle: list[StarterModel] = [
+ flux_schnell_quantized,
+ flux_dev_quantized,
+ flux_vae,
+ t5_8b_quantized_encoder,
+ clip_l_encoder,
+ union_cnet_flux,
+ ip_adapter_flux,
+ flux_canny_control_lora,
+ flux_depth_control_lora,
+ flux_redux,
+ flux_fill,
+ flux_kontext_quantized,
+ flux_krea_quantized,
+]
+
+zimage_bundle: list[StarterModel] = [
+ z_image_turbo_quantized,
+ z_image_qwen3_encoder_quantized,
+ z_image_controlnet_union,
+ z_image_controlnet_tile,
+ flux_vae,
+]
+
+flux2_klein_bundle: list[StarterModel] = [
+ flux2_klein_4b_gguf_q4,
+ flux2_vae,
+ flux2_klein_qwen3_4b_encoder,
+]
+
+# Turbo only: both checkpoints are 8B and the full pipeline is a large download, so the bundle
+# ships the fast default. The undistilled `ernie_image` is still installable individually.
+ernie_image_bundle: list[StarterModel] = [
+ ernie_image_turbo,
+]
+
+qwen_image_bundle: list[StarterModel] = [
+ qwen_image_vae,
+ qwen_vl_encoder_fp8,
+ qwen_image_edit,
+ qwen_image_edit_gguf_q4_k_m,
+ qwen_image_edit_gguf_q8_0,
+ qwen_image_edit_lightning_4step,
+ qwen_image_edit_lightning_8step,
+ qwen_image,
+ qwen_image_gguf_q4_k_m,
+ qwen_image_gguf_q8_0,
+ qwen_image_lightning_4step,
+ qwen_image_lightning_8step,
+]
+
+anima_bundle: list[StarterModel] = [
+ anima_base,
+ anima_qwen3_encoder,
+ anima_vae,
+ anima_lllite_inpainting,
+ anima_lllite_sketch,
+]
+
+krea2_bundle: list[StarterModel] = [
+ qwen_image_vae,
+ qwen3_vl_encoder_4b,
+ krea2_turbo,
+ krea2_raw,
+ krea2_turbo_gguf_q4_k_m,
+ krea2_turbo_gguf_q8_0,
+]
+
+# Wan 2.2 starter bundles. Split into T2V and I2V so users only pay for the
+# capability they need: a 12 GB card can install just the T2V bundle and have
+# both text-to-video (T2V-A14B) and a low-VRAM image-to-video option (via
+# TI2V-5B, which handles both modes in one ~3.4 GB model). The I2V bundle adds
+# the heavier I2V-A14B path for users with more headroom. Q8 variants and full
+# Diffusers builds stay available as a-la-carte starters.
+wan_t2v_bundle: list[StarterModel] = [
+ wan_22_t5_encoder,
+ wan_22_a14b_vae,
+ wan_22_5b_vae,
+ wan_22_ti2v_5b_gguf_q4_k_m,
+ wan_22_t2v_a14b_gguf_q4_k_m,
+ wan_22_t2v_a14b_low_gguf_q4_k_m,
+ wan_22_t2v_lightning_high,
+ wan_22_t2v_lightning_low,
+]
+
+wan_i2v_bundle: list[StarterModel] = [
+ wan_22_t5_encoder,
+ wan_22_a14b_vae,
+ wan_22_i2v_a14b_gguf_q4_k_m,
+ wan_22_i2v_a14b_low_gguf_q4_k_m,
+ wan_22_i2v_lightning_high,
+ wan_22_i2v_lightning_low,
+]
+
+# nf4 is the recommended 24GB CUDA path; the fp8 build is offered separately for non-CUDA / more VRAM.
+ideogram_bundle: list[StarterModel] = [
+ ideogram_4_nf4,
+]
+
- # The minimal working set for MiniMax H3 video+audio generation (~59 GB): shared components from
- # the official repo plus Comfy-Org's int8 single-file transformer and text encoder. See the
- # license note in the MiniMax H3 region above.
++# The working set for MiniMax H3 video+audio generation (~62 GB): shared components from
++# the official repo plus Comfy-Org's int8 single-file transformer and text encoder, and the
++# two turbo (step-distillation) LoRAs for fast low-step rendering. See the license note in
++# the MiniMax H3 region above.
+minimax_h3_bundle: list[StarterModel] = [
+ minimax_h3_components,
+ minimax_h3_int8_text_encoder,
+ minimax_h3_int8_transformer,
++ minimax_h3_turbo_lora,
++ minimax_h3_lightx2v_turbo_lora,
+]
+
+STARTER_BUNDLES: dict[str, StarterModelBundle] = {
+ BaseModelType.StableDiffusion1: StarterModelBundle(name="Stable Diffusion 1.5", models=sd1_bundle),
+ BaseModelType.StableDiffusionXL: StarterModelBundle(name="SDXL", models=sdxl_bundle),
+ BaseModelType.Flux: StarterModelBundle(name="FLUX.1 dev", models=flux_bundle),
+ BaseModelType.Flux2: StarterModelBundle(name="FLUX.2 Klein", models=flux2_klein_bundle),
+ BaseModelType.ZImage: StarterModelBundle(name="Z-Image Turbo", models=zimage_bundle),
+ BaseModelType.ErnieImage: StarterModelBundle(name="ERNIE-Image", models=ernie_image_bundle),
+ BaseModelType.QwenImage: StarterModelBundle(name="Qwen Image", models=qwen_image_bundle),
+ BaseModelType.Anima: StarterModelBundle(name="Anima", models=anima_bundle),
+ BaseModelType.Krea2: StarterModelBundle(name="Krea-2", models=krea2_bundle),
+ "wan_t2v": StarterModelBundle(name="Wan 2.2 Text-to-Video", models=wan_t2v_bundle),
+ "wan_i2v": StarterModelBundle(name="Wan 2.2 Image-to-Video", models=wan_i2v_bundle),
+ BaseModelType.MiniMaxH3: StarterModelBundle(name="MiniMax H3", models=minimax_h3_bundle),
+ BaseModelType.Ideogram4: StarterModelBundle(name="Ideogram 4", models=ideogram_bundle),
+}
+
+assert len(STARTER_MODELS) == len({m.source for m in STARTER_MODELS}), "Duplicate starter models"
diff --cc invokeai/backend/model_manager/starter_models/minimax_h3.py
index 8f6cb13ebf,0000000000..69a233a313
mode 100644,000000..100644
--- a/invokeai/backend/model_manager/starter_models/minimax_h3.py
+++ b/invokeai/backend/model_manager/starter_models/minimax_h3.py
@@@ -1,56 -1,0 +1,71 @@@
+"""MiniMax H3 starter models."""
+
+from invokeai.backend.model_manager.starter_models.types import StarterModel
+from invokeai.backend.model_manager.taxonomy import (
+ BaseModelType,
+ ModelFormat,
+ ModelType,
+)
+
+minimax_h3_components = StarterModel(
+ name="MiniMax H3 Components",
+ base=BaseModelType.MiniMaxH3,
+ source="MiniMaxAI/MiniMax-H3::modular_model_index.json+transformer/config.json+tokenizer+processor+vae+audio_vae",
+ description="MiniMax H3 shared components: tokenizer, processor and video/audio VAEs, without "
+ "transformer or text-encoder weights (~11 GB). Pair with the MiniMax H3 single-file transformer "
+ "and text encoder. NOTE: This model is distributed under a restrictive license that forbids its "
+ "use in certain territories. Please see https://huggingface.co/MiniMaxAI/MiniMax-H3 for details.",
+ type=ModelType.Main,
+ format=ModelFormat.Diffusers,
+)
+
+minimax_h3_int8_text_encoder = StarterModel(
+ name="MiniMax H3 Text Encoder (int8)",
+ base=BaseModelType.MiniMaxH3,
+ source="Comfy-Org/MiniMax-H3::text_encoders/qwen3vl_32b_minimax_h3_int8_convrot.safetensors",
+ description="Truncated Qwen3-VL-32B conditioning encoder for MiniMax H3, int8 quantized (~27 GB). "
+ "Select it in the MiniMax H3 Model Loader's text encoder field. NOTE: This model is distributed "
+ "under a restrictive license that forbids its use in certain territories. Please see "
+ "https://huggingface.co/MiniMaxAI/MiniMax-H3 for details.",
+ type=ModelType.Qwen3VLEncoder,
+ format=ModelFormat.Checkpoint,
+)
+
+minimax_h3_int8_transformer = StarterModel(
+ name="MiniMax H3 FL2VA Transformer (int8, pruned)",
+ base=BaseModelType.MiniMaxH3,
+ source="Comfy-Org/MiniMax-H3::diffusion_models/minimax_h3_fl2va_pruned_int8_convrot.safetensors",
+ description="MiniMax H3 video+audio generation. AdaLN-pruned int8 single-file transformer (~21 GB); "
+ "select it in the MiniMax H3 Model Loader's transformer field. Total size with dependencies: ~59 GB. "
+ "NOTE: This model is distributed under a restrictive license that forbids its use in certain "
+ "territories. Please see https://huggingface.co/MiniMaxAI/MiniMax-H3 for details.",
+ type=ModelType.Main,
+ format=ModelFormat.Checkpoint,
+ dependencies=[minimax_h3_components, minimax_h3_int8_text_encoder],
+)
+
+minimax_h3_turbo_lora = StarterModel(
+ name="MiniMax H3 Turbo LoRA",
+ base=BaseModelType.MiniMaxH3,
+ source="larryvrh/MiniMax-H3-Turbo-Lora::minimax_h3_turbo_v4_step600_ema.safetensors",
+ description="Step-distillation LoRA for MiniMax H3 (Apache 2.0): renders video+audio in 4-8 "
+ "denoising steps instead of ~50. Apply at strength 1.0 and lower Steps to 6-8. Works with the "
+ "full and the pruned int8 transformers.",
+ type=ModelType.LoRA,
+ format=ModelFormat.LyCORIS,
+)
++
++# Only the *_comfyui_* files in the LightX2V repo are installable: they carry the native
++# fused-key layout (diffusion_model.blocks.N.attn.qkv_proj) that the H3 LoRA probe accepts.
++# The non-comfyui files use already-diffusers keys (transformer_blocks.N.attn.to_q with
++# PEFT ".default" adapter names), which the probe rejects as a different architecture.
++minimax_h3_lightx2v_turbo_lora = StarterModel(
++ name="MiniMax H3 LightX2V Turbo LoRA",
++ base=BaseModelType.MiniMaxH3,
++ source="lightx2v/Minimax-h3-Turbo::minimax_h3_fl2v_turbo_8step_v1.0_comfyui_bf16.safetensors",
++ description="LightX2V step-distillation LoRA for MiniMax H3 (Apache 2.0), 8-step v1.0 (~2 GB): "
++ "renders video+audio in ~8 denoising steps instead of ~50. Apply at strength 1.0 and lower "
++ "Steps to 8. Works with the full and the pruned int8 transformers.",
++ type=ModelType.LoRA,
++ format=ModelFormat.LyCORIS,
++)
diff --cc invokeai/frontend/web/openapi.json
index eb8cc5e4a2,53d717d319..a521e5940e
--- a/invokeai/frontend/web/openapi.json
+++ b/invokeai/frontend/web/openapi.json
@@@ -604,35 -604,6 +604,35 @@@
]
}
},
+ "/api/v2/models/capabilities": {
+ "get": {
+ "tags": ["model_manager"],
+ "summary": "List Architecture Capabilities",
- "description": "What each model architecture can generate, and which generation features it supports.\n\nA static table, the same for every install and every user, derived from what the architectures\ndeclare under `invokeai/backend/architectures/defs/`. Fetch it once and join it against model\nrecords locally: look up `(base, variant)`, fall back to `(base, null)`.\n\nDeliberately not a field on the model records themselves \u2014 it is the same for every model of an\narchitecture, and putting it there would add these fields to all 115 config schemas.\n\nAuthenticated like every other route here even though the response holds nothing user-specific:\nthe allowlist for public routes is short and deliberate, and this is not a reason to lengthen it.",
++ "description": "What each model architecture can generate, and which generation features it supports.\n\nA static table, the same for every install and every user, derived from what the architectures\ndeclare under `invokeai/backend/architectures/defs/`. Fetch it once and join it against model\nrecords locally: look up `(base, variant)`, fall back to `(base, null)`.\n\nDeliberately not a field on the model records themselves \u2014 it is the same for every model of an\narchitecture, and putting it there would add these fields to all 115 config schemas.\n\nAuthenticated like every other route here even though the response holds nothing user-specific:\nthe allowlist for public routes is short and deliberate, and this is not a reason to lengthen it.\n\nDeclared `def`, not `async def`: it awaits nothing, so FastAPI runs it in a threadpool instead of\non the event loop. See docs/contributing/blocking-work-in-api-routes.",
+ "operationId": "list_architecture_capabilities",
+ "responses": {
+ "200": {
+ "description": "What each model architecture supports",
+ "content": {
+ "application/json": {
+ "schema": {
+ "items": {
+ "$ref": "#/components/schemas/ArchitectureCapabilities"
+ },
+ "type": "array",
+ "title": "Response List Architecture Capabilities"
+ }
+ }
+ }
+ }
+ },
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ]
+ }
+ },
"/api/v2/models/": {
"get": {
"tags": ["model_manager"],
@@@ -16038,194 -16338,6 +16367,194 @@@
"$ref": "#/components/schemas/ImageOutput"
}
},
+ "ArchitectureCapabilities": {
+ "properties": {
+ "base": {
+ "$ref": "#/components/schemas/BaseModelType"
+ },
+ "variant": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Variant",
+ "description": "Null for the architecture's own row. A variant row overrides it."
+ },
+ "modality": {
+ "$ref": "#/components/schemas/ArchitectureModality"
+ },
+ "features": {
+ "$ref": "#/components/schemas/ArchitectureFeatures"
+ },
+ "defaults": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/MainModelDefaultSettings"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Recommended generation parameters, if the architecture has any."
+ }
+ },
+ "additionalProperties": false,
+ "type": "object",
+ "required": ["base", "modality", "features"],
+ "title": "ArchitectureCapabilities",
+ "description": "One row of the table."
+ },
+ "ArchitectureFeatures": {
+ "properties": {
+ "negative_prompt": {
+ "$ref": "#/components/schemas/NegativePromptPolicy"
+ },
+ "dimension_grid": {
+ "type": "integer",
+ "title": "Dimension Grid",
+ "description": "Width and height must be a multiple of this."
+ },
+ "spatial_compression": {
+ "type": "integer",
+ "title": "Spatial Compression",
+ "description": "How much smaller a latent is than the image, per side."
+ },
+ "guidance_label": {
+ "type": "string",
+ "title": "Guidance Label",
+ "description": "What to call the guidance slider: 'CFG' or 'Guidance'."
+ },
+ "scheduler_set": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": ["standard", "flow", "anima"]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Scheduler Set",
+ "description": "Which scheduler family to offer; null means no choice."
+ },
+ "scheduler_applies_to_graph": {
+ "type": "boolean",
+ "title": "Scheduler Applies To Graph",
+ "default": false
+ },
+ "control_kinds": {
+ "items": {
+ "type": "string",
+ "enum": ["controlnet", "t2i_adapter", "control_lora", "z_image_control"]
+ },
+ "type": "array",
+ "title": "Control Kinds",
+ "description": "Sorted."
+ },
+ "max_reference_images": {
+ "type": "integer",
+ "title": "Max Reference Images",
+ "default": 0
+ },
+ "reference_images_require_variant": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Reference Images Require Variant",
+ "description": "If set, reference images are only accepted for models of this variant."
+ },
+ "supports_regional_guidance": {
+ "type": "boolean",
+ "title": "Supports Regional Guidance",
+ "default": false
+ },
+ "regional_negative": {
+ "type": "boolean",
+ "title": "Regional Negative",
+ "default": false
+ },
+ "clip_skip_max": {
+ "anyOf": [
+ {
+ "type": "integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Clip Skip Max"
+ },
+ "supports_seamless": {
+ "type": "boolean",
+ "title": "Supports Seamless",
+ "default": false
+ },
+ "supports_cfg_rescale": {
+ "type": "boolean",
+ "title": "Supports Cfg Rescale",
+ "default": false
+ },
+ "sd_vae_override": {
+ "type": "boolean",
+ "title": "Sd Vae Override",
+ "default": false
+ },
+ "color_compensation": {
+ "type": "boolean",
+ "title": "Color Compensation",
+ "default": false
+ },
+ "vae_precision": {
+ "type": "boolean",
+ "title": "Vae Precision",
+ "default": false
+ }
+ },
+ "additionalProperties": false,
+ "type": "object",
+ "required": ["negative_prompt", "dimension_grid", "spatial_compression", "guidance_label"],
+ "title": "ArchitectureFeatures",
+ "description": "What a UI may offer for this architecture."
+ },
+ "ArchitectureModality": {
+ "properties": {
+ "modes": {
+ "items": {
+ "type": "string",
- "enum": ["txt2img", "img2img", "inpaint", "outpaint", "t2v", "i2v"]
++ "enum": ["txt2img", "img2img", "inpaint", "outpaint", "t2v", "i2v", "lf2v", "flf2v", "extend_video"]
+ },
+ "type": "array",
+ "title": "Modes",
+ "description": "Sorted. Empty means it generates nothing on its own."
+ },
+ "metadata_slug": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Metadata Slug",
+ "description": "Prefix its mode strings carry in image metadata; null means unprefixed."
+ }
+ },
+ "additionalProperties": false,
+ "type": "object",
+ "required": ["modes"],
+ "title": "ArchitectureModality",
+ "description": "What this architecture can produce, and what it calls it in image metadata."
+ },
"BaseMetadata": {
"properties": {
"name": {
diff --cc invokeai/frontend/web/src/services/api/schema.ts
index 2c428fc03e,391ee3083c..3178930a17
--- a/invokeai/frontend/web/src/services/api/schema.ts
+++ b/invokeai/frontend/web/src/services/api/schema.ts
@@@ -384,36 -396,6 +396,39 @@@ export type paths =
patch?: never;
trace?: never;
};
+ "/api/v2/models/capabilities": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ /**
+ * List Architecture Capabilities
+ * @description What each model architecture can generate, and which generation features it supports.
+ *
+ * A static table, the same for every install and every user, derived from what the architectures
+ * declare under `invokeai/backend/architectures/defs/`. Fetch it once and join it against model
+ * records locally: look up `(base, variant)`, fall back to `(base, null)`.
+ *
+ * Deliberately not a field on the model records themselves — it is the same for every model of an
+ * architecture, and putting it there would add these fields to all 115 config schemas.
+ *
+ * Authenticated like every other route here even though the response holds nothing user-specific:
+ * the allowlist for public routes is short and deliberate, and this is not a reason to lengthen it.
++ *
++ * Declared `def`, not `async def`: it awaits nothing, so FastAPI runs it in a threadpool instead of
++ * on the event loop. See docs/contributing/blocking-work-in-api-routes.
+ */
+ get: operations["list_architecture_capabilities"];
+ put?: never;
+ post?: never;
+ delete?: never;
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
"/api/v2/models/": {
parameters: {
query?: never;
@@@ -4640,122 -4709,6 +4742,122 @@@ export type components =
*/
type: "apply_mask_to_image";
};
+ /**
+ * ArchitectureCapabilities
+ * @description One row of the table.
+ */
+ ArchitectureCapabilities: {
+ base: components["schemas"]["BaseModelType"];
+ /**
+ * Variant
+ * @description Null for the architecture's own row. A variant row overrides it.
+ */
+ variant?: string | null;
+ modality: components["schemas"]["ArchitectureModality"];
+ features: components["schemas"]["ArchitectureFeatures"];
+ /** @description Recommended generation parameters, if the architecture has any. */
+ defaults?: components["schemas"]["MainModelDefaultSettings"] | null;
+ };
+ /**
+ * ArchitectureFeatures
+ * @description What a UI may offer for this architecture.
+ */
+ ArchitectureFeatures: {
+ negative_prompt: components["schemas"]["NegativePromptPolicy"];
+ /**
+ * Dimension Grid
+ * @description Width and height must be a multiple of this.
+ */
+ dimension_grid: number;
+ /**
+ * Spatial Compression
+ * @description How much smaller a latent is than the image, per side.
+ */
+ spatial_compression: number;
+ /**
+ * Guidance Label
+ * @description What to call the guidance slider: 'CFG' or 'Guidance'.
+ */
+ guidance_label: string;
+ /**
+ * Scheduler Set
+ * @description Which scheduler family to offer; null means no choice.
+ */
+ scheduler_set?: ("standard" | "flow" | "anima") | null;
+ /**
+ * Scheduler Applies To Graph
+ * @default false
+ */
+ scheduler_applies_to_graph?: boolean;
+ /**
+ * Control Kinds
+ * @description Sorted.
+ */
+ control_kinds?: ("controlnet" | "t2i_adapter" | "control_lora" | "z_image_control")[];
+ /**
+ * Max Reference Images
+ * @default 0
+ */
+ max_reference_images?: number;
+ /**
+ * Reference Images Require Variant
+ * @description If set, reference images are only accepted for models of this variant.
+ */
+ reference_images_require_variant?: string | null;
+ /**
+ * Supports Regional Guidance
+ * @default false
+ */
+ supports_regional_guidance?: boolean;
+ /**
+ * Regional Negative
+ * @default false
+ */
+ regional_negative?: boolean;
+ /** Clip Skip Max */
+ clip_skip_max?: number | null;
+ /**
+ * Supports Seamless
+ * @default false
+ */
+ supports_seamless?: boolean;
+ /**
+ * Supports Cfg Rescale
+ * @default false
+ */
+ supports_cfg_rescale?: boolean;
+ /**
+ * Sd Vae Override
+ * @default false
+ */
+ sd_vae_override?: boolean;
+ /**
+ * Color Compensation
+ * @default false
+ */
+ color_compensation?: boolean;
+ /**
+ * Vae Precision
+ * @default false
+ */
+ vae_precision?: boolean;
+ };
+ /**
+ * ArchitectureModality
+ * @description What this architecture can produce, and what it calls it in image metadata.
+ */
+ ArchitectureModality: {
+ /**
+ * Modes
+ * @description Sorted. Empty means it generates nothing on its own.
+ */
- modes: ("txt2img" | "img2img" | "inpaint" | "outpaint" | "t2v" | "i2v")[];
++ modes: ("txt2img" | "img2img" | "inpaint" | "outpaint" | "t2v" | "i2v" | "lf2v" | "flf2v" | "extend_video")[];
+ /**
+ * Metadata Slug
+ * @description Prefix its mode strings carry in image metadata; null means unprefixed.
+ */
+ metadata_slug?: string | null;
+ };
/**
* BaseMetadata
* @description Adds typing data for discriminated union.
diff --cc tests/app/invocations/test_minimax_h3_lora_loader.py
index 0000000000,943e429019..caa04bf5d1
mode 000000,100644..100644
--- a/tests/app/invocations/test_minimax_h3_lora_loader.py
+++ b/tests/app/invocations/test_minimax_h3_lora_loader.py
@@@ -1,0 -1,115 +1,115 @@@
+ """Tests for the MiniMax H3 LoRA loaders' metadata echo.
+
+ Regression context: the single loader gained a required ``lora_metadata`` output so a
+ workflow can record the LoRA it applied without retyping the model key. The collection
+ loader shared that output class and constructed it with no arguments, so every
+ invocation of ``minimax_h3_lora_collection_loader`` -- which the legacy Generate tab
+ inserts whenever any H3 LoRA is enabled -- raised a pydantic ValidationError. It now has
+ its own output whose echo is a list, the shape ``core_metadata.loras`` takes directly.
+ """
+
+ from unittest.mock import MagicMock
+
+ import pytest
+
-from invokeai.app.invocations.minimax_h3_lora_loader import (
++from invokeai.app.invocations.minimax_h3.minimax_h3_lora_loader import (
+ MiniMaxH3LoRACollectionLoader,
+ MiniMaxH3LoRACollectionLoaderOutput,
+ MiniMaxH3LoRALoaderInvocation,
+ )
+ from invokeai.app.invocations.model import LoRAField, MiniMaxH3TransformerField, ModelIdentifierField
+ from invokeai.backend.model_manager.taxonomy import BaseModelType, ModelType
+
+
+ def _identifier(key: str, model_type: ModelType = ModelType.LoRA) -> ModelIdentifierField:
+ return ModelIdentifierField(key=key, hash=f"hash-{key}", name=key, base=BaseModelType.MiniMaxH3, type=model_type)
+
+
+ def _transformer() -> MiniMaxH3TransformerField:
+ return MiniMaxH3TransformerField(transformer=_identifier("transformer", ModelType.Main))
+
+
+ def _context(*lora_keys: str) -> MagicMock:
+ context = MagicMock()
+ context.models.exists.side_effect = lambda key: key in lora_keys
+ context.models.get_config.side_effect = lambda key: MagicMock(type=ModelType.LoRA, base=BaseModelType.MiniMaxH3)
+ return context
+
+
+ def test_collection_loader_output_constructs_with_no_arguments() -> None:
+ """The exact regression: `invoke` builds this empty on the no-transformer path."""
+ output = MiniMaxH3LoRACollectionLoaderOutput()
+ assert output.transformer is None
+ assert output.lora_metadata == []
+
+
+ def test_collection_loader_returns_cleanly_without_a_transformer() -> None:
+ output = MiniMaxH3LoRACollectionLoader(id="n").invoke(_context())
+ assert output.transformer is None
+ assert output.lora_metadata == []
+
+
+ def test_collection_loader_echoes_every_applied_lora() -> None:
+ loras = [LoRAField(lora=_identifier("turbo"), weight=1.0), LoRAField(lora=_identifier("style"), weight=0.6)]
+ node = MiniMaxH3LoRACollectionLoader(id="n", transformer=_transformer(), loras=loras)
+
+ output = node.invoke(_context("turbo", "style"))
+
+ assert output.transformer is not None
+ assert [item.lora.key for item in output.transformer.loras] == ["turbo", "style"]
+ assert [(item.model.key, item.weight) for item in output.lora_metadata] == [("turbo", 1.0), ("style", 0.6)]
+
+
+ def test_collection_loader_skips_duplicates_in_both_the_transformer_and_the_echo() -> None:
+ transformer = _transformer()
+ transformer.loras.append(LoRAField(lora=_identifier("turbo"), weight=1.0))
+ node = MiniMaxH3LoRACollectionLoader(
+ id="n", transformer=transformer, loras=[LoRAField(lora=_identifier("turbo"), weight=0.5)]
+ )
+
+ output = node.invoke(_context("turbo"))
+
+ assert output.transformer is not None
+ assert len(output.transformer.loras) == 1
+ assert output.lora_metadata == []
+
+
+ def test_collection_loader_accepts_a_single_lora() -> None:
+ node = MiniMaxH3LoRACollectionLoader(
+ id="n", transformer=_transformer(), loras=LoRAField(lora=_identifier("turbo"), weight=1.0)
+ )
+
+ output = node.invoke(_context("turbo"))
+
+ assert [item.model.key for item in output.lora_metadata] == ["turbo"]
+
+
+ def test_collection_loader_does_not_mutate_its_input_transformer() -> None:
+ transformer = _transformer()
+ node = MiniMaxH3LoRACollectionLoader(
+ id="n", transformer=transformer, loras=[LoRAField(lora=_identifier("turbo"), weight=1.0)]
+ )
+
+ node.invoke(_context("turbo"))
+
+ assert transformer.loras == []
+
+
+ def test_single_loader_echoes_the_lora_it_applied() -> None:
+ node = MiniMaxH3LoRALoaderInvocation(id="n", lora=_identifier("turbo"), weight=0.8, transformer=_transformer())
+
+ output = node.invoke(_context("turbo"))
+
+ assert output.lora_metadata.model.key == "turbo"
+ assert output.lora_metadata.weight == 0.8
+ assert output.transformer is not None
+ assert [item.lora.key for item in output.transformer.loras] == ["turbo"]
+
+
+ def test_single_loader_rejects_a_non_h3_lora() -> None:
+ node = MiniMaxH3LoRALoaderInvocation(id="n", lora=_identifier("turbo"), transformer=_transformer())
+ context = _context("turbo")
+ context.models.get_config.side_effect = lambda key: MagicMock(type=ModelType.LoRA, base=BaseModelType.Flux)
+
+ with pytest.raises(ValueError, match="is not a MiniMax H3 LoRA"):
+ node.invoke(context)
diff --cc tests/app/invocations/test_qwen_image_working_memory.py
index 5590d06182,82af54c9e4..cf8ec1bf51
--- a/tests/app/invocations/test_qwen_image_working_memory.py
+++ b/tests/app/invocations/test_qwen_image_working_memory.py
@@@ -7,8 -8,12 +8,12 @@@ import pytes
import torch
from diffusers.models.autoencoders.autoencoder_kl_qwenimage import AutoencoderKLQwenImage
-from invokeai.app.invocations.qwen_image_image_to_latents import QwenImageImageToLatentsInvocation
-from invokeai.app.invocations.qwen_image_latents_to_image import QwenImageLatentsToImageInvocation
+from invokeai.app.invocations.vae.qwen_image_image_to_latents import QwenImageImageToLatentsInvocation
+from invokeai.app.invocations.vae.qwen_image_latents_to_image import QwenImageLatentsToImageInvocation
+ from invokeai.backend.krea2.vae_compat import (
+ QWEN_IMAGE_VAE_DEFAULT_TILE_SIZE,
+ patch_qwen_image_vae_tiling,
+ )
from invokeai.backend.util.vae_working_memory import estimate_vae_working_memory_qwen_image
@@@ -164,10 -246,12 +248,14 @@@ class TestQwenImageWorkingMemory
mock_image_tensor = torch.zeros(1, 3, 512, 512)
- estimation_path = "invokeai.app.invocations.qwen_image_image_to_latents.estimate_vae_working_memory_qwen_image"
+ estimation_path = (
+ "invokeai.app.invocations.vae.qwen_image_image_to_latents.estimate_vae_working_memory_qwen_image"
+ )
+ # Stop at the encode itself: everything before it is what this test is about, and a bare
+ # `except Exception` here would also swallow a failure in the code under test.
+ mock_vae.encode.side_effect = RuntimeError("stop at encode")
+
with patch(estimation_path) as mock_estimate:
expected_memory = 1024 * 1024 * 5000 # 5GB
mock_estimate.return_value = expected_memory
@@@ -182,3 -262,326 +266,328 @@@
mock_estimate.assert_called_once()
assert mock_estimate.call_args.kwargs["operation"] == "encode"
mock_vae_info.model_on_device.assert_called_once_with(working_mem_bytes=expected_memory)
+
+ def test_qwen_image_to_latents_passes_resolved_tile_size_to_the_estimate(self):
+ """Tiling only helps if the *estimate* shrinks with it.
+
+ The cache reserves whatever the estimator returns, so enabling tiling on the VAE without
+ telling the estimator would leave it reserving the full-frame figure (~11 GB at 2560x1440)
+ and evicting models to honour it: the encode would be bounded, but nothing else would fit.
+ tile_size=0 means "use the model default", which must be resolved before estimating.
+ """
+ mock_vae, mock_vae_info = self._mock_vae_info()
+ mock_vae.encode.side_effect = RuntimeError("stop at encode")
+ # A previous invocation left a different tile size on the shared module. The resolved default
+ # must come from the constant, not from whatever is currently on the model.
+ mock_vae_info.model.tile_sample_min_height = 512
+ mock_image_tensor = torch.zeros(1, 3, 512, 512)
+
- estimation_path = "invokeai.app.invocations.qwen_image_image_to_latents.estimate_vae_working_memory_qwen_image"
++ estimation_path = (
++ "invokeai.app.invocations.vae.qwen_image_image_to_latents.estimate_vae_working_memory_qwen_image"
++ )
+
+ cases = (
+ (False, 0, None),
+ (True, 0, QWEN_IMAGE_VAE_DEFAULT_TILE_SIZE),
+ (True, 512, 512),
+ # Below the minimum the tile size is clamped, and the estimate must follow the clamp.
+ (True, 8, 64),
+ )
+ for tiled, tile_size, expected in cases:
+ with patch(estimation_path) as mock_estimate:
+ mock_estimate.return_value = 1024
+ with pytest.raises(RuntimeError, match="stop at encode"):
+ QwenImageImageToLatentsInvocation.vae_encode(
+ mock_vae_info, mock_image_tensor, tiled=tiled, tile_size=tile_size
+ )
+ assert mock_estimate.call_args.kwargs["tile_size"] == expected, f"tiled={tiled}, tile_size={tile_size}"
+
+ @pytest.mark.parametrize(
+ "tile_size, expected_min, expected_stride",
+ [
+ (0, 256, 192),
+ (512, 512, 384),
+ (128, 128, 96),
+ (8, 64, 48),
+ # 3/4 of these is 54 and 60, neither a multiple of the VAE's 8x spatial compression:
+ # the stride must be rounded down to 48 / 56 or the pixel and latent tile loops disagree.
+ (72, 72, 48),
+ (80, 80, 56),
+ ],
+ )
+ def test_image_to_latents_sets_a_matched_tile_stride(self, tile_size, expected_min, expected_stride):
+ """`enable_tiling` must always receive all four parameters.
+
+ Left out, the stride keeps whatever value the module already carries (192 by default): a
+ smaller `min` then makes the tile loops skip whole bands of the image, and a larger one grows
+ every tile without removing any. See TestQwenImageVaeTiling for the end-to-end consequence.
+ """
+ mock_vae, mock_vae_info = self._mock_vae_info()
+ mock_vae.encode.side_effect = RuntimeError("stop at encode")
+
+ with patch(
- "invokeai.app.invocations.qwen_image_image_to_latents.estimate_vae_working_memory_qwen_image",
++ "invokeai.app.invocations.vae.qwen_image_image_to_latents.estimate_vae_working_memory_qwen_image",
+ return_value=1024,
+ ):
+ with pytest.raises(RuntimeError, match="stop at encode"):
+ QwenImageImageToLatentsInvocation.vae_encode(
+ mock_vae_info, torch.zeros(1, 3, 512, 512), tiled=True, tile_size=tile_size
+ )
+
+ mock_vae.enable_tiling.assert_called_once_with(
+ tile_sample_min_height=expected_min,
+ tile_sample_min_width=expected_min,
+ tile_sample_stride_height=expected_stride,
+ tile_sample_stride_width=expected_stride,
+ )
+
+ def test_latents_to_image_sets_a_matched_tile_stride(self):
+ """Same contract on the decode node, which is where the inert-tiling bug actually was."""
+ mock_vae, mock_vae_info = self._mock_vae_info()
+ mock_vae.decode.side_effect = RuntimeError("stop at decode")
+ mock_vae.config.z_dim = 16
+ mock_vae.config.latents_mean = [0.0] * 16
+ mock_vae.config.latents_std = [1.0] * 16
+
+ mock_context = MagicMock()
+ mock_context.models.load.return_value = mock_vae_info
+ mock_context.tensors.load.return_value = torch.zeros(1, 16, 1, 64, 64)
+ mock_context.config.get.return_value.force_tiled_decode = False
+
+ with (
+ patch(
- "invokeai.app.invocations.qwen_image_latents_to_image.estimate_vae_working_memory_qwen_image",
++ "invokeai.app.invocations.vae.qwen_image_latents_to_image.estimate_vae_working_memory_qwen_image",
+ return_value=1024,
+ ) as mock_estimate,
+ patch(
- "invokeai.app.invocations.qwen_image_latents_to_image.SeamlessExt.static_patch_model",
++ "invokeai.app.invocations.vae.qwen_image_latents_to_image.SeamlessExt.static_patch_model",
+ return_value=nullcontext(),
+ ),
+ ):
+ invocation = QwenImageLatentsToImageInvocation.model_construct(
+ latents=MagicMock(latents_name="test_latents"),
+ vae=MagicMock(vae=MagicMock(), seamless_axes=[]),
+ tiled=True,
+ tile_size=512,
+ )
+ with pytest.raises(RuntimeError, match="stop at decode"):
+ invocation.invoke(mock_context)
+
+ assert mock_estimate.call_args.kwargs["tile_size"] == 512
+ mock_vae.enable_tiling.assert_called_once_with(
+ tile_sample_min_height=512,
+ tile_sample_min_width=512,
+ tile_sample_stride_height=384,
+ tile_sample_stride_width=384,
+ )
+
+ def test_latents_to_image_honours_the_global_force_tiled_decode(self):
+ """`force_tiled_decode` must reach both the VAE and the estimate, or tiling stays inert."""
+ mock_vae, mock_vae_info = self._mock_vae_info()
+ mock_vae.decode.side_effect = RuntimeError("stop at decode")
+ mock_vae.config.z_dim = 16
+ mock_vae.config.latents_mean = [0.0] * 16
+ mock_vae.config.latents_std = [1.0] * 16
+
+ mock_context = MagicMock()
+ mock_context.models.load.return_value = mock_vae_info
+ mock_context.tensors.load.return_value = torch.zeros(1, 16, 1, 64, 64)
+ mock_context.config.get.return_value.force_tiled_decode = True
+
+ with (
+ patch(
- "invokeai.app.invocations.qwen_image_latents_to_image.estimate_vae_working_memory_qwen_image",
++ "invokeai.app.invocations.vae.qwen_image_latents_to_image.estimate_vae_working_memory_qwen_image",
+ return_value=1024,
+ ) as mock_estimate,
+ patch(
- "invokeai.app.invocations.qwen_image_latents_to_image.SeamlessExt.static_patch_model",
++ "invokeai.app.invocations.vae.qwen_image_latents_to_image.SeamlessExt.static_patch_model",
+ return_value=nullcontext(),
+ ),
+ ):
+ invocation = QwenImageLatentsToImageInvocation.model_construct(
+ latents=MagicMock(latents_name="test_latents"),
+ vae=MagicMock(vae=MagicMock(), seamless_axes=[]),
+ tiled=False,
+ tile_size=0,
+ )
+ with pytest.raises(RuntimeError, match="stop at decode"):
+ invocation.invoke(mock_context)
+
+ assert mock_estimate.call_args.kwargs["tile_size"] == QWEN_IMAGE_VAE_DEFAULT_TILE_SIZE
+ mock_vae.enable_tiling.assert_called_once()
+
+
+ class TestQwenImageVaeTiling:
+ """Exercise the tiling parameters against a real (tiny, randomly initialised) Qwen-Image VAE.
+
+ The mocked tests above can only assert which arguments are passed. These assert what those
+ arguments actually do, which is where both tiling bugs lived: `AutoencoderKLQwenImage` steps its
+ tile loops by *stride* while slicing each accumulated tile to *min*, so an inherited stride
+ silently truncates the output instead of raising.
+ """
+
+ @pytest.fixture(scope="class")
+ @classmethod
+ def vae(cls):
+ # Smallest configuration that keeps the real 8x spatial compression and 16 latent channels.
+ return AutoencoderKLQwenImage(
+ base_dim=4,
+ z_dim=16,
+ dim_mult=[1, 1, 1, 1],
+ num_res_blocks=1,
+ attn_scales=[],
+ temperal_downsample=[False, True, True],
+ ).eval()
+
+ # 72 and 80 are the interesting ones: their raw 3/4 stride (54, 60) is not a multiple of 8.
+ @pytest.mark.parametrize("tile_size", [64, 72, 80, 128, 192, 256, 512])
+ def test_tiled_decode_keeps_the_full_output_size(self, vae, tile_size):
+ latents = torch.zeros(1, 16, 1, 32, 32) # -> 256x256
+ with torch.inference_mode(), patch_qwen_image_vae_tiling(vae, tile_size):
+ decoded = vae.decode(latents, return_dict=False)[0]
+ assert decoded.shape == (1, 3, 1, 256, 256)
+
+ @pytest.mark.parametrize("tile_size", [64, 72, 80, 128, 192, 256, 512])
+ def test_tiled_encode_keeps_the_full_latent_size(self, vae, tile_size):
+ image = torch.zeros(1, 3, 1, 256, 256)
+ with torch.inference_mode(), patch_qwen_image_vae_tiling(vae, tile_size):
+ latents = vae.encode(image).latent_dist.mode()
+ assert latents.shape == (1, 16, 1, 32, 32)
+
+ def test_inherited_stride_would_truncate(self, vae):
+ """Pin the failure mode the four-parameter call exists to prevent.
+
+ This is the pre-fix call: `min` only, stride left at the module's 192. If diffusers ever
+ starts deriving the stride from `min`, this test fails and the explicit stride can be dropped.
+ """
+ latents = torch.zeros(1, 16, 1, 32, 32)
+ with patch_qwen_image_vae_tiling(vae, 256):
+ vae.enable_tiling(tile_sample_min_height=128, tile_sample_min_width=128)
+ with torch.inference_mode():
+ decoded = vae.decode(latents, return_dict=False)[0]
+ assert decoded.shape == (1, 3, 1, 192, 192) # not 256x256 -- silently truncated
+
+ def test_unrounded_stride_would_misalign(self, vae):
+ """Pin the failure mode the multiple-of-8 rounding exists to prevent.
+
+ `tiled_encode` steps the tile loop by `tile_sample_stride_height` (pixels) but slices each
+ accumulated tile to `tile_sample_stride_height // spatial_compression_ratio` (latents). Unless
+ the pixel stride is exactly 8x the latent stride the two disagree, and the encode silently
+ returns a latent smaller than the image -- the same class of bug as the inherited stride, but
+ reachable from a `multiple_of=8` field value whose 3/4 stride is not itself a multiple of 8.
+ """
+ image = torch.zeros(1, 3, 1, 512, 512)
+ with patch_qwen_image_vae_tiling(vae, 72):
+ # The rounded stride the helper actually applies.
+ assert vae.tile_sample_stride_height == 48
+ with torch.inference_mode():
+ assert vae.encode(image).latent_dist.mode().shape == (1, 16, 1, 64, 64)
+
+ # ...and the un-rounded 3/4 value it deliberately avoids.
+ vae.enable_tiling(tile_sample_stride_height=54, tile_sample_stride_width=54)
+ with torch.inference_mode():
+ misaligned = vae.encode(image).latent_dist.mode()
+ assert misaligned.shape == (1, 16, 1, 57, 57) # not 64x64 -- silently truncated
+
+ def test_tiling_state_is_restored(self, vae):
+ """The VAE module belongs to the model cache and outlives the invocation.
+
+ `enable_tiling` writes the geometry onto the module and `disable_tiling` only clears
+ `use_tiling`, so without the restore a tile size set once would persist for the lifetime of
+ the cache entry -- and leak into other nodes sharing the instance.
+ """
+ before = (
+ vae.use_tiling,
+ vae.tile_sample_min_height,
+ vae.tile_sample_min_width,
+ vae.tile_sample_stride_height,
+ vae.tile_sample_stride_width,
+ )
+ with patch_qwen_image_vae_tiling(vae, 512):
+ assert vae.use_tiling is True
+ assert vae.tile_sample_min_height == 512
+ assert vae.tile_sample_stride_height == 384
+ assert (
+ vae.use_tiling,
+ vae.tile_sample_min_height,
+ vae.tile_sample_min_width,
+ vae.tile_sample_stride_height,
+ vae.tile_sample_stride_width,
+ ) == before
+
+ with patch_qwen_image_vae_tiling(vae, None):
+ assert vae.use_tiling is False
+ assert (
+ vae.use_tiling,
+ vae.tile_sample_min_height,
+ vae.tile_sample_min_width,
+ vae.tile_sample_stride_height,
+ vae.tile_sample_stride_width,
+ ) == before
+
+ def test_geometry_left_by_another_node_does_not_affect_the_decode(self, vae):
+ """`anima_latents_to_image` sets 512/384 on the same instance and never restores it.
+
+ A native-layout `qwen_image_vae` single file is classified with the Anima base, so one loaded
+ VAE can feed both nodes in a single workflow. Because all four parameters are passed
+ explicitly and the 0 sentinel resolves against a constant, the leaked geometry cannot change
+ this decode -- and is still intact afterwards for whoever set it.
+ """
+ vae.enable_tiling(
+ tile_sample_min_height=512,
+ tile_sample_min_width=512,
+ tile_sample_stride_height=384,
+ tile_sample_stride_width=384,
+ )
+ try:
+ latents = torch.zeros(1, 16, 1, 32, 32)
+ with torch.inference_mode(), patch_qwen_image_vae_tiling(vae, QWEN_IMAGE_VAE_DEFAULT_TILE_SIZE):
+ decoded = vae.decode(latents, return_dict=False)[0]
+ assert decoded.shape == (1, 3, 1, 256, 256)
+ assert vae.tile_sample_min_height == 512
+ assert vae.tile_sample_stride_height == 384
+ finally:
+ vae.disable_tiling()
+ vae.tile_sample_min_height = vae.tile_sample_min_width = 256
+ vae.tile_sample_stride_height = vae.tile_sample_stride_width = 192
+
+ def test_tile_count_is_bounded_by_the_stride_ratio(self, vae):
+ """Raising `tile_size` must remove tiles, not just enlarge them.
+
+ With a fixed stride the loops emit the same number of tiles at every `tile_size`, so compute
+ grows with `tile_size**2` -- 8x a full frame at 512px on a 2560x1440 decode. The proportional
+ stride keeps the processed area flat at ~2x regardless of tile size.
+ """
+ latent_h, latent_w = 180, 320 # 2560x1440
+ for tile_size in (256, 512, 768):
+ with patch_qwen_image_vae_tiling(vae, tile_size):
+ latent_stride = vae.tile_sample_stride_height // 8
+ tiles = math.ceil(latent_h / latent_stride) * math.ceil(latent_w / latent_stride)
+ processed = tiles * tile_size * tile_size
+ assert processed / (1440 * 2560) < 2.5, f"tile_size={tile_size} processes {processed} px"
+
+ @pytest.mark.parametrize("tile_size", [0, 64, 128, 512])
+ def test_image_to_latents_node_produces_the_untiled_latent_shape(self, vae, tile_size):
+ """The whole node path, tiled, against a real VAE -- the shape must not depend on tile_size.
+
+ An undersized latent raises nothing here: it flows onward as a perfectly valid-looking tensor,
+ which is why this is asserted end-to-end rather than only on the arguments.
+ """
+ vae_info = MagicMock()
+ vae_info.model = vae
+ cm = MagicMock()
+ cm.__enter__ = MagicMock(return_value=(None, vae))
+ cm.__exit__ = MagicMock(return_value=None)
+ vae_info.model_on_device = MagicMock(return_value=cm)
+
+ with patch(
- "invokeai.app.invocations.qwen_image_image_to_latents.TorchDevice.choose_torch_device",
++ "invokeai.app.invocations.vae.qwen_image_image_to_latents.TorchDevice.choose_torch_device",
+ return_value=torch.device("cpu"),
+ ):
+ latents = QwenImageImageToLatentsInvocation.vae_encode(
+ vae_info, torch.zeros(1, 3, 256, 256), tiled=True, tile_size=tile_size
+ )
+
+ assert latents.shape == (1, 16, 1, 32, 32)
+ # And the shared module is left exactly as it was found.
+ assert (vae.use_tiling, vae.tile_sample_min_height, vae.tile_sample_stride_height) == (False, 256, 192)
diff --cc tests/backend/architectures/test_modality.py
index a0c17cabce,0000000000..7832dee375
mode 100644,000000..100644
--- a/tests/backend/architectures/test_modality.py
+++ b/tests/backend/architectures/test_modality.py
@@@ -1,83 -1,0 +1,85 @@@
+"""What each architecture can generate, and the metadata strings it writes."""
+
+from typing import get_args
+
+from invokeai.app.invocations.metadata import GENERATION_MODES
+from invokeai.backend.architectures import generative_bases
+from invokeai.backend.architectures.facets.modality import ModalityFacet, generation_modes
+from invokeai.backend.architectures.registry import get
+from invokeai.backend.model_manager.taxonomy import BaseModelType
+
+
+def test_the_declarations_reconstruct_generation_modes() -> None:
+ """The gate. `GENERATION_MODES` is a type pydantic validates metadata against; this proves the
+ architecture declarations and that literal describe the same 50 strings.
+
+ Compared rather than generated from the declarations, deliberately: the literal has to stay a
+ literal to be a type, and a mismatch in either direction is a bug worth naming. A string missing
+ from the literal means metadata that will not validate; one missing from the declarations means
+ a mode nothing can produce.
+ """
+ assert generation_modes() == frozenset(get_args(GENERATION_MODES))
+
+
+def test_every_architecture_declares_its_modality() -> None:
+ undeclared = sorted(b.value for b in generative_bases() if get(b, ModalityFacet) is None)
+ assert undeclared == []
+
+
+def test_the_slug_is_not_the_base_value() -> None:
+ """Seven of fourteen slugs differ from the enum value, which is why they are declared.
+
+ These strings sit in the metadata of every image a user has generated. Deriving them — by
+ replacing `-` with `_`, say — would produce `ideogram_4` where the truth is `ideogram4`, and
+ silently orphan every image already tagged with the old one.
+ """
+ divergent = {
+ BaseModelType.StableDiffusion3: "sd3",
+ BaseModelType.ZImage: "z_image",
+ BaseModelType.ErnieImage: "ernie_image",
+ BaseModelType.Ideogram4: "ideogram4",
+ BaseModelType.QwenImage: "qwen_image",
+ BaseModelType.Krea2: "krea2",
+ BaseModelType.MiniMaxH3: "minimax_h3",
+ }
+ for base, slug in divergent.items():
+ facet = get(base, ModalityFacet)
+ assert facet is not None and facet.metadata_slug == slug, base.value
+ assert slug != base.value, f"{base.value} would not need declaring"
+
+
+def test_stable_diffusion_writes_unprefixed_modes() -> None:
+ """SD 1.x and 2.x share the bare strings — the only two architectures with no prefix."""
+ unprefixed = sorted(
+ b.value for b in generative_bases() if (f := get(b, ModalityFacet)) is not None and f.metadata_slug is None
+ )
+ assert unprefixed == ["sd-1", "sd-2", "sdxl-refiner"]
+
+ sd1 = get(BaseModelType.StableDiffusion1, ModalityFacet)
+ assert sd1 is not None and "txt2img" in sd1.metadata_modes()
+
+
+def test_the_refiner_generates_nothing() -> None:
+ """Empty modes, so it contributes no metadata string despite having no prefix either."""
+ facet = get(BaseModelType.StableDiffusionXLRefiner, ModalityFacet)
+ assert facet is not None
+ assert facet.modes == frozenset()
+ assert facet.metadata_modes() == frozenset()
+
+
+def test_the_text_to_image_only_architectures() -> None:
+ for base in (BaseModelType.ErnieImage, BaseModelType.Ideogram4):
+ facet = get(base, ModalityFacet)
+ assert facet is not None and facet.modes == frozenset({"txt2img"}), base.value
+
+
+def test_the_video_architectures() -> None:
+ """Wan generates images at one frame and video above that; H3 is video-first."""
+ wan = get(BaseModelType.Wan, ModalityFacet)
+ h3 = get(BaseModelType.MiniMaxH3, ModalityFacet)
+ assert wan is not None and h3 is not None
+
+ assert "i2v" in wan.modes and "inpaint" in wan.modes
- assert h3.modes == frozenset({"txt2img", "t2v", "i2v"}), "H3 has no img2img, inpaint or outpaint"
++ assert h3.modes == frozenset({"txt2img", "t2v", "i2v", "lf2v", "flf2v", "extend_video"}), (
++ "H3 has no img2img, inpaint or outpaint, but does have three keyframe-conditioned video modes"
++ )