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.

Feature(backend): Add user toggle to run encoder models on CPU (#8777)

Lincoln Stein76b083809476
diff --git a/invokeai/app/invocations/cogview4_text_encoder.py b/invokeai/app/invocations/cogview4_text_encoder.py
index d7361549f7..c6ef1663cf 100644
--- a/invokeai/app/invocations/cogview4_text_encoder.py
+++ b/invokeai/app/invocations/cogview4_text_encoder.py
@@ -10,7 +10,6 @@ from invokeai.backend.stable_diffusion.diffusion.conditioning_data import (
CogView4ConditioningInfo,
ConditioningFieldData,
)
-from invokeai.backend.util.devices import TorchDevice
# The CogView4 GLM Text Encoder max sequence length set based on the default in diffusers.
COGVIEW4_GLM_MAX_SEQ_LEN = 1024
@@ -37,6 +36,8 @@ class CogView4TextEncoderInvocation(BaseInvocation):
@torch.no_grad()
def invoke(self, context: InvocationContext) -> CogView4ConditioningOutput:
glm_embeds = self._glm_encode(context, max_seq_len=COGVIEW4_GLM_MAX_SEQ_LEN)
+ # Move embeddings to CPU for storage to save VRAM
+ glm_embeds = glm_embeds.detach().to("cpu")
conditioning_data = ConditioningFieldData(conditionings=[CogView4ConditioningInfo(glm_embeds=glm_embeds)])
conditioning_name = context.conditioning.save(conditioning_data)
return CogView4ConditioningOutput.build(conditioning_name)
@@ -85,7 +86,7 @@ class CogView4TextEncoderInvocation(BaseInvocation):
)
text_input_ids = torch.cat([pad_ids, text_input_ids], dim=1)
prompt_embeds = glm_text_encoder(
- text_input_ids.to(TorchDevice.choose_torch_device()), output_hidden_states=True
+ text_input_ids.to(glm_text_encoder.device), output_hidden_states=True
).hidden_states[-2]
assert isinstance(prompt_embeds, torch.Tensor)
diff --git a/invokeai/app/invocations/compel.py b/invokeai/app/invocations/compel.py
index 3ad05bcc9b..5ce88145ff 100644
--- a/invokeai/app/invocations/compel.py
+++ b/invokeai/app/invocations/compel.py
@@ -103,7 +103,7 @@ class CompelInvocation(BaseInvocation):
textual_inversion_manager=ti_manager,
dtype_for_device_getter=TorchDevice.choose_torch_dtype,
truncate_long_prompts=False,
- device=TorchDevice.choose_torch_device(),
+ device=text_encoder.device, # Use the device the model is actually on
split_long_text_mode=SplitLongTextMode.SENTENCES,
)
@@ -212,7 +212,7 @@ class SDXLPromptInvocationBase:
truncate_long_prompts=False, # TODO:
returned_embeddings_type=ReturnedEmbeddingsType.PENULTIMATE_HIDDEN_STATES_NON_NORMALIZED, # TODO: clip skip
requires_pooled=get_pooled,
- device=TorchDevice.choose_torch_device(),
+ device=text_encoder.device, # Use the device the model is actually on
split_long_text_mode=SplitLongTextMode.SENTENCES,
)
diff --git a/invokeai/app/invocations/flux_text_encoder.py b/invokeai/app/invocations/flux_text_encoder.py
index c395a0bf22..56ebbe7fd9 100644
--- a/invokeai/app/invocations/flux_text_encoder.py
+++ b/invokeai/app/invocations/flux_text_encoder.py
@@ -58,6 +58,12 @@ class FluxTextEncoderInvocation(BaseInvocation):
# scoped. This ensures that the T5 model can be freed and gc'd before loading the CLIP model (if necessary).
t5_embeddings = self._t5_encode(context)
clip_embeddings = self._clip_encode(context)
+
+ # Move embeddings to CPU for storage to save VRAM
+ # They will be moved to the appropriate device when used by the denoiser
+ t5_embeddings = t5_embeddings.detach().to("cpu")
+ clip_embeddings = clip_embeddings.detach().to("cpu")
+
conditioning_data = ConditioningFieldData(
conditionings=[FLUXConditioningInfo(clip_embeds=clip_embeddings, t5_embeds=t5_embeddings)]
)
diff --git a/invokeai/app/invocations/sd3_text_encoder.py b/invokeai/app/invocations/sd3_text_encoder.py
index 230fdf0f60..24647c9cfc 100644
--- a/invokeai/app/invocations/sd3_text_encoder.py
+++ b/invokeai/app/invocations/sd3_text_encoder.py
@@ -21,7 +21,6 @@ from invokeai.backend.patches.layer_patcher import LayerPatcher
from invokeai.backend.patches.lora_conversions.flux_lora_constants import FLUX_LORA_CLIP_PREFIX
from invokeai.backend.patches.model_patch_raw import ModelPatchRaw
from invokeai.backend.stable_diffusion.diffusion.conditioning_data import ConditioningFieldData, SD3ConditioningInfo
-from invokeai.backend.util.devices import TorchDevice
# The SD3 T5 Max Sequence Length set based on the default in diffusers.
SD3_T5_MAX_SEQ_LEN = 256
@@ -69,6 +68,15 @@ class Sd3TextEncoderInvocation(BaseInvocation):
if self.t5_encoder is not None:
t5_embeddings = self._t5_encode(context, SD3_T5_MAX_SEQ_LEN)
+ # Move all embeddings to CPU for storage to save VRAM
+ # They will be moved to the appropriate device when used by the denoiser
+ clip_l_embeddings = clip_l_embeddings.detach().to("cpu")
+ clip_l_pooled_embeddings = clip_l_pooled_embeddings.detach().to("cpu")
+ clip_g_embeddings = clip_g_embeddings.detach().to("cpu")
+ clip_g_pooled_embeddings = clip_g_pooled_embeddings.detach().to("cpu")
+ if t5_embeddings is not None:
+ t5_embeddings = t5_embeddings.detach().to("cpu")
+
conditioning_data = ConditioningFieldData(
conditionings=[
SD3ConditioningInfo(
@@ -117,7 +125,7 @@ class Sd3TextEncoderInvocation(BaseInvocation):
f" {max_seq_len} tokens: {removed_text}"
)
- prompt_embeds = t5_text_encoder(text_input_ids.to(TorchDevice.choose_torch_device()))[0]
+ prompt_embeds = t5_text_encoder(text_input_ids.to(t5_text_encoder.device))[0]
assert isinstance(prompt_embeds, torch.Tensor)
return prompt_embeds
@@ -180,7 +188,7 @@ class Sd3TextEncoderInvocation(BaseInvocation):
f" {tokenizer_max_length} tokens: {removed_text}"
)
prompt_embeds = clip_text_encoder(
- input_ids=text_input_ids.to(TorchDevice.choose_torch_device()), output_hidden_states=True
+ input_ids=text_input_ids.to(clip_text_encoder.device), output_hidden_states=True
)
pooled_prompt_embeds = prompt_embeds[0]
prompt_embeds = prompt_embeds.hidden_states[-2]
diff --git a/invokeai/app/invocations/z_image_text_encoder.py b/invokeai/app/invocations/z_image_text_encoder.py
index cc6e947fba..06718c4897 100644
--- a/invokeai/app/invocations/z_image_text_encoder.py
+++ b/invokeai/app/invocations/z_image_text_encoder.py
@@ -57,6 +57,8 @@ class ZImageTextEncoderInvocation(BaseInvocation):
@torch.no_grad()
def invoke(self, context: InvocationContext) -> ZImageConditioningOutput:
prompt_embeds = self._encode_prompt(context, max_seq_len=Z_IMAGE_MAX_SEQ_LEN)
+ # Move embeddings to CPU for storage to save VRAM
+ prompt_embeds = prompt_embeds.detach().to("cpu")
conditioning_data = ConditioningFieldData(conditionings=[ZImageConditioningInfo(prompt_embeds=prompt_embeds)])
conditioning_name = context.conditioning.save(conditioning_data)
return ZImageConditioningOutput(
@@ -69,7 +71,6 @@ class ZImageTextEncoderInvocation(BaseInvocation):
Based on the ZImagePipeline._encode_prompt method from diffusers.
"""
prompt = self.prompt
- device = TorchDevice.choose_torch_device()
text_encoder_info = context.models.load(self.qwen3_encoder.text_encoder)
tokenizer_info = context.models.load(self.qwen3_encoder.tokenizer)
@@ -78,6 +79,9 @@ class ZImageTextEncoderInvocation(BaseInvocation):
(_, text_encoder) = exit_stack.enter_context(text_encoder_info.model_on_device())
(_, tokenizer) = exit_stack.enter_context(tokenizer_info.model_on_device())
+ # Use the device that the text_encoder is actually on
+ device = text_encoder.device
+
# Apply LoRA models to the text encoder
lora_dtype = TorchDevice.choose_bfloat16_safe_dtype(device)
exit_stack.enter_context(
diff --git a/invokeai/app/services/model_records/model_records_base.py b/invokeai/app/services/model_records/model_records_base.py
index 546790cb3e..45f9d75e3c 100644
--- a/invokeai/app/services/model_records/model_records_base.py
+++ b/invokeai/app/services/model_records/model_records_base.py
@@ -88,6 +88,7 @@ class ModelRecordChanges(BaseModelExcludeNull):
default_settings: Optional[MainModelDefaultSettings | LoraModelDefaultSettings | ControlAdapterDefaultSettings] = (
Field(description="Default settings for this model", default=None)
)
+ cpu_only: Optional[bool] = Field(description="Whether this model should run on CPU only", default=None)
# Checkpoint-specific changes
# TODO(MM2): Should we expose these? Feels footgun-y...
diff --git a/invokeai/backend/flux/modules/conditioner.py b/invokeai/backend/flux/modules/conditioner.py
index ffbbbf20dd..9deb442929 100644
--- a/invokeai/backend/flux/modules/conditioner.py
+++ b/invokeai/backend/flux/modules/conditioner.py
@@ -3,8 +3,6 @@
from torch import Tensor, nn
from transformers import PreTrainedModel, PreTrainedTokenizer, PreTrainedTokenizerFast
-from invokeai.backend.util.devices import TorchDevice
-
class HFEncoder(nn.Module):
def __init__(
@@ -33,8 +31,11 @@ class HFEncoder(nn.Module):
return_tensors="pt",
)
+ # Move inputs to the same device as the model to support cpu_only models
+ model_device = next(self.hf_module.parameters()).device
+
outputs = self.hf_module(
- input_ids=batch_encoding["input_ids"].to(TorchDevice.choose_torch_device()),
+ input_ids=batch_encoding["input_ids"].to(model_device),
attention_mask=None,
output_hidden_states=False,
)
diff --git a/invokeai/backend/model_manager/configs/clip_embed.py b/invokeai/backend/model_manager/configs/clip_embed.py
index 4bb24a0a63..0a07505612 100644
--- a/invokeai/backend/model_manager/configs/clip_embed.py
+++ b/invokeai/backend/model_manager/configs/clip_embed.py
@@ -41,6 +41,7 @@ class CLIPEmbed_Diffusers_Config_Base(Diffusers_Config_Base):
base: Literal[BaseModelType.Any] = Field(default=BaseModelType.Any)
type: Literal[ModelType.CLIPEmbed] = Field(default=ModelType.CLIPEmbed)
format: Literal[ModelFormat.Diffusers] = Field(default=ModelFormat.Diffusers)
+ cpu_only: bool | None = Field(default=None, description="Whether this model should run on CPU only")
@classmethod
def from_model_on_disk(cls, mod: ModelOnDisk, override_fields: dict[str, Any]) -> Self:
diff --git a/invokeai/backend/model_manager/configs/clip_vision.py b/invokeai/backend/model_manager/configs/clip_vision.py
index af5a539bc1..ac7e17e8f2 100644
--- a/invokeai/backend/model_manager/configs/clip_vision.py
+++ b/invokeai/backend/model_manager/configs/clip_vision.py
@@ -28,6 +28,7 @@ class CLIPVision_Diffusers_Config(Diffusers_Config_Base, Config_Base):
base: Literal[BaseModelType.Any] = Field(default=BaseModelType.Any)
type: Literal[ModelType.CLIPVision] = Field(default=ModelType.CLIPVision)
format: Literal[ModelFormat.Diffusers] = Field(default=ModelFormat.Diffusers)
+ cpu_only: bool | None = Field(default=None, description="Whether this model should run on CPU only")
@classmethod
def from_model_on_disk(cls, mod: ModelOnDisk, override_fields: dict[str, Any]) -> Self:
diff --git a/invokeai/backend/model_manager/configs/llava_onevision.py b/invokeai/backend/model_manager/configs/llava_onevision.py
index c6ceb43ca9..8f7ec28e39 100644
--- a/invokeai/backend/model_manager/configs/llava_onevision.py
+++ b/invokeai/backend/model_manager/configs/llava_onevision.py
@@ -25,6 +25,7 @@ class LlavaOnevision_Diffusers_Config(Diffusers_Config_Base, Config_Base):
type: Literal[ModelType.LlavaOnevision] = Field(default=ModelType.LlavaOnevision)
base: Literal[BaseModelType.Any] = Field(default=BaseModelType.Any)
+ cpu_only: bool | None = Field(default=None, description="Whether this model should run on CPU only")
@classmethod
def from_model_on_disk(cls, mod: ModelOnDisk, override_fields: dict[str, Any]) -> Self:
diff --git a/invokeai/backend/model_manager/configs/main.py b/invokeai/backend/model_manager/configs/main.py
index 9f983795ea..7f435b4482 100644
--- a/invokeai/backend/model_manager/configs/main.py
+++ b/invokeai/backend/model_manager/configs/main.py
@@ -49,6 +49,7 @@ class MainModelDefaultSettings(BaseModel):
width: int | None = Field(default=None, multiple_of=8, ge=64, description="Default width for this model")
height: int | None = Field(default=None, multiple_of=8, ge=64, description="Default height for this model")
guidance: float | None = Field(default=None, ge=1, description="Default Guidance for this model")
+ cpu_only: bool | None = Field(default=None, description="Whether this model should run on CPU only")
model_config = ConfigDict(extra="forbid")
diff --git a/invokeai/backend/model_manager/configs/qwen3_encoder.py b/invokeai/backend/model_manager/configs/qwen3_encoder.py
index 060c6b73ac..2e24fee918 100644
--- a/invokeai/backend/model_manager/configs/qwen3_encoder.py
+++ b/invokeai/backend/model_manager/configs/qwen3_encoder.py
@@ -106,6 +106,7 @@ class Qwen3Encoder_Checkpoint_Config(Checkpoint_Config_Base, Config_Base):
base: Literal[BaseModelType.Any] = Field(default=BaseModelType.Any)
type: Literal[ModelType.Qwen3Encoder] = Field(default=ModelType.Qwen3Encoder)
format: Literal[ModelFormat.Checkpoint] = Field(default=ModelFormat.Checkpoint)
+ cpu_only: bool | None = Field(default=None, description="Whether this model should run on CPU only")
variant: Qwen3VariantType = Field(description="Qwen3 model size variant (4B or 8B)")
@classmethod
@@ -153,6 +154,7 @@ class Qwen3Encoder_Qwen3Encoder_Config(Config_Base):
base: Literal[BaseModelType.Any] = Field(default=BaseModelType.Any)
type: Literal[ModelType.Qwen3Encoder] = Field(default=ModelType.Qwen3Encoder)
format: Literal[ModelFormat.Qwen3Encoder] = Field(default=ModelFormat.Qwen3Encoder)
+ cpu_only: bool | None = Field(default=None, description="Whether this model should run on CPU only")
variant: Qwen3VariantType = Field(description="Qwen3 model size variant (4B or 8B)")
@classmethod
@@ -228,6 +230,7 @@ class Qwen3Encoder_GGUF_Config(Checkpoint_Config_Base, Config_Base):
base: Literal[BaseModelType.Any] = Field(default=BaseModelType.Any)
type: Literal[ModelType.Qwen3Encoder] = Field(default=ModelType.Qwen3Encoder)
format: Literal[ModelFormat.GGUFQuantized] = Field(default=ModelFormat.GGUFQuantized)
+ cpu_only: bool | None = Field(default=None, description="Whether this model should run on CPU only")
variant: Qwen3VariantType = Field(description="Qwen3 model size variant (4B or 8B)")
@classmethod
diff --git a/invokeai/backend/model_manager/configs/siglip.py b/invokeai/backend/model_manager/configs/siglip.py
index 62ca9494e2..328aae1737 100644
--- a/invokeai/backend/model_manager/configs/siglip.py
+++ b/invokeai/backend/model_manager/configs/siglip.py
@@ -27,6 +27,7 @@ class SigLIP_Diffusers_Config(Diffusers_Config_Base, Config_Base):
type: Literal[ModelType.SigLIP] = Field(default=ModelType.SigLIP)
format: Literal[ModelFormat.Diffusers] = Field(default=ModelFormat.Diffusers)
base: Literal[BaseModelType.Any] = Field(default=BaseModelType.Any)
+ cpu_only: bool | None = Field(default=None, description="Whether this model should run on CPU only")
@classmethod
def from_model_on_disk(cls, mod: ModelOnDisk, override_fields: dict[str, Any]) -> Self:
diff --git a/invokeai/backend/model_manager/configs/t5_encoder.py b/invokeai/backend/model_manager/configs/t5_encoder.py
index ed682e1430..2da417b10a 100644
--- a/invokeai/backend/model_manager/configs/t5_encoder.py
+++ b/invokeai/backend/model_manager/configs/t5_encoder.py
@@ -21,6 +21,7 @@ class T5Encoder_T5Encoder_Config(Config_Base):
base: Literal[BaseModelType.Any] = Field(default=BaseModelType.Any)
type: Literal[ModelType.T5Encoder] = Field(default=ModelType.T5Encoder)
format: Literal[ModelFormat.T5Encoder] = Field(default=ModelFormat.T5Encoder)
+ cpu_only: bool | None = Field(default=None, description="Whether this model should run on CPU only")
@classmethod
def from_model_on_disk(cls, mod: ModelOnDisk, override_fields: dict[str, Any]) -> Self:
@@ -50,6 +51,7 @@ class T5Encoder_BnBLLMint8_Config(Config_Base):
base: Literal[BaseModelType.Any] = Field(default=BaseModelType.Any)
type: Literal[ModelType.T5Encoder] = Field(default=ModelType.T5Encoder)
format: Literal[ModelFormat.BnbQuantizedLlmInt8b] = Field(default=ModelFormat.BnbQuantizedLlmInt8b)
+ cpu_only: bool | None = Field(default=None, description="Whether this model should run on CPU only")
@classmethod
def from_model_on_disk(cls, mod: ModelOnDisk, override_fields: dict[str, Any]) -> Self:
diff --git a/invokeai/backend/model_manager/load/load_default.py b/invokeai/backend/model_manager/load/load_default.py
index 3fb7a574f3..ea69920734 100644
--- a/invokeai/backend/model_manager/load/load_default.py
+++ b/invokeai/backend/model_manager/load/load_default.py
@@ -5,6 +5,8 @@ from logging import Logger
from pathlib import Path
from typing import Optional
+import torch
+
from invokeai.app.services.config import InvokeAIAppConfig
from invokeai.backend.model_manager.configs.base import Diffusers_Config_Base
from invokeai.backend.model_manager.configs.factory import AnyModelConfig
@@ -66,6 +68,30 @@ class ModelLoader(ModelLoaderBase):
model_base = self._app_config.models_path
return (model_base / config.path).resolve()
+ def _get_execution_device(
+ self, config: AnyModelConfig, submodel_type: Optional[SubModelType] = None
+ ) -> Optional[torch.device]:
+ """Determine the execution device for a model based on its configuration.
+
+ CPU-only execution is only applied to text encoder submodels to save VRAM while keeping
+ the denoiser on GPU for performance. Conditioning tensors are moved to GPU after encoding.
+
+ Returns:
+ torch.device("cpu") if the model should run on CPU only, None otherwise (use cache default).
+ """
+ # Check if this is a text encoder submodel of a main model with cpu_only setting
+ if hasattr(config, "default_settings") and config.default_settings is not None:
+ if hasattr(config.default_settings, "cpu_only") and config.default_settings.cpu_only is True:
+ # Only apply CPU execution to text encoder submodels
+ if submodel_type in [SubModelType.TextEncoder, SubModelType.TextEncoder2, SubModelType.TextEncoder3]:
+ return torch.device("cpu")
+
+ # Check if this is a standalone text encoder config with cpu_only field (T5Encoder, Qwen3Encoder, etc.)
+ if hasattr(config, "cpu_only") and config.cpu_only is True:
+ return torch.device("cpu")
+
+ return None
+
def _load_and_cache(self, config: AnyModelConfig, submodel_type: Optional[SubModelType] = None) -> CacheRecord:
stats_name = ":".join([config.base, config.type, config.name, (submodel_type or "")])
try:
@@ -77,9 +103,13 @@ class ModelLoader(ModelLoaderBase):
self._ram_cache.make_room(self.get_size_fs(config, Path(config.path), submodel_type))
loaded_model = self._load_model(config, submodel_type)
+ # Determine execution device from model config, considering submodel type
+ execution_device = self._get_execution_device(config, submodel_type)
+
self._ram_cache.put(
get_model_cache_key(config.key, submodel_type),
model=loaded_model,
+ execution_device=execution_device,
)
return self._ram_cache.get(key=get_model_cache_key(config.key, submodel_type), stats_name=stats_name)
diff --git a/invokeai/backend/model_manager/load/model_cache/cached_model/cached_model_only_full_load.py b/invokeai/backend/model_manager/load/model_cache/cached_model/cached_model_only_full_load.py
index e9cf889daa..bb04edef9b 100644
--- a/invokeai/backend/model_manager/load/model_cache/cached_model/cached_model_only_full_load.py
+++ b/invokeai/backend/model_manager/load/model_cache/cached_model/cached_model_only_full_load.py
@@ -60,6 +60,11 @@ class CachedModelOnlyFullLoad:
"""Return true if the model is currently in VRAM."""
return self._is_in_vram
+ @property
+ def compute_device(self) -> torch.device:
+ """Return the compute device for this model."""
+ return self._compute_device
+
def full_load_to_vram(self) -> int:
"""Load all weights into VRAM (if supported by the model).
Returns:
diff --git a/invokeai/backend/model_manager/load/model_cache/cached_model/cached_model_with_partial_load.py b/invokeai/backend/model_manager/load/model_cache/cached_model/cached_model_with_partial_load.py
index 004943c017..f80b017ba7 100644
--- a/invokeai/backend/model_manager/load/model_cache/cached_model/cached_model_with_partial_load.py
+++ b/invokeai/backend/model_manager/load/model_cache/cached_model/cached_model_with_partial_load.py
@@ -136,6 +136,11 @@ class CachedModelWithPartialLoad:
)
return self._cur_vram_bytes
+ @property
+ def compute_device(self) -> torch.device:
+ """Return the compute device for this model."""
+ return self._compute_device
+
def full_load_to_vram(self) -> int:
"""Load all weights into VRAM."""
return self.partial_load_to_vram(self.total_bytes())
diff --git a/invokeai/backend/model_manager/load/model_cache/model_cache.py b/invokeai/backend/model_manager/load/model_cache/model_cache.py
index fc48217e78..022439331c 100644
--- a/invokeai/backend/model_manager/load/model_cache/model_cache.py
+++ b/invokeai/backend/model_manager/load/model_cache/model_cache.py
@@ -316,8 +316,15 @@ class ModelCache:
@synchronized
@record_activity
- def put(self, key: str, model: AnyModel) -> None:
- """Add a model to the cache."""
+ def put(self, key: str, model: AnyModel, execution_device: Optional[torch.device] = None) -> None:
+ """Add a model to the cache.
+
+ Args:
+ key: Cache key for the model
+ model: The model to cache
+ execution_device: Optional device to use for this specific model. If None, uses the cache's default
+ execution_device. Use torch.device("cpu") to force a model to run on CPU.
+ """
if key in self._cached_models:
self._logger.debug(
f"Attempted to add model {key} ({model.__class__.__name__}), but it already exists in the cache. No action necessary."
@@ -331,20 +338,23 @@ class ModelCache:
if isinstance(model, torch.nn.Module):
apply_custom_layers_to_model(model)
+ # Use the provided execution device, or fall back to the cache's default
+ effective_execution_device = execution_device if execution_device is not None else self._execution_device
+
# Partial loading only makes sense on CUDA.
# - When running on CPU, there is no 'loading' to do.
# - When running on MPS, memory is shared with the CPU, so the default OS memory management already handles this
# well.
- running_with_cuda = self._execution_device.type == "cuda"
+ running_with_cuda = effective_execution_device.type == "cuda"
# Wrap model.
if isinstance(model, torch.nn.Module) and running_with_cuda and self._enable_partial_loading:
wrapped_model = CachedModelWithPartialLoad(
- model, self._execution_device, keep_ram_copy=self._keep_ram_copy_of_weights
+ model, effective_execution_device, keep_ram_copy=self._keep_ram_copy_of_weights
)
else:
wrapped_model = CachedModelOnlyFullLoad(
- model, self._execution_device, size, keep_ram_copy=self._keep_ram_copy_of_weights
+ model, effective_execution_device, size, keep_ram_copy=self._keep_ram_copy_of_weights
)
cache_record = CacheRecord(key=key, cached_model=wrapped_model)
@@ -428,8 +438,11 @@ class ModelCache:
f"Locking model {cache_entry.key} (Type: {cache_entry.cached_model.model.__class__.__name__})"
)
- if self._execution_device.type == "cpu":
- # Models don't need to be loaded into VRAM if we're running on CPU.
+ # Check if the model's specific compute_device is CPU, not just the cache's default execution_device
+ model_compute_device = cache_entry.cached_model.compute_device
+ if model_compute_device.type == "cpu":
+ # Models configured for CPU execution don't need to be loaded into VRAM
+ self._logger.debug(f"Model {cache_entry.key} is configured for CPU execution, skipping VRAM load")
return
try:
@@ -511,9 +524,11 @@ class ModelCache:
model_cur_vram_bytes = cache_entry.cached_model.cur_vram_bytes()
vram_available = self._get_vram_available(working_mem_bytes)
loaded_percent = model_cur_vram_bytes / model_total_bytes if model_total_bytes > 0 else 0
+ # Use the model's actual compute_device for logging, not the cache's default
+ model_device = cache_entry.cached_model.compute_device
self._logger.info(
f"Loaded model '{cache_entry.key}' ({cache_entry.cached_model.model.__class__.__name__}) onto "
- f"{self._execution_device.type} device in {(time.time() - start_time):.2f}s. "
+ f"{model_device.type} device in {(time.time() - start_time):.2f}s. "
f"Total model size: {model_total_bytes / MB:.2f}MB, "
f"VRAM: {model_cur_vram_bytes / MB:.2f}MB ({loaded_percent:.1%})"
)
diff --git a/invokeai/frontend/web/openapi.json b/invokeai/frontend/web/openapi.json
index 7cc210b531..bf6c425d91 100644
--- a/invokeai/frontend/web/openapi.json
+++ b/invokeai/frontend/web/openapi.json
@@ -239,10 +239,10 @@
"$ref": "#/components/schemas/Main_Checkpoint_SDXLRefiner_Config"
},
{
- "$ref": "#/components/schemas/Main_Checkpoint_FLUX_Config"
+ "$ref": "#/components/schemas/Main_Checkpoint_Flux2_Config"
},
{
- "$ref": "#/components/schemas/Main_Checkpoint_Flux2_Config"
+ "$ref": "#/components/schemas/Main_Checkpoint_FLUX_Config"
},
{
"$ref": "#/components/schemas/Main_Checkpoint_ZImage_Config"
@@ -250,6 +250,9 @@
{
"$ref": "#/components/schemas/Main_BnBNF4_FLUX_Config"
},
+ {
+ "$ref": "#/components/schemas/Main_GGUF_Flux2_Config"
+ },
{
"$ref": "#/components/schemas/Main_GGUF_FLUX_Config"
},
@@ -277,6 +280,9 @@
{
"$ref": "#/components/schemas/VAE_Diffusers_SDXL_Config"
},
+ {
+ "$ref": "#/components/schemas/VAE_Diffusers_Flux2_Config"
+ },
{
"$ref": "#/components/schemas/ControlNet_Checkpoint_SD1_Config"
},
@@ -512,10 +518,10 @@
"$ref": "#/components/schemas/Main_Checkpoint_SDXLRefiner_Config"
},
{
- "$ref": "#/components/schemas/Main_Checkpoint_FLUX_Config"
+ "$ref": "#/components/schemas/Main_Checkpoint_Flux2_Config"
},
{
- "$ref": "#/components/schemas/Main_Checkpoint_Flux2_Config"
+ "$ref": "#/components/schemas/Main_Checkpoint_FLUX_Config"
},
{
"$ref": "#/components/schemas/Main_Checkpoint_ZImage_Config"
@@ -523,6 +529,9 @@
{
"$ref": "#/components/schemas/Main_BnBNF4_FLUX_Config"
},
+ {
+ "$ref": "#/components/schemas/Main_GGUF_Flux2_Config"
+ },
{
"$ref": "#/components/schemas/Main_GGUF_FLUX_Config"
},
@@ -550,6 +559,9 @@
{
"$ref": "#/components/schemas/VAE_Diffusers_SDXL_Config"
},
+ {
+ "$ref": "#/components/schemas/VAE_Diffusers_Flux2_Config"
+ },
{
"$ref": "#/components/schemas/ControlNet_Checkpoint_SD1_Config"
},
@@ -830,10 +842,10 @@
"$ref": "#/components/schemas/Main_Checkpoint_SDXLRefiner_Config"
},
{
- "$ref": "#/components/schemas/Main_Checkpoint_FLUX_Config"
+ "$ref": "#/components/schemas/Main_Checkpoint_Flux2_Config"
},
{
- "$ref": "#/components/schemas/Main_Checkpoint_Flux2_Config"
+ "$ref": "#/components/schemas/Main_Checkpoint_FLUX_Config"
},
{
"$ref": "#/components/schemas/Main_Checkpoint_ZImage_Config"
@@ -841,6 +853,9 @@
{
"$ref": "#/components/schemas/Main_BnBNF4_FLUX_Config"
},
+ {
+ "$ref": "#/components/schemas/Main_GGUF_Flux2_Config"
+ },
{
"$ref": "#/components/schemas/Main_GGUF_FLUX_Config"
},
@@ -868,6 +883,9 @@
{
"$ref": "#/components/schemas/VAE_Diffusers_SDXL_Config"
},
+ {
+ "$ref": "#/components/schemas/VAE_Diffusers_Flux2_Config"
+ },
{
"$ref": "#/components/schemas/ControlNet_Checkpoint_SD1_Config"
},
@@ -1167,10 +1185,10 @@
"$ref": "#/components/schemas/Main_Checkpoint_SDXLRefiner_Config"
},
{
- "$ref": "#/components/schemas/Main_Checkpoint_FLUX_Config"
+ "$ref": "#/components/schemas/Main_Checkpoint_Flux2_Config"
},
{
- "$ref": "#/components/schemas/Main_Checkpoint_Flux2_Config"
+ "$ref": "#/components/schemas/Main_Checkpoint_FLUX_Config"
},
{
"$ref": "#/components/schemas/Main_Checkpoint_ZImage_Config"
@@ -1178,6 +1196,9 @@
{
"$ref": "#/components/schemas/Main_BnBNF4_FLUX_Config"
},
+ {
+ "$ref": "#/components/schemas/Main_GGUF_Flux2_Config"
+ },
{
"$ref": "#/components/schemas/Main_GGUF_FLUX_Config"
},
@@ -1205,6 +1226,9 @@
{
"$ref": "#/components/schemas/VAE_Diffusers_SDXL_Config"
},
+ {
+ "$ref": "#/components/schemas/VAE_Diffusers_Flux2_Config"
+ },
{
"$ref": "#/components/schemas/ControlNet_Checkpoint_SD1_Config"
},
@@ -2020,10 +2044,10 @@
"$ref": "#/components/schemas/Main_Checkpoint_SDXLRefiner_Config"
},
{
- "$ref": "#/components/schemas/Main_Checkpoint_FLUX_Config"
+ "$ref": "#/components/schemas/Main_Checkpoint_Flux2_Config"
},
{
- "$ref": "#/components/schemas/Main_Checkpoint_Flux2_Config"
+ "$ref": "#/components/schemas/Main_Checkpoint_FLUX_Config"
},
{
"$ref": "#/components/schemas/Main_Checkpoint_ZImage_Config"
@@ -2031,6 +2055,9 @@
{
"$ref": "#/components/schemas/Main_BnBNF4_FLUX_Config"
},
+ {
+ "$ref": "#/components/schemas/Main_GGUF_Flux2_Config"
+ },
{
"$ref": "#/components/schemas/Main_GGUF_FLUX_Config"
},
@@ -2058,6 +2085,9 @@
{
"$ref": "#/components/schemas/VAE_Diffusers_SDXL_Config"
},
+ {
+ "$ref": "#/components/schemas/VAE_Diffusers_Flux2_Config"
+ },
{
"$ref": "#/components/schemas/ControlNet_Checkpoint_SD1_Config"
},
@@ -7252,10 +7282,10 @@
"$ref": "#/components/schemas/Main_Checkpoint_SDXLRefiner_Config"
},
{
- "$ref": "#/components/schemas/Main_Checkpoint_FLUX_Config"
+ "$ref": "#/components/schemas/Main_Checkpoint_Flux2_Config"
},
{
- "$ref": "#/components/schemas/Main_Checkpoint_Flux2_Config"
+ "$ref": "#/components/schemas/Main_Checkpoint_FLUX_Config"
},
{
"$ref": "#/components/schemas/Main_Checkpoint_ZImage_Config"
@@ -7263,6 +7293,9 @@
{
"$ref": "#/components/schemas/Main_BnBNF4_FLUX_Config"
},
+ {
+ "$ref": "#/components/schemas/Main_GGUF_Flux2_Config"
+ },
{
"$ref": "#/components/schemas/Main_GGUF_FLUX_Config"
},
@@ -7290,6 +7323,9 @@
{
"$ref": "#/components/schemas/VAE_Diffusers_SDXL_Config"
},
+ {
+ "$ref": "#/components/schemas/VAE_Diffusers_Flux2_Config"
+ },
{
"$ref": "#/components/schemas/ControlNet_Checkpoint_SD1_Config"
},
@@ -9411,6 +9447,18 @@
"title": "Type",
"default": "clip_embed"
},
+ "cpu_only": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Cpu Only",
+ "description": "Whether this model should run on CPU only"
+ },
"variant": {
"type": "string",
"const": "gigantic",
@@ -9434,6 +9482,7 @@
"repo_variant",
"base",
"type",
+ "cpu_only",
"variant"
],
"title": "CLIPEmbed_Diffusers_G_Config"
@@ -9532,6 +9581,18 @@
"title": "Type",
"default": "clip_embed"
},
+ "cpu_only": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Cpu Only",
+ "description": "Whether this model should run on CPU only"
+ },
"variant": {
"type": "string",
"const": "large",
@@ -9555,6 +9616,7 @@
"repo_variant",
"base",
"type",
+ "cpu_only",
"variant"
],
"title": "CLIPEmbed_Diffusers_L_Config"
@@ -9809,6 +9871,18 @@
"const": "clip_vision",
"title": "Type",
"default": "clip_vision"
+ },
+ "cpu_only": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Cpu Only",
+ "description": "Whether this model should run on CPU only"
}
},
"type": "object",
@@ -9826,7 +9900,8 @@
"format",
"repo_variant",
"base",
- "type"
+ "type",
+ "cpu_only"
],
"title": "CLIPVision_Diffusers_Config",
"description": "Model config for CLIPVision."
@@ -14119,6 +14194,9 @@
"flux_inpaint",
"flux_outpaint",
"flux2_txt2img",
+ "flux2_img2img",
+ "flux2_inpaint",
+ "flux2_outpaint",
"sd3_txt2img",
"sd3_img2img",
"sd3_inpaint",
@@ -16799,6 +16877,12 @@
"title": "DownloadStartedEvent",
"type": "object"
},
+ "DyPEPreset": {
+ "description": "Predefined DyPE configurations.",
+ "enum": ["off", "auto", "4k"],
+ "title": "DyPEPreset",
+ "type": "string"
+ },
"DynamicPromptInvocation": {
"category": "prompt",
"class": "invocation",
@@ -18736,11 +18820,11 @@
"type": "integer"
},
"num_steps": {
- "default": 28,
- "description": "Number of diffusion steps. Recommended: 28 for Klein.",
+ "default": 4,
+ "description": "Number of diffusion steps. Use 4 for distilled models, 28+ for base models.",
"field_kind": "input",
"input": "any",
- "orig_default": 28,
+ "orig_default": 4,
"orig_required": false,
"title": "Num Steps",
"type": "integer"
@@ -18786,199 +18870,222 @@
"input": "connection",
"orig_required": true
},
- "type": {
- "const": "flux2_denoise",
- "default": "flux2_denoise",
- "field_kind": "node_attribute",
- "title": "type",
- "type": "string"
- }
- },
- "required": ["type", "id"],
- "tags": ["image", "flux", "flux2", "klein", "denoise"],
- "title": "FLUX2 Denoise",
- "type": "object",
- "version": "1.0.0",
- "output": {
- "$ref": "#/components/schemas/LatentsOutput"
- }
- },
- "Flux2KleinModelLoaderInvocation": {
- "category": "model",
- "class": "invocation",
- "classification": "prototype",
- "description": "Loads a Flux2 Klein model, outputting its submodels.\n\nFlux2 Klein uses Qwen3 as the text encoder instead of CLIP+T5.\nIt uses a 32-channel VAE (AutoencoderKLFlux2) instead of the 16-channel FLUX.1 VAE.\n\nWhen using a Diffusers format model, both VAE and Qwen3 encoder are extracted\nautomatically from the main model. You can override with standalone models:\n- Transformer: Always from Flux2 Klein main model\n- VAE: From main model (Diffusers) or standalone VAE\n- Qwen3 Encoder: From main model (Diffusers) or standalone Qwen3 model",
- "node_pack": "invokeai",
- "properties": {
- "id": {
- "description": "The id of this instance of an invocation. Must be unique among all instances of invocations.",
- "field_kind": "node_attribute",
- "title": "Id",
- "type": "string"
- },
- "is_intermediate": {
- "default": false,
- "description": "Whether or not this is an intermediate invocation.",
- "field_kind": "node_attribute",
- "input": "direct",
- "orig_required": true,
- "title": "Is Intermediate",
- "type": "boolean",
- "ui_hidden": false,
- "ui_type": "IsIntermediate"
- },
- "use_cache": {
- "default": true,
- "description": "Whether or not to use the cache",
- "field_kind": "node_attribute",
- "title": "Use Cache",
- "type": "boolean"
- },
- "model": {
- "$ref": "#/components/schemas/ModelIdentifierField",
- "description": "Flux model (Transformer) to load",
- "field_kind": "input",
- "input": "direct",
- "orig_required": true,
- "title": "Transformer",
- "ui_model_base": ["flux2"],
- "ui_model_type": ["main"]
- },
- "vae_model": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/ModelIdentifierField"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Standalone VAE model. Flux2 Klein uses the same VAE as FLUX (16-channel). If not provided, VAE will be loaded from the Qwen3 Source model.",
- "field_kind": "input",
- "input": "direct",
- "orig_default": null,
- "orig_required": false,
- "title": "VAE",
- "ui_model_base": ["flux", "flux2"],
- "ui_model_type": ["vae"]
- },
- "qwen3_encoder_model": {
+ "kontext_conditioning": {
"anyOf": [
{
- "$ref": "#/components/schemas/ModelIdentifierField"
+ "$ref": "#/components/schemas/FluxKontextConditioningField"
},
{
- "type": "null"
- }
- ],
- "default": null,
- "description": "Standalone Qwen3 Encoder model. If not provided, encoder will be loaded from the Qwen3 Source model.",
- "field_kind": "input",
- "input": "direct",
- "orig_default": null,
- "orig_required": false,
- "title": "Qwen3 Encoder",
- "ui_model_type": ["qwen3_encoder"]
- },
- "qwen3_source_model": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/ModelIdentifierField"
+ "items": {
+ "$ref": "#/components/schemas/FluxKontextConditioningField"
+ },
+ "type": "array"
},
{
"type": "null"
}
],
"default": null,
- "description": "Diffusers Flux2 Klein model to extract VAE and/or Qwen3 encoder from. Use this if you don't have separate VAE/Qwen3 models. Ignored if both VAE and Qwen3 Encoder are provided separately.",
+ "description": "FLUX Kontext conditioning (reference images for multi-reference image editing).",
"field_kind": "input",
- "input": "direct",
+ "input": "connection",
"orig_default": null,
"orig_required": false,
- "title": "Qwen3 Source (Diffusers)",
- "ui_model_base": ["flux2"],
- "ui_model_format": ["diffusers"],
- "ui_model_type": ["main"]
- },
- "max_seq_len": {
- "default": 512,
- "description": "Max sequence length for the Qwen3 encoder.",
- "enum": [256, 512],
- "field_kind": "input",
- "input": "any",
- "orig_default": 512,
- "orig_required": false,
- "title": "Max Seq Length",
- "type": "integer"
+ "title": "Reference Images"
},
"type": {
- "const": "flux2_klein_model_loader",
- "default": "flux2_klein_model_loader",
+ "const": "flux2_denoise",
+ "default": "flux2_denoise",
"field_kind": "node_attribute",
"title": "type",
"type": "string"
}
},
- "required": ["model", "type", "id"],
- "tags": ["model", "flux", "klein", "qwen3"],
- "title": "Main Model - Flux2 Klein",
+ "required": ["type", "id"],
+ "tags": ["image", "flux", "flux2", "klein", "denoise"],
+ "title": "FLUX2 Denoise",
"type": "object",
- "version": "1.0.0",
+ "version": "1.3.0",
"output": {
- "$ref": "#/components/schemas/Flux2KleinModelLoaderOutput"
+ "$ref": "#/components/schemas/LatentsOutput"
}
},
- "Flux2KleinModelLoaderOutput": {
- "class": "output",
- "description": "Flux2 Klein model loader output.",
- "properties": {
- "transformer": {
- "$ref": "#/components/schemas/TransformerField",
- "description": "Transformer",
- "field_kind": "output",
- "title": "Transformer",
- "ui_hidden": false
- },
- "qwen3_encoder": {
- "$ref": "#/components/schemas/Qwen3EncoderField",
- "description": "Qwen3 tokenizer and text encoder",
- "field_kind": "output",
- "title": "Qwen3 Encoder",
- "ui_hidden": false
- },
- "vae": {
- "$ref": "#/components/schemas/VAEField",
- "description": "VAE",
- "field_kind": "output",
- "title": "VAE",
- "ui_hidden": false
- },
- "max_seq_len": {
- "description": "The max sequence length for the Qwen3 encoder.",
- "enum": [256, 512],
- "field_kind": "output",
- "title": "Max Seq Length",
- "type": "integer",
- "ui_hidden": false
- },
- "type": {
- "const": "flux2_klein_model_loader_output",
- "default": "flux2_klein_model_loader_output",
- "field_kind": "node_attribute",
- "title": "type",
- "type": "string"
- }
- },
- "required": ["output_meta", "transformer", "qwen3_encoder", "vae", "max_seq_len", "type", "type"],
- "title": "Flux2KleinModelLoaderOutput",
- "type": "object"
- },
- "Flux2KleinTextEncoderInvocation": {
- "category": "conditioning",
+ "Flux2KleinModelLoaderInvocation": {
+ "category": "model",
"class": "invocation",
"classification": "prototype",
- "description": "Encodes and preps a prompt for Flux2 Klein image generation.\n\nFlux2 Klein uses Qwen3 as the text encoder, extracting hidden states from\nlayers [9, 18, 27] and stacking them for richer text representations.",
+ "description": "Loads a Flux2 Klein model, outputting its submodels.\n\nFlux2 Klein uses Qwen3 as the text encoder instead of CLIP+T5.\nIt uses a 32-channel VAE (AutoencoderKLFlux2) instead of the 16-channel FLUX.1 VAE.\n\nWhen using a Diffusers format model, both VAE and Qwen3 encoder are extracted\nautomatically from the main model. You can override with standalone models:\n- Transformer: Always from Flux2 Klein main model\n- VAE: From main model (Diffusers) or standalone VAE\n- Qwen3 Encoder: From main model (Diffusers) or standalone Qwen3 model",
+ "node_pack": "invokeai",
+ "properties": {
+ "id": {
+ "description": "The id of this instance of an invocation. Must be unique among all instances of invocations.",
+ "field_kind": "node_attribute",
+ "title": "Id",
+ "type": "string"
+ },
+ "is_intermediate": {
+ "default": false,
+ "description": "Whether or not this is an intermediate invocation.",
+ "field_kind": "node_attribute",
+ "input": "direct",
+ "orig_required": true,
+ "title": "Is Intermediate",
+ "type": "boolean",
+ "ui_hidden": false,
+ "ui_type": "IsIntermediate"
+ },
+ "use_cache": {
+ "default": true,
+ "description": "Whether or not to use the cache",
+ "field_kind": "node_attribute",
+ "title": "Use Cache",
+ "type": "boolean"
+ },
+ "model": {
+ "$ref": "#/components/schemas/ModelIdentifierField",
+ "description": "Flux model (Transformer) to load",
+ "field_kind": "input",
+ "input": "direct",
+ "orig_required": true,
+ "title": "Transformer",
+ "ui_model_base": ["flux2"],
+ "ui_model_type": ["main"]
+ },
+ "vae_model": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/ModelIdentifierField"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Standalone VAE model. Flux2 Klein uses the same VAE as FLUX (16-channel). If not provided, VAE will be loaded from the Qwen3 Source model.",
+ "field_kind": "input",
+ "input": "direct",
+ "orig_default": null,
+ "orig_required": false,
+ "title": "VAE",
+ "ui_model_base": ["flux", "flux2"],
+ "ui_model_type": ["vae"]
+ },
+ "qwen3_encoder_model": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/ModelIdentifierField"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Standalone Qwen3 Encoder model. If not provided, encoder will be loaded from the Qwen3 Source model.",
+ "field_kind": "input",
+ "input": "direct",
+ "orig_default": null,
+ "orig_required": false,
+ "title": "Qwen3 Encoder",
+ "ui_model_type": ["qwen3_encoder"]
+ },
+ "qwen3_source_model": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/ModelIdentifierField"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Diffusers Flux2 Klein model to extract VAE and/or Qwen3 encoder from. Use this if you don't have separate VAE/Qwen3 models. Ignored if both VAE and Qwen3 Encoder are provided separately.",
+ "field_kind": "input",
+ "input": "direct",
+ "orig_default": null,
+ "orig_required": false,
+ "title": "Qwen3 Source (Diffusers)",
+ "ui_model_base": ["flux2"],
+ "ui_model_format": ["diffusers"],
+ "ui_model_type": ["main"]
+ },
+ "max_seq_len": {
+ "default": 512,
+ "description": "Max sequence length for the Qwen3 encoder.",
+ "enum": [256, 512],
+ "field_kind": "input",
+ "input": "any",
+ "orig_default": 512,
+ "orig_required": false,
+ "title": "Max Seq Length",
+ "type": "integer"
+ },
+ "type": {
+ "const": "flux2_klein_model_loader",
+ "default": "flux2_klein_model_loader",
+ "field_kind": "node_attribute",
+ "title": "type",
+ "type": "string"
+ }
+ },
+ "required": ["model", "type", "id"],
+ "tags": ["model", "flux", "klein", "qwen3"],
+ "title": "Main Model - Flux2 Klein",
+ "type": "object",
+ "version": "1.0.0",
+ "output": {
+ "$ref": "#/components/schemas/Flux2KleinModelLoaderOutput"
+ }
+ },
+ "Flux2KleinModelLoaderOutput": {
+ "class": "output",
+ "description": "Flux2 Klein model loader output.",
+ "properties": {
+ "transformer": {
+ "$ref": "#/components/schemas/TransformerField",
+ "description": "Transformer",
+ "field_kind": "output",
+ "title": "Transformer",
+ "ui_hidden": false
+ },
+ "qwen3_encoder": {
+ "$ref": "#/components/schemas/Qwen3EncoderField",
+ "description": "Qwen3 tokenizer and text encoder",
+ "field_kind": "output",
+ "title": "Qwen3 Encoder",
+ "ui_hidden": false
+ },
+ "vae": {
+ "$ref": "#/components/schemas/VAEField",
+ "description": "VAE",
+ "field_kind": "output",
+ "title": "VAE",
+ "ui_hidden": false
+ },
+ "max_seq_len": {
+ "description": "The max sequence length for the Qwen3 encoder.",
+ "enum": [256, 512],
+ "field_kind": "output",
+ "title": "Max Seq Length",
+ "type": "integer",
+ "ui_hidden": false
+ },
+ "type": {
+ "const": "flux2_klein_model_loader_output",
+ "default": "flux2_klein_model_loader_output",
+ "field_kind": "node_attribute",
+ "title": "type",
+ "type": "string"
+ }
+ },
+ "required": ["output_meta", "transformer", "qwen3_encoder", "vae", "max_seq_len", "type", "type"],
+ "title": "Flux2KleinModelLoaderOutput",
+ "type": "object"
+ },
+ "Flux2KleinTextEncoderInvocation": {
+ "category": "conditioning",
+ "class": "invocation",
+ "classification": "prototype",
+ "description": "Encodes and preps a prompt for Flux2 Klein image generation.\n\nFlux2 Klein uses Qwen3 as the text encoder, extracting hidden states from\nlayers (9, 18, 27) and stacking them for richer text representations.\nThis matches the diffusers Flux2KleinPipeline implementation exactly.",
"node_pack": "invokeai",
"properties": {
"id": {
@@ -19077,7 +19184,7 @@
"tags": ["prompt", "conditioning", "flux", "klein", "qwen3"],
"title": "Prompt - Flux2 Klein",
"type": "object",
- "version": "1.0.0",
+ "version": "1.1.0",
"output": {
"$ref": "#/components/schemas/FluxConditioningOutput"
}
@@ -19192,9 +19299,87 @@
"$ref": "#/components/schemas/ImageOutput"
}
},
+ "Flux2VaeEncodeInvocation": {
+ "category": "latents",
+ "class": "invocation",
+ "classification": "prototype",
+ "description": "Encodes an image into latents using FLUX.2 Klein's 32-channel VAE.",
+ "node_pack": "invokeai",
+ "properties": {
+ "id": {
+ "description": "The id of this instance of an invocation. Must be unique among all instances of invocations.",
+ "field_kind": "node_attribute",
+ "title": "Id",
+ "type": "string"
+ },
+ "is_intermediate": {
+ "default": false,
+ "description": "Whether or not this is an intermediate invocation.",
+ "field_kind": "node_attribute",
+ "input": "direct",
+ "orig_required": true,
+ "title": "Is Intermediate",
+ "type": "boolean",
+ "ui_hidden": false,
+ "ui_type": "IsIntermediate"
+ },
+ "use_cache": {
+ "default": true,
+ "description": "Whether or not to use the cache",
+ "field_kind": "node_attribute",
+ "title": "Use Cache",
+ "type": "boolean"
+ },
+ "image": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/ImageField"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "The image to encode.",
+ "field_kind": "input",
+ "input": "any",
+ "orig_required": true
+ },
+ "vae": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/VAEField"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "VAE",
+ "field_kind": "input",
+ "input": "connection",
+ "orig_required": true
+ },
+ "type": {
+ "const": "flux2_vae_encode",
+ "default": "flux2_vae_encode",
+ "field_kind": "node_attribute",
+ "title": "type",
+ "type": "string"
+ }
+ },
+ "required": ["type", "id"],
+ "tags": ["latents", "image", "vae", "i2l", "flux2", "klein"],
+ "title": "Image to Latents - FLUX2",
+ "type": "object",
+ "version": "1.0.0",
+ "output": {
+ "$ref": "#/components/schemas/LatentsOutput"
+ }
+ },
"Flux2VariantType": {
"type": "string",
- "enum": ["klein_4b", "klein_9b"],
+ "enum": ["klein_4b", "klein_9b", "klein_9b_base"],
"title": "Flux2VariantType",
"description": "FLUX.2 model variants."
},
@@ -20036,6 +20221,53 @@
"orig_required": false,
"title": "Kontext Conditioning"
},
+ "dype_preset": {
+ "$ref": "#/components/schemas/DyPEPreset",
+ "default": "off",
+ "description": "DyPE preset for high-resolution generation. 'auto' enables automatically for resolutions > 1536px. '4k' uses optimized settings for 4K output.",
+ "field_kind": "input",
+ "input": "any",
+ "orig_default": "off",
+ "orig_required": false
+ },
+ "dype_scale": {
+ "anyOf": [
+ {
+ "maximum": 8.0,
+ "minimum": 0.0,
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "DyPE magnitude (\u03bbs). Higher values = stronger extrapolation. Only used when dype_preset is not 'off'.",
+ "field_kind": "input",
+ "input": "any",
+ "orig_default": null,
+ "orig_required": false,
+ "title": "Dype Scale"
+ },
+ "dype_exponent": {
+ "anyOf": [
+ {
+ "maximum": 1000.0,
+ "minimum": 0.0,
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "DyPE decay speed (\u03bbt). Controls transition from low to high frequency detail. Only used when dype_preset is not 'off'.",
+ "field_kind": "input",
+ "input": "any",
+ "orig_default": null,
+ "orig_required": false,
+ "title": "Dype Exponent"
+ },
"type": {
"const": "flux_denoise",
"default": "flux_denoise",
@@ -20048,7 +20280,7 @@
"tags": ["image", "flux"],
"title": "FLUX Denoise",
"type": "object",
- "version": "4.2.0",
+ "version": "4.3.0",
"output": {
"$ref": "#/components/schemas/LatentsOutput"
}
@@ -20476,6 +20708,53 @@
"orig_required": false,
"title": "Kontext Conditioning"
},
+ "dype_preset": {
+ "$ref": "#/components/schemas/DyPEPreset",
+ "default": "off",
+ "description": "DyPE preset for high-resolution generation. 'auto' enables automatically for resolutions > 1536px. '4k' uses optimized settings for 4K output.",
+ "field_kind": "input",
+ "input": "any",
+ "orig_default": "off",
+ "orig_required": false
+ },
+ "dype_scale": {
+ "anyOf": [
+ {
+ "maximum": 8.0,
+ "minimum": 0.0,
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "DyPE magnitude (\u03bbs). Higher values = stronger extrapolation. Only used when dype_preset is not 'off'.",
+ "field_kind": "input",
+ "input": "any",
+ "orig_default": null,
+ "orig_required": false,
+ "title": "Dype Scale"
+ },
+ "dype_exponent": {
+ "anyOf": [
+ {
+ "maximum": 1000.0,
+ "minimum": 0.0,
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "DyPE decay speed (\u03bbt). Controls transition from low to high frequency detail. Only used when dype_preset is not 'off'.",
+ "field_kind": "input",
+ "input": "any",
+ "orig_default": null,
+ "orig_required": false,
+ "title": "Dype Exponent"
+ },
"type": {
"const": "flux_denoise_meta",
"default": "flux_denoise_meta",
@@ -22284,6 +22563,9 @@
{
"$ref": "#/components/schemas/Flux2VaeDecodeInvocation"
},
+ {
+ "$ref": "#/components/schemas/Flux2VaeEncodeInvocation"
+ },
{
"$ref": "#/components/schemas/FluxControlLoRALoaderInvocation"
},
@@ -29235,6 +29517,9 @@
{
"$ref": "#/components/schemas/Flux2VaeDecodeInvocation"
},
+ {
+ "$ref": "#/components/schemas/Flux2VaeEncodeInvocation"
+ },
{
"$ref": "#/components/schemas/FluxControlLoRALoaderInvocation"
},
@@ -30249,6 +30534,9 @@
{
"$ref": "#/components/schemas/Flux2VaeDecodeInvocation"
},
+ {
+ "$ref": "#/components/schemas/Flux2VaeEncodeInvocation"
+ },
{
"$ref": "#/components/schemas/FluxControlLoRALoaderInvocation"
},
@@ -30962,6 +31250,9 @@
"flux2_vae_decode": {
"$ref": "#/components/schemas/ImageOutput"
},
+ "flux2_vae_encode": {
+ "$ref": "#/components/schemas/LatentsOutput"
+ },
"flux_control_lora_loader": {
"$ref": "#/components/schemas/FluxControlLoRALoaderOutput"
},
@@ -31474,233 +31765,234 @@
}
},
"required": [
- "flux2_klein_model_loader",
- "float_to_int",
- "cogview4_denoise",
- "img_scale",
- "flux_fill",
- "img_channel_offset",
+ "integer_generator",
+ "llava_onevision_vllm",
+ "depth_anything_depth_estimation",
+ "invokeai_img_blend",
+ "metadata_field_extractor",
+ "collect",
+ "integer_collection",
+ "noise",
+ "main_model_loader",
+ "float",
+ "sd3_denoise",
+ "tensor_mask_to_image",
+ "cogview4_text_encoder",
+ "mask_combine",
+ "image",
+ "denoise_latents",
+ "flux2_vae_encode",
+ "img_channel_multiply",
+ "invokeai_img_val_thresholds",
+ "alpha_mask_to_tensor",
+ "string",
"metadata_to_controlnets",
- "sd3_model_loader",
+ "lblend",
+ "prompt_template",
+ "core_metadata",
+ "lineart_edge_detection",
+ "pair_tile_image",
+ "compel",
+ "z_image_i2l",
+ "flux_kontext_image_prep",
+ "div",
+ "metadata_to_float",
+ "dw_openpose_detection",
+ "z_image_text_encoder",
+ "mask_edge",
+ "spandrel_image_to_image",
+ "image_batch",
+ "img_hue_adjust",
+ "metadata_to_integer",
+ "save_image",
+ "cogview4_l2i",
+ "canvas_v2_mask_and_crop",
+ "spandrel_image_to_image_autoscale",
+ "flux_lora_loader",
+ "flux_vae_decode",
+ "metadata_to_bool_collection",
+ "img_conv",
"hed_edge_detection",
- "z_image_denoise_meta",
- "integer_collection",
- "invokeai_img_blend",
- "crop_latents",
- "sd3_i2l",
- "sdxl_refiner_compel_prompt",
- "img_chan",
- "metadata_to_bool",
- "color_correct",
- "metadata_to_ip_adapters",
+ "flux_kontext",
+ "tile_to_properties",
+ "expand_mask_with_fade",
+ "flux_controlnet",
+ "esrgan",
+ "sdxl_lora_loader",
+ "heuristic_resize",
+ "range_of_size",
+ "controlnet",
"apply_mask_to_image",
- "lora_collection_loader",
- "color",
- "crop_image_to_bounding_box",
+ "img_watermark",
+ "img_channel_offset",
+ "infill_rgba",
+ "metadata_to_scheduler",
+ "pidi_edge_detection",
+ "color_correct",
+ "conditioning",
+ "integer_math",
+ "invokeai_img_composite",
+ "paste_image_into_bounding_box",
+ "metadata",
+ "img_noise",
+ "t2i_adapter",
+ "sdxl_lora_collection_loader",
+ "invokeai_img_dilate_erode",
+ "img_pad_crop",
+ "flux_denoise",
+ "invokeai_img_hue_adjust_plus",
+ "infill_tile",
+ "latents",
+ "float_to_int",
+ "sd3_text_encoder",
+ "flux2_klein_model_loader",
+ "tomask",
+ "ip_adapter",
+ "img_ilerp",
+ "face_mask_detection",
+ "flux2_vae_decode",
+ "get_image_mask_bounding_box",
+ "denoise_latents_meta",
"lscale",
- "depth_anything_depth_estimation",
+ "img_crop",
+ "rand_int",
+ "metadata_to_bool",
+ "invokeai_img_enhance",
+ "string_split",
+ "lresize",
"apply_tensor_mask_to_image",
- "img_conv",
- "z_image_model_loader",
+ "sdxl_refiner_model_loader",
+ "range",
+ "z_image_lora_loader",
+ "string_batch",
+ "clip_skip",
+ "string_collection",
+ "lora_selector",
+ "metadata_to_model",
+ "model_identifier",
+ "ideal_size",
+ "bounding_box",
+ "rectangle_mask",
+ "img_chan",
+ "flux_fill",
+ "z_image_denoise_meta",
+ "seamless",
+ "image_panel_layout",
"pbr_maps",
- "expand_mask_with_fade",
- "controlnet",
- "sdxl_compel_prompt",
- "invokeai_img_composite",
- "string_replace",
- "canvas_v2_mask_and_crop",
- "metadata_to_integer",
- "cogview4_model_loader",
- "flux_lora_loader",
- "integer_math",
- "img_paste",
- "sub",
+ "float_generator",
"metadata_from_image",
"flux_ip_adapter",
- "compel",
- "cv_inpaint",
"boolean",
- "z_image_i2l",
- "normal_map",
+ "prompt_from_file",
+ "float_range",
+ "metadata_to_t2i_adapters",
+ "add",
+ "invokeai_ealightness",
+ "cogview4_model_loader",
+ "calculate_image_tiles_even_split",
+ "tiled_multi_diffusion_denoise_latents",
+ "face_off",
+ "random_range",
+ "flux_text_encoder",
+ "cv_inpaint",
+ "color",
+ "metadata_to_lora_collection",
+ "round_float",
+ "merge_metadata",
+ "img_blur",
+ "lora_loader",
+ "calculate_image_tiles",
+ "image_generator",
+ "integer_batch",
+ "freeu",
+ "metadata_to_float_collection",
+ "sd3_l2i",
+ "crop_image_to_bounding_box",
"float_collection",
- "img_ilerp",
- "image_batch",
- "flux_vae_encode",
- "mask_from_id",
- "alpha_mask_to_tensor",
- "seamless",
- "range",
- "flux_vae_decode",
- "metadata_to_string_collection",
- "ideal_size",
- "sd3_text_encoder",
- "denoise_latents",
- "infill_patchmatch",
- "grounding_dino",
- "metadata_to_loras",
- "string",
+ "img_scale",
"img_nsfw",
- "z_image_text_encoder",
- "z_image_lora_loader",
- "float_generator",
- "lresize",
- "lora_loader",
+ "boolean_collection",
+ "flux_denoise_meta",
+ "sd3_i2l",
+ "vae_loader",
+ "metadata_to_loras",
+ "create_gradient_mask",
+ "scheduler",
+ "metadata_to_integer_collection",
+ "metadata_item",
+ "float_math",
+ "z_image_seed_variance_enhancer",
+ "image_collection",
+ "sd3_model_loader",
"unsharp_mask",
- "flux2_klein_text_encoder",
- "conditioning_collection",
- "metadata_to_t2i_adapters",
- "sdxl_model_loader",
- "metadata",
+ "metadata_item_linked",
"mediapipe_face_detection",
- "img_blur",
- "float_math",
- "invokeai_img_dilate_erode",
- "random_range",
- "z_image_lora_collection_loader",
- "flux2_vae_decode",
- "calculate_image_tiles_even_split",
- "cogview4_l2i",
- "float",
- "invokeai_ealightness",
- "img_resize",
- "flux_controlnet",
- "sdxl_lora_loader",
- "latents_collection",
- "invokeai_img_enhance",
- "mask_edge",
- "dynamic_prompt",
- "flux_kontext",
- "range_of_size",
- "image_mask_to_tensor",
"metadata_to_sdxl_model",
- "segment_anything",
- "integer_batch",
- "scheduler",
- "blank_image",
- "invert_tensor_mask",
+ "flux2_klein_text_encoder",
+ "sdxl_compel_prompt",
"z_image_denoise",
- "image_panel_layout",
- "metadata_to_float_collection",
- "sdxl_refiner_model_loader",
- "color_map",
- "collect",
- "metadata_to_model",
- "face_identifier",
- "mlsd_detection",
- "string_split",
- "infill_tile",
- "noise",
- "conditioning",
- "main_model_loader",
- "metadata_to_string",
+ "metadata_to_vae",
+ "cogview4_denoise",
+ "image_mask_to_tensor",
+ "sub",
+ "segment_anything",
"canvas_paste_back",
- "face_mask_detection",
- "string_join_three",
- "clip_skip",
- "metadata_to_scheduler",
+ "content_shuffle",
+ "merge_tiles_to_image",
+ "integer",
+ "normal_map",
+ "z_image_control",
+ "blank_image",
+ "iterate",
+ "sdxl_refiner_compel_prompt",
+ "string_split_neg",
+ "infill_cv2",
+ "sdxl_model_loader",
+ "img_lerp",
+ "string_generator",
+ "dynamic_prompt",
+ "z_image_lora_collection_loader",
"string_join",
- "esrgan",
- "prompt_from_file",
- "round_float",
- "boolean_collection",
- "mask_combine",
- "div",
- "lineart_edge_detection",
- "flux_denoise",
+ "lora_collection_loader",
"flux_lora_collection_loader",
- "string_collection",
- "show_image",
- "heuristic_resize",
+ "flux_vae_encode",
"flux2_denoise",
- "spandrel_image_to_image",
- "merge_metadata",
- "metadata_to_lora_collection",
- "z_image_seed_variance_enhancer",
"flux_control_lora_loader",
- "canny_edge_detection",
- "sd3_l2i",
- "lora_selector",
- "mul",
- "pair_tile_image",
- "face_off",
- "denoise_latents_meta",
- "flux_redux",
- "lineart_anime_edge_detection",
- "img_pad_crop",
- "float_range",
- "spandrel_image_to_image_autoscale",
+ "z_image_model_loader",
"l2i",
- "pidi_edge_detection",
- "sd3_denoise",
- "rand_int",
- "iterate",
- "add",
- "image",
- "save_image",
- "tile_to_properties",
- "string_generator",
- "prompt_template",
- "model_identifier",
- "infill_lama",
- "metadata_item_linked",
- "create_gradient_mask",
- "img_lerp",
- "bounding_box",
+ "color_map",
+ "lineart_anime_edge_detection",
"flux_model_loader",
- "get_image_mask_bounding_box",
- "invokeai_img_hue_adjust_plus",
- "img_watermark",
- "t2i_adapter",
- "metadata_to_float",
- "dw_openpose_detection",
- "calculate_image_tiles_min_overlap",
- "cogview4_i2l",
- "metadata_to_vae",
- "integer",
- "invokeai_img_val_thresholds",
- "tomask",
- "img_noise",
- "vae_loader",
- "z_image_control",
- "image_collection",
- "merge_tiles_to_image",
- "lblend",
- "rectangle_mask",
- "sdxl_lora_collection_loader",
- "img_crop",
- "i2l",
- "infill_cv2",
- "integer_generator",
- "metadata_to_integer_collection",
+ "invert_tensor_mask",
+ "face_identifier",
+ "img_paste",
+ "img_resize",
+ "infill_lama",
+ "canny_edge_detection",
+ "infill_patchmatch",
+ "string_join_three",
+ "float_batch",
+ "show_image",
"z_image_l2i",
- "cogview4_text_encoder",
- "infill_rgba",
- "metadata_field_extractor",
- "tensor_mask_to_image",
- "image_generator",
- "flux_kontext_image_prep",
- "core_metadata",
- "flux_text_encoder",
- "latents",
- "content_shuffle",
- "string_batch",
- "ip_adapter",
- "img_channel_multiply",
- "metadata_to_bool_collection",
- "freeu",
- "calculate_image_tiles",
- "flux_denoise_meta",
"img_mul",
- "string_split_neg",
- "create_denoise_mask",
+ "mul",
+ "conditioning_collection",
+ "calculate_image_tiles_min_overlap",
+ "mlsd_detection",
"rand_float",
+ "string_replace",
+ "grounding_dino",
"metadata_to_sdlx_loras",
- "img_hue_adjust",
- "tiled_multi_diffusion_denoise_latents",
- "float_batch",
- "llava_onevision_vllm",
- "metadata_item",
- "paste_image_into_bounding_box"
+ "crop_latents",
+ "metadata_to_ip_adapters",
+ "latents_collection",
+ "i2l",
+ "metadata_to_string_collection",
+ "create_denoise_mask",
+ "cogview4_i2l",
+ "metadata_to_string",
+ "mask_from_id",
+ "flux_redux"
]
},
"InvocationProgressEvent": {
@@ -31943,6 +32235,9 @@
{
"$ref": "#/components/schemas/Flux2VaeDecodeInvocation"
},
+ {
+ "$ref": "#/components/schemas/Flux2VaeEncodeInvocation"
+ },
{
"$ref": "#/components/schemas/FluxControlLoRALoaderInvocation"
},
@@ -32739,6 +33034,9 @@
{
"$ref": "#/components/schemas/Flux2VaeDecodeInvocation"
},
+ {
+ "$ref": "#/components/schemas/Flux2VaeEncodeInvocation"
+ },
{
"$ref": "#/components/schemas/FluxControlLoRALoaderInvocation"
},
@@ -33376,14 +33674,14 @@
"format": "path",
"title": "Convert Cache Dir",
"description": "Path to the converted models cache directory (DEPRECATED, but do not delete because it is needed for migration from previous versions).",
- "default": "models\\.convert_cache"
+ "default": "models/.convert_cache"
},
"download_cache_dir": {
"type": "string",
"format": "path",
"title": "Download Cache Dir",
"description": "Path to the directory that contains dynamically downloaded models.",
- "default": "models\\.download_cache"
+ "default": "models/.download_cache"
},
"legacy_conf_dir": {
"type": "string",
@@ -35871,6 +36169,18 @@
"const": "any",
"title": "Base",
"default": "any"
+ },
+ "cpu_only": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Cpu Only",
+ "description": "Whether this model should run on CPU only"
}
},
"type": "object",
@@ -35888,7 +36198,8 @@
"format",
"repo_variant",
"type",
- "base"
+ "base",
+ "cpu_only"
],
"title": "LlavaOnevision_Diffusers_Config",
"description": "Model config for Llava Onevision models."
@@ -38380,6 +38691,18 @@
],
"title": "Guidance",
"description": "Default Guidance for this model"
+ },
+ "cpu_only": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Cpu Only",
+ "description": "Whether this model should run on CPU only"
}
},
"additionalProperties": false,
@@ -38888,12 +39211,171 @@
},
"base": {
"type": "string",
- "const": "flux2",
+ "const": "flux2",
+ "title": "Base",
+ "default": "flux2"
+ },
+ "variant": {
+ "$ref": "#/components/schemas/Flux2VariantType"
+ }
+ },
+ "type": "object",
+ "required": [
+ "key",
+ "hash",
+ "path",
+ "file_size",
+ "name",
+ "description",
+ "source",
+ "source_type",
+ "source_api_response",
+ "cover_image",
+ "type",
+ "trigger_phrases",
+ "default_settings",
+ "config_path",
+ "format",
+ "base",
+ "variant"
+ ],
+ "title": "Main_Checkpoint_Flux2_Config",
+ "description": "Model config for FLUX.2 checkpoint models (e.g. Klein)."
+ },
+ "Main_Checkpoint_SD1_Config": {
+ "properties": {
+ "key": {
+ "type": "string",
+ "title": "Key",
+ "description": "A unique key for this model."
+ },
+ "hash": {
+ "type": "string",
+ "title": "Hash",
+ "description": "The hash of the model file(s)."
+ },
+ "path": {
+ "type": "string",
+ "title": "Path",
+ "description": "Path to the model on the filesystem. Relative paths are relative to the Invoke root directory."
+ },
+ "file_size": {
+ "type": "integer",
+ "title": "File Size",
+ "description": "The size of the model in bytes."
+ },
+ "name": {
+ "type": "string",
+ "title": "Name",
+ "description": "Name of the model."
+ },
+ "description": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Description",
+ "description": "Model description"
+ },
+ "source": {
+ "type": "string",
+ "title": "Source",
+ "description": "The original source of the model (path, URL or repo_id)."
+ },
+ "source_type": {
+ "$ref": "#/components/schemas/ModelSourceType",
+ "description": "The type of source"
+ },
+ "source_api_response": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Source Api Response",
+ "description": "The original API response from the source, as stringified JSON."
+ },
+ "cover_image": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Cover Image",
+ "description": "Url for image to preview model"
+ },
+ "type": {
+ "type": "string",
+ "const": "main",
+ "title": "Type",
+ "default": "main"
+ },
+ "trigger_phrases": {
+ "anyOf": [
+ {
+ "items": {
+ "type": "string"
+ },
+ "type": "array",
+ "uniqueItems": true
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Trigger Phrases",
+ "description": "Set of trigger phrases for this model"
+ },
+ "default_settings": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/MainModelDefaultSettings"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Default settings for this model"
+ },
+ "config_path": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Config Path",
+ "description": "Path to the config for this model, if any."
+ },
+ "format": {
+ "type": "string",
+ "const": "checkpoint",
+ "title": "Format",
+ "default": "checkpoint"
+ },
+ "prediction_type": {
+ "$ref": "#/components/schemas/SchedulerPredictionType"
+ },
+ "variant": {
+ "$ref": "#/components/schemas/ModelVariantType"
+ },
+ "base": {
+ "type": "string",
+ "const": "sd-1",
"title": "Base",
- "default": "flux2"
- },
- "variant": {
- "$ref": "#/components/schemas/Flux2VariantType"
+ "default": "sd-1"
}
},
"type": "object",
@@ -38913,13 +39395,13 @@
"default_settings",
"config_path",
"format",
- "base",
- "variant"
+ "prediction_type",
+ "variant",
+ "base"
],
- "title": "Main_Checkpoint_Flux2_Config",
- "description": "Model config for FLUX.2 checkpoint models (e.g. Klein)."
+ "title": "Main_Checkpoint_SD1_Config"
},
- "Main_Checkpoint_SD1_Config": {
+ "Main_Checkpoint_SD2_Config": {
"properties": {
"key": {
"type": "string",
@@ -39050,9 +39532,9 @@
},
"base": {
"type": "string",
- "const": "sd-1",
+ "const": "sd-2",
"title": "Base",
- "default": "sd-1"
+ "default": "sd-2"
}
},
"type": "object",
@@ -39076,9 +39558,9 @@
"variant",
"base"
],
- "title": "Main_Checkpoint_SD1_Config"
+ "title": "Main_Checkpoint_SD2_Config"
},
- "Main_Checkpoint_SD2_Config": {
+ "Main_Checkpoint_SDXLRefiner_Config": {
"properties": {
"key": {
"type": "string",
@@ -39209,9 +39691,9 @@
},
"base": {
"type": "string",
- "const": "sd-2",
+ "const": "sdxl-refiner",
"title": "Base",
- "default": "sd-2"
+ "default": "sdxl-refiner"
}
},
"type": "object",
@@ -39235,9 +39717,9 @@
"variant",
"base"
],
- "title": "Main_Checkpoint_SD2_Config"
+ "title": "Main_Checkpoint_SDXLRefiner_Config"
},
- "Main_Checkpoint_SDXLRefiner_Config": {
+ "Main_Checkpoint_SDXL_Config": {
"properties": {
"key": {
"type": "string",
@@ -39368,9 +39850,9 @@
},
"base": {
"type": "string",
- "const": "sdxl-refiner",
+ "const": "sdxl",
"title": "Base",
- "default": "sdxl-refiner"
+ "default": "sdxl"
}
},
"type": "object",
@@ -39394,9 +39876,9 @@
"variant",
"base"
],
- "title": "Main_Checkpoint_SDXLRefiner_Config"
+ "title": "Main_Checkpoint_SDXL_Config"
},
- "Main_Checkpoint_SDXL_Config": {
+ "Main_Checkpoint_ZImage_Config": {
"properties": {
"key": {
"type": "string",
@@ -39513,23 +39995,17 @@
"title": "Config Path",
"description": "Path to the config for this model, if any."
},
+ "base": {
+ "type": "string",
+ "const": "z-image",
+ "title": "Base",
+ "default": "z-image"
+ },
"format": {
"type": "string",
"const": "checkpoint",
"title": "Format",
"default": "checkpoint"
- },
- "prediction_type": {
- "$ref": "#/components/schemas/SchedulerPredictionType"
- },
- "variant": {
- "$ref": "#/components/schemas/ModelVariantType"
- },
- "base": {
- "type": "string",
- "const": "sdxl",
- "title": "Base",
- "default": "sdxl"
}
},
"type": "object",
@@ -39548,14 +40024,13 @@
"trigger_phrases",
"default_settings",
"config_path",
- "format",
- "prediction_type",
- "variant",
- "base"
+ "base",
+ "format"
],
- "title": "Main_Checkpoint_SDXL_Config"
+ "title": "Main_Checkpoint_ZImage_Config",
+ "description": "Model config for Z-Image single-file checkpoint models (safetensors, etc)."
},
- "Main_Checkpoint_ZImage_Config": {
+ "Main_Diffusers_CogView4_Config": {
"properties": {
"key": {
"type": "string",
@@ -39660,29 +40135,21 @@
],
"description": "Default settings for this model"
},
- "config_path": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Config Path",
- "description": "Path to the config for this model, if any."
+ "format": {
+ "type": "string",
+ "const": "diffusers",
+ "title": "Format",
+ "default": "diffusers"
+ },
+ "repo_variant": {
+ "$ref": "#/components/schemas/ModelRepoVariant",
+ "default": ""
},
"base": {
"type": "string",
- "const": "z-image",
+ "const": "cogview4",
"title": "Base",
- "default": "z-image"
- },
- "format": {
- "type": "string",
- "const": "checkpoint",
- "title": "Format",
- "default": "checkpoint"
+ "default": "cogview4"
}
},
"type": "object",
@@ -39700,14 +40167,13 @@
"type",
"trigger_phrases",
"default_settings",
- "config_path",
- "base",
- "format"
+ "format",
+ "repo_variant",
+ "base"
],
- "title": "Main_Checkpoint_ZImage_Config",
- "description": "Model config for Z-Image single-file checkpoint models (safetensors, etc)."
+ "title": "Main_Diffusers_CogView4_Config"
},
- "Main_Diffusers_CogView4_Config": {
+ "Main_Diffusers_FLUX_Config": {
"properties": {
"key": {
"type": "string",
@@ -39824,9 +40290,12 @@
},
"base": {
"type": "string",
- "const": "cogview4",
+ "const": "flux",
"title": "Base",
- "default": "cogview4"
+ "default": "flux"
+ },
+ "variant": {
+ "$ref": "#/components/schemas/FluxVariantType"
}
},
"type": "object",
@@ -39846,11 +40315,13 @@
"default_settings",
"format",
"repo_variant",
- "base"
+ "base",
+ "variant"
],
- "title": "Main_Diffusers_CogView4_Config"
+ "title": "Main_Diffusers_FLUX_Config",
+ "description": "Model config for FLUX.1 models in diffusers format."
},
- "Main_Diffusers_FLUX_Config": {
+ "Main_Diffusers_Flux2_Config": {
"properties": {
"key": {
"type": "string",
@@ -39967,12 +40438,12 @@
},
"base": {
"type": "string",
- "const": "flux",
+ "const": "flux2",
"title": "Base",
- "default": "flux"
+ "default": "flux2"
},
"variant": {
- "$ref": "#/components/schemas/FluxVariantType"
+ "$ref": "#/components/schemas/Flux2VariantType"
}
},
"type": "object",
@@ -39995,10 +40466,10 @@
"base",
"variant"
],
- "title": "Main_Diffusers_FLUX_Config",
- "description": "Model config for FLUX.1 models in diffusers format."
+ "title": "Main_Diffusers_Flux2_Config",
+ "description": "Model config for FLUX.2 models in diffusers format (e.g. FLUX.2 Klein)."
},
- "Main_Diffusers_Flux2_Config": {
+ "Main_Diffusers_SD1_Config": {
"properties": {
"key": {
"type": "string",
@@ -40113,14 +40584,17 @@
"$ref": "#/components/schemas/ModelRepoVariant",
"default": ""
},
+ "prediction_type": {
+ "$ref": "#/components/schemas/SchedulerPredictionType"
+ },
+ "variant": {
+ "$ref": "#/components/schemas/ModelVariantType"
+ },
"base": {
"type": "string",
- "const": "flux2",
+ "const": "sd-1",
"title": "Base",
- "default": "flux2"
- },
- "variant": {
- "$ref": "#/components/schemas/Flux2VariantType"
+ "default": "sd-1"
}
},
"type": "object",
@@ -40140,13 +40614,13 @@
"default_settings",
"format",
"repo_variant",
- "base",
- "variant"
+ "prediction_type",
+ "variant",
+ "base"
],
- "title": "Main_Diffusers_Flux2_Config",
- "description": "Model config for FLUX.2 models in diffusers format (e.g. FLUX.2 Klein)."
+ "title": "Main_Diffusers_SD1_Config"
},
- "Main_Diffusers_SD1_Config": {
+ "Main_Diffusers_SD2_Config": {
"properties": {
"key": {
"type": "string",
@@ -40269,9 +40743,9 @@
},
"base": {
"type": "string",
- "const": "sd-1",
+ "const": "sd-2",
"title": "Base",
- "default": "sd-1"
+ "default": "sd-2"
}
},
"type": "object",
@@ -40295,9 +40769,9 @@
"variant",
"base"
],
- "title": "Main_Diffusers_SD1_Config"
+ "title": "Main_Diffusers_SD2_Config"
},
- "Main_Diffusers_SD2_Config": {
+ "Main_Diffusers_SD3_Config": {
"properties": {
"key": {
"type": "string",
@@ -40412,17 +40886,29 @@
"$ref": "#/components/schemas/ModelRepoVariant",
"default": ""
},
- "prediction_type": {
- "$ref": "#/components/schemas/SchedulerPredictionType"
- },
- "variant": {
- "$ref": "#/components/schemas/ModelVariantType"
- },
"base": {
"type": "string",
- "const": "sd-2",
+ "const": "sd-3",
"title": "Base",
- "default": "sd-2"
+ "default": "sd-3"
+ },
+ "submodels": {
+ "anyOf": [
+ {
+ "additionalProperties": {
+ "$ref": "#/components/schemas/SubmodelDefinition"
+ },
+ "propertyNames": {
+ "$ref": "#/components/schemas/SubModelType"
+ },
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Submodels",
+ "description": "Loadable submodels in this model"
}
},
"type": "object",
@@ -40442,13 +40928,12 @@
"default_settings",
"format",
"repo_variant",
- "prediction_type",
- "variant",
- "base"
+ "base",
+ "submodels"
],
- "title": "Main_Diffusers_SD2_Config"
+ "title": "Main_Diffusers_SD3_Config"
},
- "Main_Diffusers_SD3_Config": {
+ "Main_Diffusers_SDXLRefiner_Config": {
"properties": {
"key": {
"type": "string",
@@ -40563,29 +41048,17 @@
"$ref": "#/components/schemas/ModelRepoVariant",
"default": ""
},
+ "prediction_type": {
+ "$ref": "#/components/schemas/SchedulerPredictionType"
+ },
+ "variant": {
+ "$ref": "#/components/schemas/ModelVariantType"
+ },
"base": {
"type": "string",
- "const": "sd-3",
+ "const": "sdxl-refiner",
"title": "Base",
- "default": "sd-3"
- },
- "submodels": {
- "anyOf": [
- {
- "additionalProperties": {
- "$ref": "#/components/schemas/SubmodelDefinition"
- },
- "propertyNames": {
- "$ref": "#/components/schemas/SubModelType"
- },
- "type": "object"
- },
- {
- "type": "null"
- }
- ],
- "title": "Submodels",
- "description": "Loadable submodels in this model"
+ "default": "sdxl-refiner"
}
},
"type": "object",
@@ -40605,12 +41078,13 @@
"default_settings",
"format",
"repo_variant",
- "base",
- "submodels"
+ "prediction_type",
+ "variant",
+ "base"
],
- "title": "Main_Diffusers_SD3_Config"
+ "title": "Main_Diffusers_SDXLRefiner_Config"
},
- "Main_Diffusers_SDXLRefiner_Config": {
+ "Main_Diffusers_SDXL_Config": {
"properties": {
"key": {
"type": "string",
@@ -40733,9 +41207,9 @@
},
"base": {
"type": "string",
- "const": "sdxl-refiner",
+ "const": "sdxl",
"title": "Base",
- "default": "sdxl-refiner"
+ "default": "sdxl"
}
},
"type": "object",
@@ -40759,9 +41233,9 @@
"variant",
"base"
],
- "title": "Main_Diffusers_SDXLRefiner_Config"
+ "title": "Main_Diffusers_SDXL_Config"
},
- "Main_Diffusers_SDXL_Config": {
+ "Main_Diffusers_ZImage_Config": {
"properties": {
"key": {
"type": "string",
@@ -40876,17 +41350,11 @@
"$ref": "#/components/schemas/ModelRepoVariant",
"default": ""
},
- "prediction_type": {
- "$ref": "#/components/schemas/SchedulerPredictionType"
- },
- "variant": {
- "$ref": "#/components/schemas/ModelVariantType"
- },
"base": {
"type": "string",
- "const": "sdxl",
+ "const": "z-image",
"title": "Base",
- "default": "sdxl"
+ "default": "z-image"
}
},
"type": "object",
@@ -40906,13 +41374,12 @@
"default_settings",
"format",
"repo_variant",
- "prediction_type",
- "variant",
"base"
],
- "title": "Main_Diffusers_SDXL_Config"
+ "title": "Main_Diffusers_ZImage_Config",
+ "description": "Model config for Z-Image diffusers models (Z-Image-Turbo, Z-Image-Base, Z-Image-Edit)."
},
- "Main_Diffusers_ZImage_Config": {
+ "Main_GGUF_FLUX_Config": {
"properties": {
"key": {
"type": "string",
@@ -41017,21 +41484,32 @@
],
"description": "Default settings for this model"
},
- "format": {
- "type": "string",
- "const": "diffusers",
- "title": "Format",
- "default": "diffusers"
- },
- "repo_variant": {
- "$ref": "#/components/schemas/ModelRepoVariant",
- "default": ""
+ "config_path": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Config Path",
+ "description": "Path to the config for this model, if any."
},
"base": {
"type": "string",
- "const": "z-image",
+ "const": "flux",
"title": "Base",
- "default": "z-image"
+ "default": "flux"
+ },
+ "format": {
+ "type": "string",
+ "const": "gguf_quantized",
+ "title": "Format",
+ "default": "gguf_quantized"
+ },
+ "variant": {
+ "$ref": "#/components/schemas/FluxVariantType"
}
},
"type": "object",
@@ -41049,14 +41527,15 @@
"type",
"trigger_phrases",
"default_settings",
+ "config_path",
+ "base",
"format",
- "repo_variant",
- "base"
+ "variant"
],
- "title": "Main_Diffusers_ZImage_Config",
- "description": "Model config for Z-Image diffusers models (Z-Image-Turbo, Z-Image-Base, Z-Image-Edit)."
+ "title": "Main_GGUF_FLUX_Config",
+ "description": "Model config for main checkpoint models."
},
- "Main_GGUF_FLUX_Config": {
+ "Main_GGUF_Flux2_Config": {
"properties": {
"key": {
"type": "string",
@@ -41175,9 +41654,9 @@
},
"base": {
"type": "string",
- "const": "flux",
+ "const": "flux2",
"title": "Base",
- "default": "flux"
+ "default": "flux2"
},
"format": {
"type": "string",
@@ -41186,7 +41665,7 @@
"default": "gguf_quantized"
},
"variant": {
- "$ref": "#/components/schemas/FluxVariantType"
+ "$ref": "#/components/schemas/Flux2VariantType"
}
},
"type": "object",
@@ -41209,8 +41688,8 @@
"format",
"variant"
],
- "title": "Main_GGUF_FLUX_Config",
- "description": "Model config for main checkpoint models."
+ "title": "Main_GGUF_Flux2_Config",
+ "description": "Model config for GGUF-quantized FLUX.2 checkpoint models (e.g. Klein)."
},
"Main_GGUF_ZImage_Config": {
"properties": {
@@ -45147,10 +45626,10 @@
"$ref": "#/components/schemas/Main_Checkpoint_SDXLRefiner_Config"
},
{
- "$ref": "#/components/schemas/Main_Checkpoint_FLUX_Config"
+ "$ref": "#/components/schemas/Main_Checkpoint_Flux2_Config"
},
{
- "$ref": "#/components/schemas/Main_Checkpoint_Flux2_Config"
+ "$ref": "#/components/schemas/Main_Checkpoint_FLUX_Config"
},
{
"$ref": "#/components/schemas/Main_Checkpoint_ZImage_Config"
@@ -45158,6 +45637,9 @@
{
"$ref": "#/components/schemas/Main_BnBNF4_FLUX_Config"
},
+ {
+ "$ref": "#/components/schemas/Main_GGUF_Flux2_Config"
+ },
{
"$ref": "#/components/schemas/Main_GGUF_FLUX_Config"
},
@@ -45185,6 +45667,9 @@
{
"$ref": "#/components/schemas/VAE_Diffusers_SDXL_Config"
},
+ {
+ "$ref": "#/components/schemas/VAE_Diffusers_Flux2_Config"
+ },
{
"$ref": "#/components/schemas/ControlNet_Checkpoint_SD1_Config"
},
@@ -45655,10 +46140,10 @@
"$ref": "#/components/schemas/Main_Checkpoint_SDXLRefiner_Config"
},
{
- "$ref": "#/components/schemas/Main_Checkpoint_FLUX_Config"
+ "$ref": "#/components/schemas/Main_Checkpoint_Flux2_Config"
},
{
- "$ref": "#/components/schemas/Main_Checkpoint_Flux2_Config"
+ "$ref": "#/components/schemas/Main_Checkpoint_FLUX_Config"
},
{
"$ref": "#/components/schemas/Main_Checkpoint_ZImage_Config"
@@ -45666,6 +46151,9 @@
{
"$ref": "#/components/schemas/Main_BnBNF4_FLUX_Config"
},
+ {
+ "$ref": "#/components/schemas/Main_GGUF_Flux2_Config"
+ },
{
"$ref": "#/components/schemas/Main_GGUF_FLUX_Config"
},
@@ -45693,6 +46181,9 @@
{
"$ref": "#/components/schemas/VAE_Diffusers_SDXL_Config"
},
+ {
+ "$ref": "#/components/schemas/VAE_Diffusers_Flux2_Config"
+ },
{
"$ref": "#/components/schemas/ControlNet_Checkpoint_SD1_Config"
},
@@ -46056,10 +46547,10 @@
"$ref": "#/components/schemas/Main_Checkpoint_SDXLRefiner_Config"
},
{
- "$ref": "#/components/schemas/Main_Checkpoint_FLUX_Config"
+ "$ref": "#/components/schemas/Main_Checkpoint_Flux2_Config"
},
{
- "$ref": "#/components/schemas/Main_Checkpoint_Flux2_Config"
+ "$ref": "#/components/schemas/Main_Checkpoint_FLUX_Config"
},
{
"$ref": "#/components/schemas/Main_Checkpoint_ZImage_Config"
@@ -46067,6 +46558,9 @@
{
"$ref": "#/components/schemas/Main_BnBNF4_FLUX_Config"
},
+ {
+ "$ref": "#/components/schemas/Main_GGUF_Flux2_Config"
+ },
{
"$ref": "#/components/schemas/Main_GGUF_FLUX_Config"
},
@@ -46094,6 +46588,9 @@
{
"$ref": "#/components/schemas/VAE_Diffusers_SDXL_Config"
},
+ {
+ "$ref": "#/components/schemas/VAE_Diffusers_Flux2_Config"
+ },
{
"$ref": "#/components/schemas/ControlNet_Checkpoint_SD1_Config"
},
@@ -46315,10 +46812,10 @@
"$ref": "#/components/schemas/Main_Checkpoint_SDXLRefiner_Config"
},
{
- "$ref": "#/components/schemas/Main_Checkpoint_FLUX_Config"
+ "$ref": "#/components/schemas/Main_Checkpoint_Flux2_Config"
},
{
- "$ref": "#/components/schemas/Main_Checkpoint_Flux2_Config"
+ "$ref": "#/components/schemas/Main_Checkpoint_FLUX_Config"
},
{
"$ref": "#/components/schemas/Main_Checkpoint_ZImage_Config"
@@ -46326,6 +46823,9 @@
{
"$ref": "#/components/schemas/Main_BnBNF4_FLUX_Config"
},
+ {
+ "$ref": "#/components/schemas/Main_GGUF_Flux2_Config"
+ },
{
"$ref": "#/components/schemas/Main_GGUF_FLUX_Config"
},
@@ -46353,6 +46853,9 @@
{
"$ref": "#/components/schemas/VAE_Diffusers_SDXL_Config"
},
+ {
+ "$ref": "#/components/schemas/VAE_Diffusers_Flux2_Config"
+ },
{
"$ref": "#/components/schemas/ControlNet_Checkpoint_SD1_Config"
},
@@ -46737,6 +47240,18 @@
"title": "Default Settings",
"description": "Default settings for this model"
},
+ "cpu_only": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Cpu Only",
+ "description": "Whether this model should run on CPU only"
+ },
"variant": {
"anyOf": [
{
@@ -46946,10 +47461,10 @@
"$ref": "#/components/schemas/Main_Checkpoint_SDXLRefiner_Config"
},
{
- "$ref": "#/components/schemas/Main_Checkpoint_FLUX_Config"
+ "$ref": "#/components/schemas/Main_Checkpoint_Flux2_Config"
},
{
- "$ref": "#/components/schemas/Main_Checkpoint_Flux2_Config"
+ "$ref": "#/components/schemas/Main_Checkpoint_FLUX_Config"
},
{
"$ref": "#/components/schemas/Main_Checkpoint_ZImage_Config"
@@ -46957,6 +47472,9 @@
{
"$ref": "#/components/schemas/Main_BnBNF4_FLUX_Config"
},
+ {
+ "$ref": "#/components/schemas/Main_GGUF_Flux2_Config"
+ },
{
"$ref": "#/components/schemas/Main_GGUF_FLUX_Config"
},
@@ -46984,6 +47502,9 @@
{
"$ref": "#/components/schemas/VAE_Diffusers_SDXL_Config"
},
+ {
+ "$ref": "#/components/schemas/VAE_Diffusers_Flux2_Config"
+ },
{
"$ref": "#/components/schemas/ControlNet_Checkpoint_SD1_Config"
},
@@ -48732,6 +49253,18 @@
"title": "Format",
"default": "checkpoint"
},
+ "cpu_only": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Cpu Only",
+ "description": "Whether this model should run on CPU only"
+ },
"variant": {
"$ref": "#/components/schemas/Qwen3VariantType",
"description": "Qwen3 model size variant (4B or 8B)"
@@ -48753,6 +49286,7 @@
"base",
"type",
"format",
+ "cpu_only",
"variant"
],
"title": "Qwen3Encoder_Checkpoint_Config",
@@ -48830,18 +49364,147 @@
"title": "Cover Image",
"description": "Url for image to preview model"
},
- "config_path": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Config Path",
- "description": "Path to the config for this model, if any."
- },
+ "config_path": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Config Path",
+ "description": "Path to the config for this model, if any."
+ },
+ "base": {
+ "type": "string",
+ "const": "any",
+ "title": "Base",
+ "default": "any"
+ },
+ "type": {
+ "type": "string",
+ "const": "qwen3_encoder",
+ "title": "Type",
+ "default": "qwen3_encoder"
+ },
+ "format": {
+ "type": "string",
+ "const": "gguf_quantized",
+ "title": "Format",
+ "default": "gguf_quantized"
+ },
+ "cpu_only": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Cpu Only",
+ "description": "Whether this model should run on CPU only"
+ },
+ "variant": {
+ "$ref": "#/components/schemas/Qwen3VariantType",
+ "description": "Qwen3 model size variant (4B or 8B)"
+ }
+ },
+ "type": "object",
+ "required": [
+ "key",
+ "hash",
+ "path",
+ "file_size",
+ "name",
+ "description",
+ "source",
+ "source_type",
+ "source_api_response",
+ "cover_image",
+ "config_path",
+ "base",
+ "type",
+ "format",
+ "cpu_only",
+ "variant"
+ ],
+ "title": "Qwen3Encoder_GGUF_Config",
+ "description": "Configuration for GGUF-quantized Qwen3 Encoder models."
+ },
+ "Qwen3Encoder_Qwen3Encoder_Config": {
+ "properties": {
+ "key": {
+ "type": "string",
+ "title": "Key",
+ "description": "A unique key for this model."
+ },
+ "hash": {
+ "type": "string",
+ "title": "Hash",
+ "description": "The hash of the model file(s)."
+ },
+ "path": {
+ "type": "string",
+ "title": "Path",
+ "description": "Path to the model on the filesystem. Relative paths are relative to the Invoke root directory."
+ },
+ "file_size": {
+ "type": "integer",
+ "title": "File Size",
+ "description": "The size of the model in bytes."
+ },
+ "name": {
+ "type": "string",
+ "title": "Name",
+ "description": "Name of the model."
+ },
+ "description": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Description",
+ "description": "Model description"
+ },
+ "source": {
+ "type": "string",
+ "title": "Source",
+ "description": "The original source of the model (path, URL or repo_id)."
+ },
+ "source_type": {
+ "$ref": "#/components/schemas/ModelSourceType",
+ "description": "The type of source"
+ },
+ "source_api_response": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Source Api Response",
+ "description": "The original API response from the source, as stringified JSON."
+ },
+ "cover_image": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Cover Image",
+ "description": "Url for image to preview model"
+ },
"base": {
"type": "string",
"const": "any",
@@ -48856,125 +49519,21 @@
},
"format": {
"type": "string",
- "const": "gguf_quantized",
+ "const": "qwen3_encoder",
"title": "Format",
- "default": "gguf_quantized"
- },
- "variant": {
- "$ref": "#/components/schemas/Qwen3VariantType",
- "description": "Qwen3 model size variant (4B or 8B)"
- }
- },
- "type": "object",
- "required": [
- "key",
- "hash",
- "path",
- "file_size",
- "name",
- "description",
- "source",
- "source_type",
- "source_api_response",
- "cover_image",
- "config_path",
- "base",
- "type",
- "format",
- "variant"
- ],
- "title": "Qwen3Encoder_GGUF_Config",
- "description": "Configuration for GGUF-quantized Qwen3 Encoder models."
- },
- "Qwen3Encoder_Qwen3Encoder_Config": {
- "properties": {
- "key": {
- "type": "string",
- "title": "Key",
- "description": "A unique key for this model."
- },
- "hash": {
- "type": "string",
- "title": "Hash",
- "description": "The hash of the model file(s)."
- },
- "path": {
- "type": "string",
- "title": "Path",
- "description": "Path to the model on the filesystem. Relative paths are relative to the Invoke root directory."
- },
- "file_size": {
- "type": "integer",
- "title": "File Size",
- "description": "The size of the model in bytes."
- },
- "name": {
- "type": "string",
- "title": "Name",
- "description": "Name of the model."
- },
- "description": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Description",
- "description": "Model description"
- },
- "source": {
- "type": "string",
- "title": "Source",
- "description": "The original source of the model (path, URL or repo_id)."
- },
- "source_type": {
- "$ref": "#/components/schemas/ModelSourceType",
- "description": "The type of source"
+ "default": "qwen3_encoder"
},
- "source_api_response": {
+ "cpu_only": {
"anyOf": [
{
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Source Api Response",
- "description": "The original API response from the source, as stringified JSON."
- },
- "cover_image": {
- "anyOf": [
- {
- "type": "string"
+ "type": "boolean"
},
{
"type": "null"
}
],
- "title": "Cover Image",
- "description": "Url for image to preview model"
- },
- "base": {
- "type": "string",
- "const": "any",
- "title": "Base",
- "default": "any"
- },
- "type": {
- "type": "string",
- "const": "qwen3_encoder",
- "title": "Type",
- "default": "qwen3_encoder"
- },
- "format": {
- "type": "string",
- "const": "qwen3_encoder",
- "title": "Format",
- "default": "qwen3_encoder"
+ "title": "Cpu Only",
+ "description": "Whether this model should run on CPU only"
},
"variant": {
"$ref": "#/components/schemas/Qwen3VariantType",
@@ -48996,6 +49555,7 @@
"base",
"type",
"format",
+ "cpu_only",
"variant"
],
"title": "Qwen3Encoder_Qwen3Encoder_Config",
@@ -52689,6 +53249,18 @@
"const": "any",
"title": "Base",
"default": "any"
+ },
+ "cpu_only": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Cpu Only",
+ "description": "Whether this model should run on CPU only"
}
},
"type": "object",
@@ -52706,7 +53278,8 @@
"format",
"repo_variant",
"type",
- "base"
+ "base",
+ "cpu_only"
],
"title": "SigLIP_Diffusers_Config",
"description": "Model config for SigLIP."
@@ -54841,6 +55414,18 @@
"const": "bnb_quantized_int8b",
"title": "Format",
"default": "bnb_quantized_int8b"
+ },
+ "cpu_only": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Cpu Only",
+ "description": "Whether this model should run on CPU only"
}
},
"type": "object",
@@ -54857,7 +55442,8 @@
"cover_image",
"base",
"type",
- "format"
+ "format",
+ "cpu_only"
],
"title": "T5Encoder_BnBLLMint8_Config",
"description": "Configuration for T5 Encoder models quantized by bitsandbytes' LLM.int8."
@@ -54951,6 +55537,18 @@
"const": "t5_encoder",
"title": "Format",
"default": "t5_encoder"
+ },
+ "cpu_only": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Cpu Only",
+ "description": "Whether this model should run on CPU only"
}
},
"type": "object",
@@ -54967,7 +55565,8 @@
"cover_image",
"base",
"type",
- "format"
+ "format",
+ "cpu_only"
],
"title": "T5Encoder_T5Encoder_Config",
"description": "Configuration for T5 Encoder models in a bespoke, diffusers-like format. The model weights are expected to be in\na folder called text_encoder_2 inside the model directory, with a config file named model.safetensors.index.json."
@@ -57399,6 +57998,121 @@
],
"title": "VAE_Checkpoint_SDXL_Config"
},
+ "VAE_Diffusers_Flux2_Config": {
+ "properties": {
+ "key": {
+ "type": "string",
+ "title": "Key",
+ "description": "A unique key for this model."
+ },
+ "hash": {
+ "type": "string",
+ "title": "Hash",
+ "description": "The hash of the model file(s)."
+ },
+ "path": {
+ "type": "string",
+ "title": "Path",
+ "description": "Path to the model on the filesystem. Relative paths are relative to the Invoke root directory."
+ },
+ "file_size": {
+ "type": "integer",
+ "title": "File Size",
+ "description": "The size of the model in bytes."
+ },
+ "name": {
+ "type": "string",
+ "title": "Name",
+ "description": "Name of the model."
+ },
+ "description": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Description",
+ "description": "Model description"
+ },
+ "source": {
+ "type": "string",
+ "title": "Source",
+ "description": "The original source of the model (path, URL or repo_id)."
+ },
+ "source_type": {
+ "$ref": "#/components/schemas/ModelSourceType",
+ "description": "The type of source"
+ },
+ "source_api_response": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Source Api Response",
+ "description": "The original API response from the source, as stringified JSON."
+ },
+ "cover_image": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Cover Image",
+ "description": "Url for image to preview model"
+ },
+ "format": {
+ "type": "string",
+ "const": "diffusers",
+ "title": "Format",
+ "default": "diffusers"
+ },
+ "repo_variant": {
+ "$ref": "#/components/schemas/ModelRepoVariant",
+ "default": ""
+ },
+ "type": {
+ "type": "string",
+ "const": "vae",
+ "title": "Type",
+ "default": "vae"
+ },
+ "base": {
+ "type": "string",
+ "const": "flux2",
+ "title": "Base",
+ "default": "flux2"
+ }
+ },
+ "type": "object",
+ "required": [
+ "key",
+ "hash",
+ "path",
+ "file_size",
+ "name",
+ "description",
+ "source",
+ "source_type",
+ "source_api_response",
+ "cover_image",
+ "format",
+ "repo_variant",
+ "type",
+ "base"
+ ],
+ "title": "VAE_Diffusers_Flux2_Config",
+ "description": "Model config for FLUX.2 VAE models in diffusers format (AutoencoderKLFlux2)."
+ },
"VAE_Diffusers_SD1_Config": {
"properties": {
"key": {
diff --git a/invokeai/frontend/web/public/locales/en.json b/invokeai/frontend/web/public/locales/en.json
index d2ec5b7352..ddd5e53509 100644
--- a/invokeai/frontend/web/public/locales/en.json
+++ b/invokeai/frontend/web/public/locales/en.json
@@ -910,6 +910,8 @@
"convertToDiffusersHelpText4": "This is a one time process only. It might take around 30s-60s depending on the specifications of your computer.",
"convertToDiffusersHelpText5": "Please make sure you have enough disk space. Models generally vary between 2GB-7GB in size.",
"convertToDiffusersHelpText6": "Do you wish to convert this model?",
+ "cpuOnly": "CPU Only",
+ "runOnCpu": "Run text encoder model on CPU only",
"noDefaultSettings": "No default settings configured for this model. Visit the Model Manager to add default settings.",
"defaultSettings": "Default Settings",
"defaultSettingsSaved": "Default Settings Saved",
@@ -1583,8 +1585,6 @@
"problemUnpublishingWorkflow": "Problem Unpublishing Workflow",
"problemUnpublishingWorkflowDescription": "There was a problem unpublishing the workflow. Please try again.",
"workflowUnpublished": "Workflow Unpublished",
- "sentToCanvas": "Sent to Canvas",
- "sentToUpscale": "Sent to Upscale",
"promptGenerationStarted": "Prompt generation started",
"uploadAndPromptGenerationFailed": "Failed to upload image and generate prompt",
"promptExpansionFailed": "We ran into an issue. Please try prompt expansion again.",
@@ -2036,6 +2036,13 @@
"paragraphs": [
"Enable 'Optimized Image-to-Image' for a more gradual Denoise Strength scale for image-to-image and inpainting transformations with Flux models. This setting improves the ability to control the amount of change applied to an image, but may be turned off if you prefer to use the standard Denoise Strength scale. This setting is still being tuned and is in beta status."
]
+ },
+ "cpuOnly": {
+ "heading": "CPU Only",
+ "paragraphs": [
+ "When enabled, only the text encoder component will run on CPU instead of GPU.",
+ "This saves VRAM for the denoiser while only slightly impacting performance. The conditioning outputs are automatically moved to GPU for the denoiser."
+ ]
}
},
"workflows": {
@@ -2767,7 +2774,6 @@
"selectPreset": "Select Style Preset",
"noMatchingPresets": "No matching presets"
},
-
"ui": {
"tabs": {
"generate": "Generate",
diff --git a/invokeai/frontend/web/src/app/store/nanostores/util.ts b/invokeai/frontend/web/src/app/store/nanostores/util.ts
index a5a75ae8e5..6797996b21 100644
--- a/invokeai/frontend/web/src/app/store/nanostores/util.ts
+++ b/invokeai/frontend/web/src/app/store/nanostores/util.ts
@@ -5,7 +5,6 @@ import { atom } from 'nanostores';
* A fallback non-writable atom that always returns `false`, used when a nanostores atom is only conditionally available
* in a hook or component.
*
- * @knipignore
*/
export const $false: ReadableAtom<boolean> = atom(false);
/**
diff --git a/invokeai/frontend/web/src/common/components/InformationalPopover/constants.ts b/invokeai/frontend/web/src/common/components/InformationalPopover/constants.ts
index 35f2ac3378..95fa75cfa3 100644
--- a/invokeai/frontend/web/src/common/components/InformationalPopover/constants.ts
+++ b/invokeai/frontend/web/src/common/components/InformationalPopover/constants.ts
@@ -76,7 +76,8 @@ export type Feature =
| 'tileSize'
| 'tileOverlap'
| 'optimizedDenoising'
- | 'fluxDevLicense';
+ | 'fluxDevLicense'
+ | 'cpuOnly';
export type PopoverData = PopoverProps & {
image?: string;
diff --git a/invokeai/frontend/web/src/features/modelManagerV2/hooks/useEncoderModelSettings.ts b/invokeai/frontend/web/src/features/modelManagerV2/hooks/useEncoderModelSettings.ts
new file mode 100644
index 0000000000..b1521f55fc
--- /dev/null
+++ b/invokeai/frontend/web/src/features/modelManagerV2/hooks/useEncoderModelSettings.ts
@@ -0,0 +1,33 @@
+import type { EncoderModelSettingsFormData } from 'features/modelManagerV2/subpanels/ModelPanel/EncoderModelSettings/EncoderModelSettings';
+import { useMemo } from 'react';
+import type {
+ CLIPEmbedModelConfig,
+ CLIPVisionModelConfig,
+ LlavaOnevisionModelConfig,
+ Qwen3EncoderModelConfig,
+ SigLIPModelConfig,
+ T5EncoderModelConfig,
+} from 'services/api/types';
+
+type EncoderModelConfig =
+ | CLIPEmbedModelConfig
+ | T5EncoderModelConfig
+ | Qwen3EncoderModelConfig
+ | CLIPVisionModelConfig
+ | SigLIPModelConfig
+ | LlavaOnevisionModelConfig;
+
+export const useEncoderModelSettings = (modelConfig: EncoderModelConfig) => {
+ const encoderModelSettingsDefaults = useMemo<EncoderModelSettingsFormData>(() => {
+ const cpuOnly = modelConfig.cpu_only ?? false;
+
+ return {
+ cpuOnly: {
+ value: cpuOnly,
+ isEnabled: cpuOnly,
+ },
+ };
+ }, [modelConfig]);
+
+ return encoderModelSettingsDefaults;
+};
diff --git a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/EncoderModelSettings/EncoderModelSettings.tsx b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/EncoderModelSettings/EncoderModelSettings.tsx
new file mode 100644
index 0000000000..bf1690359e
--- /dev/null
+++ b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/EncoderModelSettings/EncoderModelSettings.tsx
@@ -0,0 +1,140 @@
+import { Button, Flex, FormControl, FormLabel, Heading, Switch } from '@invoke-ai/ui-library';
+import { useAppSelector } from 'app/store/storeHooks';
+import { InformationalPopover } from 'common/components/InformationalPopover/InformationalPopover';
+import { useEncoderModelSettings } from 'features/modelManagerV2/hooks/useEncoderModelSettings';
+import { selectSelectedModelKey } from 'features/modelManagerV2/store/modelManagerV2Slice';
+import type { FormField } from 'features/modelManagerV2/subpanels/ModelPanel/MainModelDefaultSettings/MainModelDefaultSettings';
+import { toast } from 'features/toast/toast';
+import type { ChangeEvent } from 'react';
+import { memo, useCallback, useMemo } from 'react';
+import type { Control, SubmitHandler } from 'react-hook-form';
+import { useController, useForm } from 'react-hook-form';
+import { useTranslation } from 'react-i18next';
+import { PiCheckBold } from 'react-icons/pi';
+import { useUpdateModelMutation } from 'services/api/endpoints/models';
+import type {
+ CLIPEmbedModelConfig,
+ CLIPVisionModelConfig,
+ LlavaOnevisionModelConfig,
+ Qwen3EncoderModelConfig,
+ SigLIPModelConfig,
+ T5EncoderModelConfig,
+} from 'services/api/types';
+
+export type EncoderModelSettingsFormData = {
+ cpuOnly: FormField<boolean>;
+};
+
+type EncoderModelConfig =
+ | CLIPEmbedModelConfig
+ | T5EncoderModelConfig
+ | Qwen3EncoderModelConfig
+ | CLIPVisionModelConfig
+ | SigLIPModelConfig
+ | LlavaOnevisionModelConfig;
+
+type Props = {
+ modelConfig: EncoderModelConfig;
+};
+
+const DefaultCpuOnly = memo((props: { name: 'cpuOnly'; control: Control<EncoderModelSettingsFormData> }) => {
+ const { field } = useController(props);
+ const { t } = useTranslation();
+
+ const onChange = useCallback(
+ (e: ChangeEvent<HTMLInputElement>) => {
+ const updatedValue = {
+ ...(field.value as FormField<boolean>),
+ value: e.target.checked,
+ isEnabled: e.target.checked,
+ };
+ field.onChange(updatedValue);
+ },
+ [field]
+ );
+
+ const value = useMemo(() => {
+ return (field.value as FormField<boolean>).value;
+ }, [field.value]);
+
+ return (
+ <FormControl>
+ <InformationalPopover feature="cpuOnly">
+ <FormLabel>{t('modelManager.runOnCpu')}</FormLabel>
+ </InformationalPopover>
+ <Switch isChecked={value} onChange={onChange} />
+ </FormControl>
+ );
+});
+
+DefaultCpuOnly.displayName = 'DefaultCpuOnly';
+
+export const EncoderModelSettings = memo(({ modelConfig }: Props) => {
+ const selectedModelKey = useAppSelector(selectSelectedModelKey);
+ const { t } = useTranslation();
+
+ const settingsDefaults = useEncoderModelSettings(modelConfig);
+ const [updateModel, { isLoading: isLoadingUpdateModel }] = useUpdateModelMutation();
+
+ const { handleSubmit, control, formState, reset } = useForm<EncoderModelSettingsFormData>({
+ defaultValues: settingsDefaults,
+ });
+
+ const onSubmit = useCallback<SubmitHandler<EncoderModelSettingsFormData>>(
+ (data) => {
+ if (!selectedModelKey) {
+ return;
+ }
+
+ const body = {
+ cpu_only: data.cpuOnly.isEnabled ? data.cpuOnly.value : null,
+ };
+
+ updateModel({
+ key: selectedModelKey,
+ body,
+ })
+ .unwrap()
+ .then((_) => {
+ toast({
+ id: 'ENCODER_SETTINGS_SAVED',
+ title: t('modelManager.settingsSaved'),
+ status: 'success',
+ });
+ reset(data);
+ })
+ .catch((error) => {
+ if (error) {
+ toast({
+ id: 'ENCODER_SETTINGS_SAVE_FAILED',
+ title: `${error.data.detail} `,
+ status: 'error',
+ });
+ }
+ });
+ },
+ [selectedModelKey, reset, updateModel, t]
+ );
+
+ return (
+ <>
+ <Flex gap="4" justifyContent="space-between" w="full" pb={4}>
+ <Heading fontSize="md">{t('modelManager.settings')}</Heading>
+ <Button
+ size="sm"
+ leftIcon={<PiCheckBold />}
+ colorScheme="invokeYellow"
+ isDisabled={!formState.isDirty}
+ onClick={handleSubmit(onSubmit)}
+ isLoading={isLoadingUpdateModel}
+ >
+ {t('common.save')}
+ </Button>
+ </Flex>
+
+ <DefaultCpuOnly control={control} name="cpuOnly" />
+ </>
+ );
+});
+
+EncoderModelSettings.displayName = 'EncoderModelSettings';
diff --git a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/ModelView.tsx b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/ModelView.tsx
index 2650d20cee..c2d20ccbbd 100644
--- a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/ModelView.tsx
+++ b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/ModelView.tsx
@@ -1,5 +1,6 @@
import { Box, Divider, Flex, SimpleGrid } from '@invoke-ai/ui-library';
import { ControlAdapterModelDefaultSettings } from 'features/modelManagerV2/subpanels/ModelPanel/ControlAdapterModelDefaultSettings/ControlAdapterModelDefaultSettings';
+import { EncoderModelSettings } from 'features/modelManagerV2/subpanels/ModelPanel/EncoderModelSettings/EncoderModelSettings';
import { LoRAModelDefaultSettings } from 'features/modelManagerV2/subpanels/ModelPanel/LoRAModelDefaultSettings/LoRAModelDefaultSettings';
import { ModelConvertButton } from 'features/modelManagerV2/subpanels/ModelPanel/ModelConvertButton';
import { ModelEditButton } from 'features/modelManagerV2/subpanels/ModelPanel/ModelEditButton';
@@ -8,7 +9,15 @@ import { TriggerPhrases } from 'features/modelManagerV2/subpanels/ModelPanel/Tri
import { filesize } from 'filesize';
import { memo, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
-import type { AnyModelConfig } from 'services/api/types';
+import type {
+ AnyModelConfig,
+ CLIPEmbedModelConfig,
+ CLIPVisionModelConfig,
+ LlavaOnevisionModelConfig,
+ Qwen3EncoderModelConfig,
+ SigLIPModelConfig,
+ T5EncoderModelConfig,
+} from 'services/api/types';
import { isExternalModel } from './isExternalModel';
import { MainModelDefaultSettings } from './MainModelDefaultSettings/MainModelDefaultSettings';
@@ -18,6 +27,25 @@ import { ModelReidentifyButton } from './ModelReidentifyButton';
import { ModelUpdatePathButton } from './ModelUpdatePathButton';
import { RelatedModels } from './RelatedModels';
+type EncoderModelConfig =
+ | CLIPEmbedModelConfig
+ | T5EncoderModelConfig
+ | Qwen3EncoderModelConfig
+ | CLIPVisionModelConfig
+ | SigLIPModelConfig
+ | LlavaOnevisionModelConfig;
+
+const isEncoderModel = (modelConfig: AnyModelConfig): modelConfig is EncoderModelConfig => {
+ return (
+ modelConfig.type === 'clip_embed' ||
+ modelConfig.type === 't5_encoder' ||
+ modelConfig.type === 'qwen3_encoder' ||
+ modelConfig.type === 'clip_vision' ||
+ modelConfig.type === 'siglip' ||
+ modelConfig.type === 'llava_onevision'
+ );
+};
+
type Props = {
modelConfig: AnyModelConfig;
};
@@ -42,9 +70,13 @@ export const ModelView = memo(({ modelConfig }: Props) => {
if (modelConfig.type === 'main' || modelConfig.type === 'lora') {
return true;
}
+ // Encoder models
+ if (isEncoderModel(modelConfig)) {
+ return true;
+ }
return false;
- }, [modelConfig.base, modelConfig.type]);
+ }, [modelConfig]);
return (
<Flex flexDir="column" gap={4} h="full">
@@ -102,6 +134,7 @@ export const ModelView = memo(({ modelConfig }: Props) => {
</>
)}
{modelConfig.type === 'main' && <TriggerPhrases modelConfig={modelConfig} />}
+ {isEncoderModel(modelConfig) && <EncoderModelSettings modelConfig={modelConfig} />}
</Box>
</>
)}
diff --git a/invokeai/frontend/web/src/services/api/schema.ts b/invokeai/frontend/web/src/services/api/schema.ts
index a8a4798646..2249b91fdd 100644
--- a/invokeai/frontend/web/src/services/api/schema.ts
+++ b/invokeai/frontend/web/src/services/api/schema.ts
@@ -3254,6 +3254,11 @@ export type components = {
* @constant
*/
type: "clip_embed";
+ /**
+ * Cpu Only
+ * @description Whether this model should run on CPU only
+ */
+ cpu_only: boolean | null;
/**
* Variant
* @default gigantic
@@ -3330,6 +3335,11 @@ export type components = {
* @constant
*/
type: "clip_embed";
+ /**
+ * Cpu Only
+ * @description Whether this model should run on CPU only
+ */
+ cpu_only: boolean | null;
/**
* Variant
* @default large
@@ -3502,6 +3512,11 @@ export type components = {
* @constant
*/
type: "clip_vision";
+ /**
+ * Cpu Only
+ * @description Whether this model should run on CPU only
+ */
+ cpu_only: boolean | null;
};
/**
* CV2 Infill
@@ -14967,6 +14982,11 @@ export type components = {
* @constant
*/
base: "any";
+ /**
+ * Cpu Only
+ * @description Whether this model should run on CPU only
+ */
+ cpu_only: boolean | null;
};
/**
* Apply LoRA Collection - SD1.5
@@ -16255,6 +16275,11 @@ export type components = {
* @description Default Guidance for this model
*/
guidance?: number | null;
+ /**
+ * Cpu Only
+ * @description Whether this model should run on CPU only
+ */
+ cpu_only?: boolean | null;
};
/**
* Main Model - SD1.5, SD2
@@ -20124,6 +20149,11 @@ export type components = {
* @description Default settings for this model
*/
default_settings?: components["schemas"]["MainModelDefaultSettings"] | components["schemas"]["LoraModelDefaultSettings"] | components["schemas"]["ControlAdapterDefaultSettings"] | null;
+ /**
+ * Cpu Only
+ * @description Whether this model should run on CPU only
+ */
+ cpu_only?: boolean | null;
/**
* Variant
* @description The variant of the model.
@@ -21112,6 +21142,11 @@ export type components = {
* @constant
*/
format: "checkpoint";
+ /**
+ * Cpu Only
+ * @description Whether this model should run on CPU only
+ */
+ cpu_only: boolean | null;
/** @description Qwen3 model size variant (4B or 8B) */
variant: components["schemas"]["Qwen3VariantType"];
};
@@ -21190,6 +21225,11 @@ export type components = {
* @constant
*/
format: "gguf_quantized";
+ /**
+ * Cpu Only
+ * @description Whether this model should run on CPU only
+ */
+ cpu_only: boolean | null;
/** @description Qwen3 model size variant (4B or 8B) */
variant: components["schemas"]["Qwen3VariantType"];
};
@@ -21266,6 +21306,11 @@ export type components = {
* @constant
*/
format: "qwen3_encoder";
+ /**
+ * Cpu Only
+ * @description Whether this model should run on CPU only
+ */
+ cpu_only: boolean | null;
/** @description Qwen3 model size variant (4B or 8B) */
variant: components["schemas"]["Qwen3VariantType"];
};
@@ -23193,6 +23238,11 @@ export type components = {
* @constant
*/
base: "any";
+ /**
+ * Cpu Only
+ * @description Whether this model should run on CPU only
+ */
+ cpu_only: boolean | null;
};
/**
* Image-to-Image (Autoscale)
@@ -24384,6 +24434,11 @@ export type components = {
* @constant
*/
format: "bnb_quantized_int8b";
+ /**
+ * Cpu Only
+ * @description Whether this model should run on CPU only
+ */
+ cpu_only: boolean | null;
};
/**
* T5Encoder_T5Encoder_Config
@@ -24456,6 +24511,11 @@ export type components = {
* @constant
*/
format: "t5_encoder";
+ /**
+ * Cpu Only
+ * @description Whether this model should run on CPU only
+ */
+ cpu_only: boolean | null;
};
/** TBLR */
TBLR: {
diff --git a/invokeai/frontend/web/src/services/api/types.ts b/invokeai/frontend/web/src/services/api/types.ts
index 39dba976d3..5d56c346f8 100644
--- a/invokeai/frontend/web/src/services/api/types.ts
+++ b/invokeai/frontend/web/src/services/api/types.ts
@@ -91,7 +91,7 @@ export type T2IAdapterModelConfig = Extract<S['AnyModelConfig'], { type: 't2i_ad
export type CLIPLEmbedModelConfig = Extract<S['AnyModelConfig'], { type: 'clip_embed'; variant: 'large' }>;
export type CLIPGEmbedModelConfig = Extract<S['AnyModelConfig'], { type: 'clip_embed'; variant: 'gigantic' }>;
export type CLIPEmbedModelConfig = Extract<S['AnyModelConfig'], { type: 'clip_embed' }>;
-type LlavaOnevisionConfig = Extract<S['AnyModelConfig'], { type: 'llava_onevision' }>;
+export type LlavaOnevisionModelConfig = Extract<S['AnyModelConfig'], { type: 'llava_onevision' }>;
export type T5EncoderModelConfig = Extract<S['AnyModelConfig'], { type: 't5_encoder' }>;
export type T5EncoderBnbQuantizedLlmInt8bModelConfig = Extract<
S['AnyModelConfig'],
@@ -100,8 +100,8 @@ export type T5EncoderBnbQuantizedLlmInt8bModelConfig = Extract<
export type Qwen3EncoderModelConfig = Extract<S['AnyModelConfig'], { type: 'qwen3_encoder' }>;
export type SpandrelImageToImageModelConfig = Extract<S['AnyModelConfig'], { type: 'spandrel_image_to_image' }>;
export type CheckpointModelConfig = Extract<S['AnyModelConfig'], { type: 'main'; format: 'checkpoint' }>;
-type CLIPVisionDiffusersConfig = Extract<S['AnyModelConfig'], { type: 'clip_vision' }>;
-type SigLipModelConfig = Extract<S['AnyModelConfig'], { type: 'siglip' }>;
+export type CLIPVisionModelConfig = Extract<S['AnyModelConfig'], { type: 'clip_vision' }>;
+export type SigLIPModelConfig = Extract<S['AnyModelConfig'], { type: 'siglip' }>;
export type FLUXReduxModelConfig = Extract<S['AnyModelConfig'], { type: 'flux_redux' }>;
type ApiModelConfig = Extract<S['AnyModelConfig'], { format: 'api' }>;
type UnknownModelConfig = Extract<S['AnyModelConfig'], { type: 'unknown' }>;
@@ -210,11 +210,11 @@ export const isIPAdapterModelConfig = (config: AnyModelConfig): config is IPAdap
return config.type === 'ip_adapter';
};
-export const isCLIPVisionModelConfig = (config: AnyModelConfig): config is CLIPVisionDiffusersConfig => {
+export const isCLIPVisionModelConfig = (config: AnyModelConfig): config is CLIPVisionModelConfig => {
return config.type === 'clip_vision';
};
-export const isLLaVAModelConfig = (config: AnyModelConfig): config is LlavaOnevisionConfig => {
+export const isLLaVAModelConfig = (config: AnyModelConfig): config is LlavaOnevisionModelConfig => {
return config.type === 'llava_onevision';
};
@@ -282,7 +282,7 @@ export const isSpandrelImageToImageModelConfig = (
return config.type === 'spandrel_image_to_image';
};
-export const isSigLipModelConfig = (config: AnyModelConfig): config is SigLipModelConfig => {
+export const isSigLipModelConfig = (config: AnyModelConfig): config is SigLIPModelConfig => {
return config.type === 'siglip';
};