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.

External models (Gemini Nano Banana & OpenAI GPT Image) (#8633) (#8884)

CypherNaugh_0x9deb545cc1ae
diff --git a/docs-old/contributing/index.md b/docs-old/contributing/index.md
index a582a95128..15a4357a87 100644
--- a/docs-old/contributing/index.md
+++ b/docs-old/contributing/index.md
@@ -8,6 +8,10 @@ We welcome contributions, whether features, bug fixes, code cleanup, testing, co
If you’d like to help with development, please see our [development guide](contribution_guides/development.md).
+## External Providers
+
+If you are adding external image generation providers or configs, see our [external provider integration guide](EXTERNAL_PROVIDERS.md).
+
**New Contributors:** If you’re unfamiliar with contributing to open source projects, take a look at our [new contributor guide](contribution_guides/newContributorChecklist.md).
## Nodes
diff --git a/docs/contributing/EXTERNAL_PROVIDERS.md b/docs/contributing/EXTERNAL_PROVIDERS.md
new file mode 100644
index 0000000000..989698c4ba
--- /dev/null
+++ b/docs/contributing/EXTERNAL_PROVIDERS.md
@@ -0,0 +1,129 @@
+# External Provider Integration
+
+This guide covers:
+
+1. Adding a new **external model** (most common; existing provider).
+2. Adding a brand-new **external provider** (adapter + config + UI wiring).
+
+## 1) Add a New External Model (Existing Provider)
+
+For provider-backed models (for example, OpenAI or Gemini), the source of truth is
+`invokeai/backend/model_manager/starter_models.py`.
+
+### Required model fields
+
+Define a `StarterModel` with:
+
+- `base=BaseModelType.External`
+- `type=ModelType.ExternalImageGenerator`
+- `format=ModelFormat.ExternalApi`
+- `source="external://<provider_id>/<provider_model_id>"`
+- `name`, `description`
+- `capabilities=ExternalModelCapabilities(...)`
+- optional `default_settings=ExternalApiModelDefaultSettings(...)`
+
+Example:
+
+```python
+new_external_model = StarterModel(
+ name="Provider Model Name",
+ base=BaseModelType.External,
+ source="external://openai/my-model-id",
+ description=(
+ "Provider model (external API). "
+ "Requires a configured OpenAI API key and may incur provider usage costs."
+ ),
+ type=ModelType.ExternalImageGenerator,
+ format=ModelFormat.ExternalApi,
+ capabilities=ExternalModelCapabilities(
+ modes=["txt2img", "img2img", "inpaint"],
+ supports_negative_prompt=False,
+ supports_seed=False,
+ supports_guidance=False,
+ supports_steps=False,
+ supports_reference_images=True,
+ max_images_per_request=4,
+ ),
+ default_settings=ExternalApiModelDefaultSettings(
+ width=1024,
+ height=1024,
+ num_images=1,
+ ),
+)
+```
+
+Then append it to `STARTER_MODELS`.
+
+### Required description text
+
+External starter model descriptions must clearly state:
+
+- an API key is required
+- usage may incur provider-side costs
+
+### Capabilities must be accurate
+
+These flags directly control UI visibility and request payload fields:
+
+- `supports_negative_prompt`
+- `supports_seed`
+- `supports_guidance`
+- `supports_steps`
+- `supports_reference_images`
+
+`supports_steps` is especially important: if `False`, steps are hidden for that model and `steps` is sent as `null`.
+
+### Source string stability
+
+Starter overrides are matched by `source` (`external://provider/model-id`). Keep this stable:
+
+- runtime capability/default overrides depend on it
+- installation detection in starter-model APIs depends on it
+
+`STARTER_MODELS` enforces unique `source` values with an assertion.
+
+### Install behavior notes
+
+- External starter models are managed in **External Providers** setup (not the regular Starter Models tab).
+- External starter models auto-install when a provider is configured.
+- Removing a provider API key removes installed external models for that provider.
+
+## 2) Credentials and Config
+
+External provider API keys are stored separately from `invokeai.yaml`:
+
+- default file: `~/invokeai/api_keys.yaml`
+- resolved path: `<INVOKEAI_ROOT>/api_keys.yaml`
+
+Non-secret provider settings (for example base URL overrides) stay in `invokeai.yaml`.
+
+Environment variables are still supported, e.g.:
+
+- `INVOKEAI_EXTERNAL_GEMINI_API_KEY`
+- `INVOKEAI_EXTERNAL_OPENAI_API_KEY`
+
+## 3) Add a New Provider (Only If Needed)
+
+If your model uses a provider that is not already integrated:
+
+1. Add config fields in `invokeai/app/services/config/config_default.py`
+ `external_<provider>_api_key` and optional `external_<provider>_base_url`.
+2. Add provider field mapping in `invokeai/app/api/routers/app_info.py`
+ (`EXTERNAL_PROVIDER_FIELDS`).
+3. Implement provider adapter in `invokeai/app/services/external_generation/providers/`
+ by subclassing `ExternalProvider`.
+4. Register the provider in `invokeai/app/api/dependencies.py` when building
+ `ExternalGenerationService`.
+5. Add starter model entries using `source="external://<provider>/<model-id>"`.
+6. Optional UI ordering tweak:
+ `invokeai/frontend/web/src/features/modelManagerV2/subpanels/AddModelPanel/ExternalProviders/ExternalProvidersForm.tsx`
+ (`PROVIDER_SORT_ORDER`).
+
+## 4) Optional Manual Installation
+
+You can also install external models directly via:
+
+`POST /api/v2/models/install?source=external://<provider_id>/<provider_model_id>`
+
+If omitted, `path`, `source`, and `hash` are auto-populated for external model configs.
+Set capabilities conservatively; the external generation service enforces capability checks at runtime.
diff --git a/docs/features/external-models/gemini.md b/docs/features/external-models/gemini.md
new file mode 100644
index 0000000000..d3e0622e97
--- /dev/null
+++ b/docs/features/external-models/gemini.md
@@ -0,0 +1,46 @@
+---
+title: Google Gemini
+---
+
+# :material-google: Google Gemini
+
+Invoke supports Google's Gemini image generation models through the Gemini API. This provider is a good fit if you want high-quality text-to-image and reference-based image edits without running a local model.
+
+## Getting an API Key
+
+1. Open [Google AI Studio](https://aistudio.google.com/) and sign in with your Google account.
+2. Generate a new API key.
+3. Note the key — it will only be shown once.
+
+## Configuration
+
+Add your key to `api_keys.yaml` in your Invoke root directory:
+
+```yaml
+external_gemini_api_key: "your-gemini-api-key"
+
+# Optional — only set this if you need to route requests through a different endpoint
+external_gemini_base_url: "https://generativelanguage.googleapis.com"
+```
+
+Restart Invoke for the change to take effect.
+
+## Available Models
+
+| Model | Modes | Reference Images | Notes |
+| --- | --- | --- | --- |
+| **Gemini 2.5 Flash Image** | txt2img, img2img, inpaint | Yes | 10 aspect ratios, fixed per-ratio resolutions. |
+| **Gemini 3 Pro Image Preview** | txt2img, img2img, inpaint | Up to 14 (6 object + 5 character) | 1K / 2K / 4K resolution presets. |
+| **Gemini 3.1 Flash Image Preview** | txt2img, img2img, inpaint | Up to 14 (10 object + 4 character) | 512 / 1K / 2K / 4K resolution presets. |
+
+All Gemini models are single-image-per-request — batch size is fixed at 1. To generate multiple variations, queue multiple invocations.
+
+## Provider-Specific Options
+
+Gemini exposes a **temperature** control in the parameters panel. Lower values make outputs more deterministic, higher values increase variability.
+
+## Tips
+
+- **Reference images** are sent directly to the API as inlined PNG data. Large references increase request latency and cost — crop tightly where possible.
+- **Aspect ratios** are mapped to the closest Gemini-supported ratio. For Gemini 3 models, use the resolution presets to stay at the provider's native output sizes and avoid unnecessary rescaling.
+- **Pricing** varies by model and region. Check Google's documentation before running large batches.
diff --git a/docs/features/external-models/index.md b/docs/features/external-models/index.md
new file mode 100644
index 0000000000..52e02d6958
--- /dev/null
+++ b/docs/features/external-models/index.md
@@ -0,0 +1,58 @@
+---
+title: External Models
+---
+
+# :material-cloud-outline: External Models
+
+External models let you generate images in Invoke by calling third-party image generation APIs instead of running a model locally. This is useful when:
+
+- You don't have the GPU or VRAM to run a model locally.
+- You want access to closed-source models (e.g. GPT Image, Gemini).
+- You need a specific provider capability (very high resolutions, fast batches, bilingual text rendering, etc.).
+
+External models appear in the model picker alongside locally installed models. Generations are routed to the provider's API, billed against your provider account, and the resulting images are imported back into Invoke like any other generation.
+
+## Supported Providers
+
+- [Google Gemini](gemini.md) — Gemini 2.5 Flash Image, Gemini 3 Pro Image Preview, Gemini 3.1 Flash Image Preview
+- [OpenAI](openai.md) — GPT Image 1 / 1.5 / 1-mini, DALL·E 3, DALL·E 2
+
+## Configuring API Keys
+
+External provider credentials are stored in a dedicated `api_keys.yaml` file alongside `invokeai.yaml` in your Invoke root directory.
+
+```yaml
+# api_keys.yaml
+external_gemini_api_key: "your-gemini-api-key"
+external_openai_api_key: "your-openai-api-key"
+
+# Optional: override the provider base URL (e.g. for a compatible proxy or regional endpoint)
+external_gemini_base_url: "https://generativelanguage.googleapis.com"
+external_openai_base_url: "https://api.openai.com"
+```
+
+Restart Invoke after editing `api_keys.yaml` so the new values are picked up.
+
+!!! warning "Keep your keys private"
+ `api_keys.yaml` contains secrets. Do not commit it to version control and do not share it with other users of your machine.
+
+## Installing External Models
+
+External models are listed in the starter models dialog under their provider. Install them like any other starter model — Invoke records a model reference but does not download weights (there are no weights to download).
+
+Once installed, external models show up everywhere a model can be selected. Choose one, set the usual parameters (prompt, dimensions, num images, etc.), and invoke as normal.
+
+## Capabilities and Settings Visibility
+
+Each external model declares its own **capabilities** — for example:
+
+- Which generation modes it supports (`txt2img`, `img2img`, `inpaint`).
+- Whether it accepts reference images, and how many.
+- Which aspect ratios and resolutions it allows.
+- Whether it supports a negative prompt, seed, or batch size > 1.
+
+Invoke uses these capabilities to drive the UI: only the settings a given model actually supports will be shown in the parameters panel. If a field you expect is missing, it's because the selected model does not support it.
+
+## Costs and Rate Limits
+
+External providers charge for each request. Check the provider's pricing page before running large batches. Rate-limit errors from the provider are surfaced in Invoke as generation failures — wait a moment and try again, or lower your concurrent batch size.
diff --git a/docs/features/external-models/openai.md b/docs/features/external-models/openai.md
new file mode 100644
index 0000000000..dff0c94889
--- /dev/null
+++ b/docs/features/external-models/openai.md
@@ -0,0 +1,56 @@
+---
+title: OpenAI
+---
+
+# :material-alpha-o-circle-outline: OpenAI
+
+Invoke supports OpenAI's image generation models — both the GPT Image family and the older DALL·E models — through the OpenAI API.
+
+## Getting an API Key
+
+1. Open the [OpenAI API Platform](https://platform.openai.com/api-keys) and sign in.
+2. Create a new secret API key.
+3. Make sure your account has billing set up — image endpoints are paid per request.
+
+## Configuration
+
+Add your key to `api_keys.yaml` in your Invoke root directory:
+
+```yaml
+external_openai_api_key: "sk-..."
+
+# Optional — use this to point at a compatible proxy or Azure OpenAI deployment
+external_openai_base_url: "https://api.openai.com"
+```
+
+Restart Invoke for the change to take effect.
+
+## Available Models
+
+| Model | Modes | Aspect Ratios | Batch | Notes |
+| --- | --- | --- | --- | --- |
+| **GPT Image 1.5** | txt2img, img2img, inpaint | 1:1, 3:2, 2:3 | up to 10 | Fastest and cheapest GPT Image model. |
+| **GPT Image 1** | txt2img, img2img, inpaint | 1:1, 3:2, 2:3 | up to 10 | Highest quality of the GPT Image family. |
+| **GPT Image 1 Mini** | txt2img, img2img, inpaint | 1:1, 3:2, 2:3 | up to 10 | ~80% cheaper than GPT Image 1. |
+| **DALL·E 3** | txt2img only | 1:1, 7:4, 4:7 | 1 | No reference-image / edit support. |
+| **DALL·E 2** | txt2img, img2img, inpaint | 1:1 | up to 10 | Square only. |
+
+## Provider-Specific Options
+
+For **GPT Image** models, Invoke surfaces two provider-specific options in the parameters panel:
+
+- **Quality** — `low`, `medium`, `high`, or `auto`. Higher quality costs more and takes longer.
+- **Background** — `auto`, `transparent`, or `opaque`. Use `transparent` for PNG output with an alpha channel.
+
+DALL·E 2 and DALL·E 3 do not expose these options.
+
+## How Requests Are Routed
+
+- Pure text-to-image requests hit `/v1/images/generations`.
+- Any request with an init image or reference images is sent to `/v1/images/edits` instead. This is done transparently — you don't need to pick an endpoint.
+
+## Tips
+
+- **Batching** on GPT Image and DALL·E 2 tops out at 10 per request. Larger batches are split into multiple API calls.
+- **Costs** can climb quickly with high-quality GPT Image generations. Start with GPT Image 1 Mini when iterating on prompts.
+- **Rate limits** from OpenAI surface as failed invocations — retry after a short wait.
diff --git a/docs/src/generated/settings.json b/docs/src/generated/settings.json
index 2974d635cc..32140da667 100644
--- a/docs/src/generated/settings.json
+++ b/docs/src/generated/settings.json
@@ -723,6 +723,50 @@
"required": false,
"type": "<class 'bool'>",
"validation": {}
+ },
+ {
+ "category": "EXTERNAL PROVIDERS",
+ "default": null,
+ "description": "API key for Gemini image generation.",
+ "env_var": "INVOKEAI_EXTERNAL_GEMINI_API_KEY",
+ "literal_values": [],
+ "name": "external_gemini_api_key",
+ "required": false,
+ "type": "typing.Optional[str]",
+ "validation": {}
+ },
+ {
+ "category": "EXTERNAL PROVIDERS",
+ "default": null,
+ "description": "API key for OpenAI image generation.",
+ "env_var": "INVOKEAI_EXTERNAL_OPENAI_API_KEY",
+ "literal_values": [],
+ "name": "external_openai_api_key",
+ "required": false,
+ "type": "typing.Optional[str]",
+ "validation": {}
+ },
+ {
+ "category": "EXTERNAL PROVIDERS",
+ "default": null,
+ "description": "Base URL override for Gemini image generation.",
+ "env_var": "INVOKEAI_EXTERNAL_GEMINI_BASE_URL",
+ "literal_values": [],
+ "name": "external_gemini_base_url",
+ "required": false,
+ "type": "typing.Optional[str]",
+ "validation": {}
+ },
+ {
+ "category": "EXTERNAL PROVIDERS",
+ "default": null,
+ "description": "Base URL override for OpenAI image generation.",
+ "env_var": "INVOKEAI_EXTERNAL_OPENAI_BASE_URL",
+ "literal_values": [],
+ "name": "external_openai_base_url",
+ "required": false,
+ "type": "typing.Optional[str]",
+ "validation": {}
}
]
}
diff --git a/invokeai/app/api/dependencies.py b/invokeai/app/api/dependencies.py
index 532f7d7590..ff55749f6b 100644
--- a/invokeai/app/api/dependencies.py
+++ b/invokeai/app/api/dependencies.py
@@ -16,6 +16,9 @@ from invokeai.app.services.client_state_persistence.client_state_persistence_sql
from invokeai.app.services.config.config_default import InvokeAIAppConfig
from invokeai.app.services.download.download_default import DownloadQueueService
from invokeai.app.services.events.events_fastapievents import FastAPIEventService
+from invokeai.app.services.external_generation.external_generation_default import ExternalGenerationService
+from invokeai.app.services.external_generation.providers import GeminiProvider, OpenAIProvider
+from invokeai.app.services.external_generation.startup import sync_configured_external_starter_models
from invokeai.app.services.image_files.image_files_disk import DiskImageFileStorage
from invokeai.app.services.image_records.image_records_sqlite import SqliteImageRecordStorage
from invokeai.app.services.images.images_default import ImageService
@@ -149,13 +152,22 @@ class ApiDependencies:
),
)
download_queue_service = DownloadQueueService(app_config=configuration, event_bus=events)
- model_images_service = ModelImageFileStorageDisk(model_images_folder / "model_images")
+ model_record_service = ModelRecordServiceSQL(db=db, logger=logger)
model_manager = ModelManagerService.build_model_manager(
app_config=configuration,
- model_record_service=ModelRecordServiceSQL(db=db, logger=logger),
+ model_record_service=model_record_service,
download_queue=download_queue_service,
events=events,
)
+ external_generation = ExternalGenerationService(
+ providers={
+ GeminiProvider.provider_id: GeminiProvider(app_config=configuration, logger=logger),
+ OpenAIProvider.provider_id: OpenAIProvider(app_config=configuration, logger=logger),
+ },
+ logger=logger,
+ record_store=model_record_service,
+ )
+ model_images_service = ModelImageFileStorageDisk(model_images_folder / "model_images")
model_relationships = ModelRelationshipsService()
model_relationship_records = SqliteModelRelationshipRecordStorage(db=db)
names = SimpleNameService()
@@ -188,6 +200,7 @@ class ApiDependencies:
model_relationships=model_relationships,
model_relationship_records=model_relationship_records,
download_queue=download_queue_service,
+ external_generation=external_generation,
names=names,
performance_statistics=performance_statistics,
session_processor=session_processor,
@@ -204,6 +217,16 @@ class ApiDependencies:
)
ApiDependencies.invoker = Invoker(services)
+ configured_external_providers = {
+ provider_id
+ for provider_id, status in external_generation.get_provider_statuses().items()
+ if status.configured
+ }
+ sync_configured_external_starter_models(
+ configured_provider_ids=configured_external_providers,
+ model_manager=model_manager,
+ logger=logger,
+ )
db.clean()
@staticmethod
diff --git a/invokeai/app/api/routers/app_info.py b/invokeai/app/api/routers/app_info.py
index da777ebc73..ca134cc52a 100644
--- a/invokeai/app/api/routers/app_info.py
+++ b/invokeai/app/api/routers/app_info.py
@@ -1,21 +1,30 @@
+import locale
from enum import Enum
from importlib.metadata import distributions
+from pathlib import Path as FilePath
+from threading import Lock
import torch
-from fastapi import Body
+import yaml
+from fastapi import Body, HTTPException, Path
from fastapi.routing import APIRouter
from pydantic import BaseModel, Field
from invokeai.app.api.auth_dependencies import AdminUserOrDefault
from invokeai.app.api.dependencies import ApiDependencies
from invokeai.app.services.config.config_default import (
+ EXTERNAL_PROVIDER_CONFIG_FIELDS,
DefaultInvokeAIAppConfig,
InvokeAIAppConfig,
get_config,
load_and_migrate_config,
+ load_external_api_keys,
)
+from invokeai.app.services.external_generation.external_generation_common import ExternalProviderStatus
from invokeai.app.services.invocation_cache.invocation_cache_common import InvocationCacheStatus
+from invokeai.app.services.model_records.model_records_base import UnknownModelException
from invokeai.backend.image_util.infill_methods.patchmatch import PatchMatch
+from invokeai.backend.model_manager.taxonomy import BaseModelType, ModelType
from invokeai.backend.util.logging import logging
from invokeai.version import __version__
@@ -47,7 +56,7 @@ async def get_version() -> AppVersion:
async def get_app_deps() -> dict[str, str]:
deps: dict[str, str] = {dist.metadata["Name"]: dist.version for dist in distributions()}
try:
- cuda = torch.version.cuda or "N/A"
+ cuda = getattr(getattr(torch, "version", None), "cuda", None) or "N/A" # pyright: ignore[reportAttributeAccessIssue]
except Exception:
cuda = "N/A"
@@ -70,6 +79,30 @@ class InvokeAIAppConfigWithSetFields(BaseModel):
config: InvokeAIAppConfig = Field(description="The InvokeAI App Config")
+class ExternalProviderStatusModel(BaseModel):
+ provider_id: str = Field(description="The external provider identifier")
+ configured: bool = Field(description="Whether credentials are configured for the provider")
+ message: str | None = Field(default=None, description="Optional provider status detail")
+
+
+class ExternalProviderConfigUpdate(BaseModel):
+ api_key: str | None = Field(default=None, description="API key for the external provider")
+ base_url: str | None = Field(default=None, description="Optional base URL override for the provider")
+
+
+class ExternalProviderConfigModel(BaseModel):
+ provider_id: str = Field(description="The external provider identifier")
+ api_key_configured: bool = Field(description="Whether an API key is configured")
+ base_url: str | None = Field(default=None, description="Optional base URL override")
+
+
+EXTERNAL_PROVIDER_FIELDS: dict[str, tuple[str, str]] = {
+ "gemini": ("external_gemini_api_key", "external_gemini_base_url"),
+ "openai": ("external_openai_api_key", "external_openai_base_url"),
+}
+_EXTERNAL_PROVIDER_CONFIG_LOCK = Lock()
+
+
class UpdateAppGenerationSettingsRequest(BaseModel):
"""Writable generation-related app settings."""
@@ -112,6 +145,166 @@ async def update_runtime_config(
return InvokeAIAppConfigWithSetFields(set_fields=config.model_fields_set, config=config)
+@app_router.get(
+ "/external_providers/status",
+ operation_id="get_external_provider_statuses",
+ status_code=200,
+ response_model=list[ExternalProviderStatusModel],
+)
+async def get_external_provider_statuses() -> list[ExternalProviderStatusModel]:
+ statuses = ApiDependencies.invoker.services.external_generation.get_provider_statuses()
+ return [status_to_model(status) for status in statuses.values()]
+
+
+@app_router.get(
+ "/external_providers/config",
+ operation_id="get_external_provider_configs",
+ status_code=200,
+ response_model=list[ExternalProviderConfigModel],
+)
+async def get_external_provider_configs() -> list[ExternalProviderConfigModel]:
+ config = get_config()
+ return [_build_external_provider_config(provider_id, config) for provider_id in EXTERNAL_PROVIDER_FIELDS]
+
+
+@app_router.post(
+ "/external_providers/config/{provider_id}",
+ operation_id="set_external_provider_config",
+ status_code=200,
+ response_model=ExternalProviderConfigModel,
+)
+async def set_external_provider_config(
+ provider_id: str = Path(description="The external provider identifier"),
+ update: ExternalProviderConfigUpdate = Body(description="External provider configuration settings"),
+) -> ExternalProviderConfigModel:
+ api_key_field, base_url_field = _get_external_provider_fields(provider_id)
+ updates: dict[str, str | None] = {}
+
+ if update.api_key is not None:
+ api_key = update.api_key.strip()
+ updates[api_key_field] = api_key or None
+ if update.base_url is not None:
+ base_url = update.base_url.strip()
+ updates[base_url_field] = base_url or None
+
+ if not updates:
+ raise HTTPException(status_code=400, detail="No external provider config fields provided")
+
+ api_key_removed = update.api_key is not None and updates.get(api_key_field) is None
+ _apply_external_provider_update(updates)
+ if api_key_removed:
+ _remove_external_models_for_provider(provider_id)
+ return _build_external_provider_config(provider_id, get_config())
+
+
+@app_router.delete(
+ "/external_providers/config/{provider_id}",
+ operation_id="reset_external_provider_config",
+ status_code=200,
+ response_model=ExternalProviderConfigModel,
+)
+async def reset_external_provider_config(
+ provider_id: str = Path(description="The external provider identifier"),
+) -> ExternalProviderConfigModel:
+ api_key_field, base_url_field = _get_external_provider_fields(provider_id)
+ _apply_external_provider_update({api_key_field: None, base_url_field: None})
+ _remove_external_models_for_provider(provider_id)
+ return _build_external_provider_config(provider_id, get_config())
+
+
+def status_to_model(status: ExternalProviderStatus) -> ExternalProviderStatusModel:
+ return ExternalProviderStatusModel(
+ provider_id=status.provider_id,
+ configured=status.configured,
+ message=status.message,
+ )
+
+
+def _get_external_provider_fields(provider_id: str) -> tuple[str, str]:
+ if provider_id not in EXTERNAL_PROVIDER_FIELDS:
+ raise HTTPException(status_code=404, detail=f"Unknown external provider '{provider_id}'")
+ return EXTERNAL_PROVIDER_FIELDS[provider_id]
+
+
+def _write_external_api_keys_file(api_keys_file_path: FilePath, api_keys: dict[str, str]) -> None:
+ if not api_keys:
+ if api_keys_file_path.exists():
+ api_keys_file_path.unlink()
+ return
+
+ api_keys_file_path.parent.mkdir(parents=True, exist_ok=True)
+ with open(api_keys_file_path, "w", encoding=locale.getpreferredencoding()) as api_keys_file:
+ yaml.safe_dump(api_keys, api_keys_file, sort_keys=False)
+
+
+def _apply_external_provider_update(updates: dict[str, str | None]) -> None:
+ with _EXTERNAL_PROVIDER_CONFIG_LOCK:
+ runtime_config = get_config()
+ config_path = runtime_config.config_file_path
+ api_keys_file_path = runtime_config.api_keys_file_path
+ if config_path.exists():
+ file_config = load_and_migrate_config(config_path)
+ else:
+ file_config = DefaultInvokeAIAppConfig()
+
+ runtime_config.update_config(updates)
+ provider_config_fields = set(EXTERNAL_PROVIDER_CONFIG_FIELDS)
+ provider_updates = {field: value for field, value in updates.items() if field in provider_config_fields}
+ non_provider_updates = {field: value for field, value in updates.items() if field not in provider_config_fields}
+
+ if non_provider_updates:
+ file_config.update_config(non_provider_updates)
+
+ persisted_api_keys = load_external_api_keys(api_keys_file_path)
+ for field_name in EXTERNAL_PROVIDER_CONFIG_FIELDS:
+ file_value = getattr(file_config, field_name, None)
+ if field_name not in persisted_api_keys and isinstance(file_value, str) and file_value.strip():
+ persisted_api_keys[field_name] = file_value
+
+ for field_name, value in provider_updates.items():
+ if value is None:
+ persisted_api_keys.pop(field_name, None)
+ else:
+ persisted_api_keys[field_name] = value
+
+ _write_external_api_keys_file(api_keys_file_path, persisted_api_keys)
+
+ for field_name in EXTERNAL_PROVIDER_CONFIG_FIELDS:
+ setattr(file_config, field_name, None)
+
+ file_config_to_write = type(file_config).model_validate(
+ file_config.model_dump(exclude_unset=True, exclude_none=True)
+ )
+ file_config_to_write.write_file(config_path, as_example=False)
+
+
+def _build_external_provider_config(provider_id: str, config: InvokeAIAppConfig) -> ExternalProviderConfigModel:
+ api_key_field, base_url_field = _get_external_provider_fields(provider_id)
+ return ExternalProviderConfigModel(
+ provider_id=provider_id,
+ api_key_configured=bool(getattr(config, api_key_field)),
+ base_url=getattr(config, base_url_field),
+ )
+
+
+def _remove_external_models_for_provider(provider_id: str) -> None:
+ model_manager = ApiDependencies.invoker.services.model_manager
+ external_models = model_manager.store.search_by_attr(
+ base_model=BaseModelType.External,
+ model_type=ModelType.ExternalImageGenerator,
+ )
+
+ for model in external_models:
+ if getattr(model, "provider_id", None) != provider_id:
+ continue
+ try:
+ model_manager.install.delete(model.key)
+ except UnknownModelException:
+ logging.warning(f"External model key '{model.key}' was already removed while resetting '{provider_id}'")
+ except Exception as error:
+ logging.warning(f"Failed removing external model key '{model.key}' for '{provider_id}': {error}")
+
+
@app_router.get(
"/logging",
operation_id="get_log_level",
diff --git a/invokeai/app/api/routers/model_manager.py b/invokeai/app/api/routers/model_manager.py
index 822d9655fe..f351be11ad 100644
--- a/invokeai/app/api/routers/model_manager.py
+++ b/invokeai/app/api/routers/model_manager.py
@@ -30,6 +30,7 @@ from invokeai.app.services.model_records import (
)
from invokeai.app.services.orphaned_models import OrphanedModelInfo
from invokeai.app.util.suppress_output import SuppressOutput
+from invokeai.backend.model_manager.configs.external_api import ExternalApiModelConfig
from invokeai.backend.model_manager.configs.factory import AnyModelConfig, ModelConfigFactory
from invokeai.backend.model_manager.configs.main import (
Main_Checkpoint_SD1_Config,
@@ -75,8 +76,36 @@ class CacheType(str, Enum):
def add_cover_image_to_model_config(config: AnyModelConfig, dependencies: Type[ApiDependencies]) -> AnyModelConfig:
"""Add a cover image URL to a model configuration."""
cover_image = dependencies.invoker.services.model_images.get_url(config.key)
- config.cover_image = cover_image
- return config
+ return config.model_copy(update={"cover_image": cover_image})
+
+
+def apply_external_starter_model_overrides(config: AnyModelConfig) -> AnyModelConfig:
+ """Overlay starter-model metadata onto installed external model configs."""
+ if not isinstance(config, ExternalApiModelConfig):
+ return config
+
+ starter_match = next((starter for starter in STARTER_MODELS if starter.source == config.source), None)
+ if starter_match is None:
+ return config
+
+ model_updates: dict[str, object] = {}
+ if starter_match.capabilities is not None:
+ model_updates["capabilities"] = starter_match.capabilities
+ if starter_match.default_settings is not None:
+ model_updates["default_settings"] = starter_match.default_settings
+ if starter_match.panel_schema is not None:
+ model_updates["panel_schema"] = starter_match.panel_schema
+
+ if not model_updates:
+ return config
+
+ return config.model_copy(update=model_updates)
+
+
+def prepare_model_config_for_response(config: AnyModelConfig, dependencies: Type[ApiDependencies]) -> AnyModelConfig:
+ """Apply API-only model config overlays before returning a response."""
+ config = apply_external_starter_model_overrides(config)
+ return add_cover_image_to_model_config(config, dependencies)
##############################################################################
@@ -145,8 +174,8 @@ async def list_model_records(
found_models.extend(
record_store.search_by_attr(model_type=model_type, model_name=model_name, model_format=model_format)
)
- for model in found_models:
- model = add_cover_image_to_model_config(model, ApiDependencies)
+ for index, model in enumerate(found_models):
+ found_models[index] = prepare_model_config_for_response(model, ApiDependencies)
return ModelsList(models=found_models)
@@ -166,6 +195,8 @@ async def list_missing_models() -> ModelsList:
missing_models: list[AnyModelConfig] = []
for model_config in record_store.all_models():
+ if model_config.base == BaseModelType.External or model_config.format == ModelFormat.ExternalApi:
+ continue
if not (models_path / model_config.path).resolve().exists():
missing_models.append(model_config)
@@ -190,7 +221,7 @@ async def get_model_records_by_attrs(
if not configs:
raise HTTPException(status_code=404, detail="No model found with these attributes")
- return configs[0]
+ return prepare_model_config_for_response(configs[0], ApiDependencies)
@model_manager_router.get(
@@ -207,7 +238,7 @@ async def get_model_records_by_hash(
if not configs:
raise HTTPException(status_code=404, detail="No model found with this hash")
- return configs[0]
+ return prepare_model_config_for_response(configs[0], ApiDependencies)
@model_manager_router.get(
@@ -228,7 +259,7 @@ async def get_model_record(
"""Get a model record"""
try:
config = ApiDependencies.invoker.services.model_manager.store.get_model(key)
- return add_cover_image_to_model_config(config, ApiDependencies)
+ return prepare_model_config_for_response(config, ApiDependencies)
except UnknownModelException as e:
raise HTTPException(status_code=404, detail=str(e))
@@ -268,7 +299,7 @@ async def reidentify_model(
result.config.name = config.name
result.config.description = config.description
result.config.cover_image = config.cover_image
- if hasattr(config, "trigger_phrases") and hasattr(result.config, "trigger_phrases"):
+ if hasattr(result.config, "trigger_phrases") and hasattr(config, "trigger_phrases"):
result.config.trigger_phrases = config.trigger_phrases
result.config.source = config.source
result.config.source_type = config.source_type
@@ -392,7 +423,7 @@ async def update_model_record(
record_store = ApiDependencies.invoker.services.model_manager.store
try:
config = record_store.update_model(key, changes=changes, allow_class_change=True)
- config = add_cover_image_to_model_config(config, ApiDependencies)
+ config = prepare_model_config_for_response(config, ApiDependencies)
logger.info(f"Updated model: {key}")
except UnknownModelException as e:
raise HTTPException(status_code=404, detail=str(e))
@@ -1124,7 +1155,7 @@ async def convert_model(
# return the config record for the new diffusers directory
new_config = store.get_model(new_key)
- new_config = add_cover_image_to_model_config(new_config, ApiDependencies)
+ new_config = prepare_model_config_for_response(new_config, ApiDependencies)
return new_config
diff --git a/invokeai/app/invocations/external_image_generation.py b/invokeai/app/invocations/external_image_generation.py
new file mode 100644
index 0000000000..2082fc54c2
--- /dev/null
+++ b/invokeai/app/invocations/external_image_generation.py
@@ -0,0 +1,281 @@
+from typing import TYPE_CHECKING, Any, ClassVar, Literal
+
+from invokeai.app.invocations.baseinvocation import BaseInvocation, BaseInvocationOutput, invocation
+from invokeai.app.invocations.fields import (
+ FieldDescriptions,
+ ImageField,
+ InputField,
+ MetadataField,
+ WithBoard,
+ WithMetadata,
+)
+from invokeai.app.invocations.model import ModelIdentifierField
+from invokeai.app.invocations.primitives import ImageCollectionOutput
+from invokeai.app.services.external_generation.external_generation_common import (
+ ExternalGenerationRequest,
+ ExternalGenerationResult,
+ ExternalReferenceImage,
+)
+from invokeai.app.services.shared.invocation_context import InvocationContext
+from invokeai.backend.model_manager.configs.external_api import ExternalApiModelConfig, ExternalGenerationMode
+from invokeai.backend.model_manager.taxonomy import BaseModelType, ModelFormat, ModelType
+
+if TYPE_CHECKING:
+ from invokeai.app.services.invocation_services import InvocationServices
+
+
+class BaseExternalImageGenerationInvocation(BaseInvocation, WithMetadata, WithBoard):
+ """Generate images using an external provider."""
+
+ provider_id: ClassVar[str | None] = None
+
+ model: ModelIdentifierField = InputField(
+ description=FieldDescriptions.main_model,
+ ui_model_base=[BaseModelType.External],
+ ui_model_type=[ModelType.ExternalImageGenerator],
+ ui_model_format=[ModelFormat.ExternalApi],
+ )
+ mode: ExternalGenerationMode = InputField(
+ default="txt2img",
+ description="Generation mode. Not all modes are supported by every model; unsupported modes raise at runtime.",
+ )
+ prompt: str = InputField(description="Prompt")
+ seed: int | None = InputField(default=None, description=FieldDescriptions.seed)
+ num_images: int = InputField(default=1, gt=0, description="Number of images to generate")
+ width: int = InputField(default=1024, gt=0, description=FieldDescriptions.width)
+ height: int = InputField(default=1024, gt=0, description=FieldDescriptions.height)
+ image_size: str | None = InputField(default=None, description="Image size preset (e.g. 1K, 2K, 4K)")
+ init_image: ImageField | None = InputField(default=None, description="Init image for img2img/inpaint")
+ mask_image: ImageField | None = InputField(default=None, description="Mask image for inpaint")
+ reference_images: list[ImageField] = InputField(default=[], description="Reference images")
+
+ def _build_provider_options(self) -> dict[str, Any] | None:
+ """Override in provider-specific subclasses to pass extra options."""
+ return None
+
+ def invoke(self, context: InvocationContext) -> ImageCollectionOutput:
+ model_config = context.models.get_config(self.model)
+ if not isinstance(model_config, ExternalApiModelConfig):
+ raise ValueError("Selected model is not an external API model")
+
+ if self.provider_id is not None and model_config.provider_id != self.provider_id:
+ raise ValueError(
+ f"Selected model provider '{model_config.provider_id}' does not match node provider '{self.provider_id}'"
+ )
+
+ init_image = None
+ if self.init_image is not None:
+ init_image = context.images.get_pil(self.init_image.image_name, mode="RGB")
+
+ mask_image = None
+ if self.mask_image is not None:
+ mask_image = context.images.get_pil(self.mask_image.image_name, mode="L")
+
+ reference_images: list[ExternalReferenceImage] = []
+ for image_field in self.reference_images:
+ reference_image = context.images.get_pil(image_field.image_name, mode="RGB")
+ reference_images.append(ExternalReferenceImage(image=reference_image))
+
+ request = ExternalGenerationRequest(
+ model=model_config,
+ mode=self.mode,
+ prompt=self.prompt,
+ seed=self.seed,
+ num_images=self.num_images,
+ width=self.width,
+ height=self.height,
+ image_size=self.image_size,
+ init_image=init_image,
+ mask_image=mask_image,
+ reference_images=reference_images,
+ metadata=self._build_request_metadata(),
+ provider_options=self._build_provider_options(),
+ )
+
+ result = context._services.external_generation.generate(request)
+
+ outputs: list[ImageField] = []
+ for generated in result.images:
+ metadata = self._build_output_metadata(model_config, result, generated.seed)
+ image_dto = context.images.save(image=generated.image, metadata=metadata)
+ outputs.append(ImageField(image_name=image_dto.image_name))
+
+ return ImageCollectionOutput(collection=outputs)
+
+ def invoke_internal(self, context: InvocationContext, services: "InvocationServices") -> BaseInvocationOutput:
+ """Override default cache behavior so cache hits produce new gallery entries.
+
+ The standard invocation cache returns the cached output (with stale image_name
+ references) without re-running invoke(), which means no new images are saved
+ to the gallery on repeat invokes. For external API nodes — where the API call
+ is the expensive part — we want cache hits to skip the API call but still
+ produce fresh gallery entries by copying the cached images.
+ """
+ if services.configuration.node_cache_size == 0 or not self.use_cache:
+ return super().invoke_internal(context, services)
+
+ key = services.invocation_cache.create_key(self)
+ cached_value = services.invocation_cache.get(key)
+ if cached_value is None:
+ services.logger.debug(f'Invocation cache miss for type "{self.get_type()}": {self.id}')
+ output = self.invoke(context)
+ services.invocation_cache.save(key, output)
+ return output
+
+ services.logger.debug(f'Invocation cache hit for type "{self.get_type()}": {self.id}, duplicating images')
+ if not isinstance(cached_value, ImageCollectionOutput):
+ return cached_value
+
+ outputs: list[ImageField] = []
+ for image_field in cached_value.collection:
+ cached_image = context.images.get_pil(image_field.image_name, mode="RGB")
+ image_dto = context.images.save(image=cached_image)
+ outputs.append(ImageField(image_name=image_dto.image_name))
+ return ImageCollectionOutput(collection=outputs)
+
+ def _build_request_metadata(self) -> dict[str, Any] | None:
+ if self.metadata is None:
+ return None
+ return self.metadata.root
+
+ def _build_output_metadata(
+ self,
+ model_config: ExternalApiModelConfig,
+ result: ExternalGenerationResult,
+ image_seed: int | None,
+ ) -> MetadataField | None:
+ metadata: dict[str, Any] = {}
+
+ if self.metadata is not None:
+ metadata.update(self.metadata.root)
+
+ metadata.update(
+ {
+ "external_provider": model_config.provider_id,
+ "external_model_id": model_config.provider_model_id,
+ }
+ )
+
+ if self.image_size is not None:
+ metadata["image_size"] = self.image_size
+
+ provider_request_id = getattr(result, "provider_request_id", None)
+ if provider_request_id:
+ metadata["external_request_id"] = provider_request_id
+
+ provider_metadata = getattr(result, "provider_metadata", None)
+ if provider_metadata:
+ metadata["external_provider_metadata"] = provider_metadata
+
+ if image_seed is not None:
+ metadata["external_seed"] = image_seed
+
+ metadata.update(self._build_output_provider_metadata())
+
+ if not metadata:
+ return None
+ return MetadataField(root=metadata)
+
+ def _build_output_provider_metadata(self) -> dict[str, Any]:
+ """Override in provider-specific subclasses to add recall-relevant fields to the image metadata."""
+ return {}
+
+
+@invocation(
+ "openai_image_generation",
+ title="OpenAI Image Generation",
+ tags=["external", "generation", "openai"],
+ category="image",
+ version="1.0.0",
+)
+class OpenAIImageGenerationInvocation(BaseExternalImageGenerationInvocation):
+ """Generate images using an OpenAI-hosted external model."""
+
+ provider_id = "openai"
+
+ model: ModelIdentifierField = InputField(
+ description=FieldDescriptions.main_model,
+ ui_model_base=[BaseModelType.External],
+ ui_model_type=[ModelType.ExternalImageGenerator],
+ ui_model_format=[ModelFormat.ExternalApi],
+ ui_model_provider_id=["openai"],
+ )
+
+ # OpenAI's API has no img2img/inpaint distinction — the edits endpoint is used
+ # automatically when reference images are provided. Hide mode and init_image
+ # (init_image is functionally identical to a reference image), and hide
+ # mask_image since no OpenAI model supports inpainting.
+ mode: ExternalGenerationMode = InputField(default="txt2img", description="Generation mode.", ui_hidden=True)
+ init_image: ImageField | None = InputField(
+ default=None, description="Init image (use reference_images instead)", ui_hidden=True
+ )
+ mask_image: ImageField | None = InputField(default=None, description="Mask image for inpaint", ui_hidden=True)
+
+ quality: Literal["auto", "high", "medium", "low"] = InputField(default="auto", description="Output image quality")
+ background: Literal["auto", "transparent", "opaque"] = InputField(
+ default="auto", description="Background transparency handling"
+ )
+ input_fidelity: Literal["low", "high"] | None = InputField(
+ default=None, description="Fidelity to source images (edits only)"
+ )
+
+ def _build_provider_options(self) -> dict[str, Any]:
+ options: dict[str, Any] = {
+ "quality": self.quality,
+ "background": self.background,
+ }
+ if self.input_fidelity is not None:
+ options["input_fidelity"] = self.input_fidelity
+ return options
+
+ def _build_output_provider_metadata(self) -> dict[str, Any]:
+ metadata: dict[str, Any] = {
+ "openai_quality": self.quality,
+ "openai_background": self.background,
+ }
+ if self.input_fidelity is not None:
+ metadata["openai_input_fidelity"] = self.input_fidelity
+ return metadata
+
+
+@invocation(
+ "gemini_image_generation",
+ title="Gemini Image Generation",
+ tags=["external", "generation", "gemini"],
+ category="image",
+ version="1.0.0",
+)
+class GeminiImageGenerationInvocation(BaseExternalImageGenerationInvocation):
+ """Generate images using a Gemini-hosted external model."""
+
+ provider_id = "gemini"
+
+ model: ModelIdentifierField = InputField(
+ description=FieldDescriptions.main_model,
+ ui_model_base=[BaseModelType.External],
+ ui_model_type=[ModelType.ExternalImageGenerator],
+ ui_model_format=[ModelFormat.ExternalApi],
+ ui_model_provider_id=["gemini"],
+ )
+
+ # Gemini only supports txt2img — hide mode/init_image/mask_image fields
+ # that are inherited from the base class but not usable with any Gemini model.
+ mode: ExternalGenerationMode = InputField(default="txt2img", description="Generation mode.", ui_hidden=True)
+ init_image: ImageField | None = InputField(
+ default=None, description="Init image for img2img/inpaint", ui_hidden=True
+ )
+ mask_image: ImageField | None = InputField(default=None, description="Mask image for inpaint", ui_hidden=True)
+
+ temperature: float | None = InputField(default=None, ge=0.0, le=2.0, description="Sampling temperature")
+
+ def _build_provider_options(self) -> dict[str, Any] | None:
+ options: dict[str, Any] = {}
+ if self.temperature is not None:
+ options["temperature"] = self.temperature
+ return options or None
+
+ def _build_output_provider_metadata(self) -> dict[str, Any]:
+ metadata: dict[str, Any] = {}
+ if self.temperature is not None:
+ metadata["gemini_temperature"] = self.temperature
+ return metadata
diff --git a/invokeai/app/invocations/fields.py b/invokeai/app/invocations/fields.py
index fbe0e9a615..2fc5fd5a3c 100644
--- a/invokeai/app/invocations/fields.py
+++ b/invokeai/app/invocations/fields.py
@@ -455,6 +455,7 @@ class InputFieldJSONSchemaExtra(BaseModel):
ui_model_type: Optional[list[ModelType]] = None
ui_model_variant: Optional[list[ClipVariantType | ModelVariantType]] = None
ui_model_format: Optional[list[ModelFormat]] = None
+ ui_model_provider_id: Optional[list[str]] = None
model_config = ConfigDict(
validate_assignment=True,
@@ -636,6 +637,7 @@ def InputField(
ui_model_type: Optional[ModelType | list[ModelType]] = None,
ui_model_variant: Optional[ClipVariantType | ModelVariantType | list[ClipVariantType | ModelVariantType]] = None,
ui_model_format: Optional[ModelFormat | list[ModelFormat]] = None,
+ ui_model_provider_id: Optional[str | list[str]] = None,
) -> Any:
"""
Creates an input field for an invocation.
@@ -685,6 +687,11 @@ def InputField(
`ui_model_format=ModelFormat.Diffusers` will show only models in the diffusers format. This arg is only valid
if this Input field is annotated as a `ModelIdentifierField`.
+ ui_model_provider_id: Specifies the external provider id(s) to filter the model list by in the Workflow Editor.
+ For example, `ui_model_provider_id="openai"` will show only models registered under the OpenAI external provider.
+ This arg is only valid if this Input field is annotated as a `ModelIdentifierField` and the target models are
+ external API models.
+
ui_choice_labels: Specifies the labels to use for the choices in an enum field. If omitted, the enum values
will be used. This arg is only valid if the field is annotated with as a `Literal`. For example,
`Literal["choice1", "choice2", "choice3"]` with `ui_choice_labels={"choice1": "Choice 1", "choice2": "Choice 2",
@@ -724,6 +731,11 @@ def InputField(
json_schema_extra_.ui_model_format = ui_model_format
else:
json_schema_extra_.ui_model_format = [ui_model_format]
+ if ui_model_provider_id is not None:
+ if isinstance(ui_model_provider_id, list):
+ json_schema_extra_.ui_model_provider_id = ui_model_provider_id
+ else:
+ json_schema_extra_.ui_model_provider_id = [ui_model_provider_id]
if ui_type is not None:
json_schema_extra_.ui_type = ui_type
diff --git a/invokeai/app/services/config/config_default.py b/invokeai/app/services/config/config_default.py
index 4ea734c019..729eb1332c 100644
--- a/invokeai/app/services/config/config_default.py
+++ b/invokeai/app/services/config/config_default.py
@@ -22,6 +22,7 @@ from invokeai.backend.model_hash.model_hash import HASHING_ALGORITHMS
from invokeai.frontend.cli.arg_parser import InvokeAIArgs
INIT_FILE = Path("invokeai.yaml")
+API_KEYS_FILE = Path("api_keys.yaml")
DB_FILE = Path("invokeai.db")
LEGACY_INIT_FILE = Path("invokeai.init")
PRECISION = Literal["auto", "float16", "bfloat16", "float32"]
@@ -30,6 +31,12 @@ ATTENTION_SLICE_SIZE = Literal["auto", "balanced", "max", 1, 2, 3, 4, 5, 6, 7, 8
LOG_FORMAT = Literal["plain", "color", "syslog", "legacy"]
LOG_LEVEL = Literal["debug", "info", "warning", "error", "critical"]
CONFIG_SCHEMA_VERSION = "4.0.2"
+EXTERNAL_PROVIDER_CONFIG_FIELDS = (
+ "external_gemini_api_key",
+ "external_openai_api_key",
+ "external_gemini_base_url",
+ "external_openai_base_url",
+)
class URLRegexTokenPair(BaseModel):
@@ -113,6 +120,10 @@ class InvokeAIAppConfig(BaseSettings):
allow_unknown_models: Allow installation of models that we are unable to identify. If enabled, models will be marked as `unknown` in the database, and will not have any metadata associated with them. If disabled, unknown models will be rejected during installation.
multiuser: Enable multiuser support. When disabled, the application runs in single-user mode using a default system account with administrator privileges. When enabled, requires user authentication and authorization.
strict_password_checking: Enforce strict password requirements. When True, passwords must contain uppercase, lowercase, and numbers. When False (default), any password is accepted but its strength (weak/moderate/strong) is reported to the user.
+ external_gemini_api_key: API key for Gemini image generation.
+ external_openai_api_key: API key for OpenAI image generation.
+ external_gemini_base_url: Base URL override for Gemini image generation.
+ external_openai_base_url: Base URL override for OpenAI image generation.
"""
_root: Optional[Path] = PrivateAttr(default=None)
@@ -211,6 +222,16 @@ class InvokeAIAppConfig(BaseSettings):
multiuser: bool = Field(default=False, description="Enable multiuser support. When disabled, the application runs in single-user mode using a default system account with administrator privileges. When enabled, requires user authentication and authorization.")
strict_password_checking: bool = Field(default=False, description="Enforce strict password requirements. When True, passwords must contain uppercase, lowercase, and numbers. When False (default), any password is accepted but its strength (weak/moderate/strong) is reported to the user.")
+ # EXTERNAL PROVIDERS
+ external_gemini_api_key: Optional[str] = Field(default=None, description="API key for Gemini image generation.")
+ external_openai_api_key: Optional[str] = Field(default=None, description="API key for OpenAI image generation.")
+ external_gemini_base_url: Optional[str] = Field(
+ default=None, description="Base URL override for Gemini image generation."
+ )
+ external_openai_base_url: Optional[str] = Field(
+ default=None, description="Base URL override for OpenAI image generation."
+ )
+
# fmt: on
model_config = SettingsConfigDict(env_prefix="INVOKEAI_", env_ignore_empty=True)
@@ -292,6 +313,13 @@ class InvokeAIAppConfig(BaseSettings):
assert resolved_path is not None
return resolved_path
+ @property
+ def api_keys_file_path(self) -> Path:
+ """Path to api_keys.yaml, resolved to an absolute path.."""
+ resolved_path = self._resolve(API_KEYS_FILE)
+ assert resolved_path is not None
+ return resolved_path
+
@property
def outputs_path(self) -> Optional[Path]:
"""Path to the outputs directory, resolved to an absolute path.."""
@@ -504,6 +532,36 @@ def load_and_migrate_config(config_path: Path) -> InvokeAIAppConfig:
raise RuntimeError(f"Failed to load config file {config_path}: {e}") from e
+def load_external_api_keys(api_keys_file_path: Path) -> dict[str, str]:
+ """Load external provider config (API keys and base URLs) from a dedicated YAML file."""
+ if not api_keys_file_path.exists():
+ return {}
+
+ with open(api_keys_file_path, "rt", encoding=locale.getpreferredencoding()) as file:
+ loaded_api_keys: Any = yaml.safe_load(file)
+
+ if loaded_api_keys is None:
+ return {}
+
+ if not isinstance(loaded_api_keys, dict):
+ raise RuntimeError(f"Failed to load api keys file {api_keys_file_path}: expected a mapping")
+
+ parsed_api_keys: dict[str, str] = {}
+ for field_name in EXTERNAL_PROVIDER_CONFIG_FIELDS:
+ value = loaded_api_keys.get(field_name)
+ if value is None:
+ continue
+ if not isinstance(value, str):
+ raise RuntimeError(
+ f"Failed to load api keys file {api_keys_file_path}: value for '{field_name}' must be a string"
+ )
+ stripped_value = value.strip()
+ if stripped_value:
+ parsed_api_keys[field_name] = stripped_value
+
+ return parsed_api_keys
+
+
@lru_cache(maxsize=1)
def get_config() -> InvokeAIAppConfig:
"""Get the global singleton app config.
@@ -520,6 +578,7 @@ def get_config() -> InvokeAIAppConfig:
"""
# This object includes environment variables, as parsed by pydantic-settings
config = InvokeAIAppConfig()
+ env_fields_set = set(config.model_fields_set)
args = InvokeAIArgs.args
@@ -581,4 +640,11 @@ def get_config() -> InvokeAIAppConfig:
default_config = DefaultInvokeAIAppConfig()
default_config.write_file(config.config_file_path, as_example=False)
+ api_keys_from_file = load_external_api_keys(config.api_keys_file_path)
+ if api_keys_from_file:
+ # API keys file should take precedence over invokeai.yaml, but not over environment variables.
+ api_keys_to_apply = {key: value for key, value in api_keys_from_file.items() if key not in env_fields_set}
+ if api_keys_to_apply:
+ config.update_config(api_keys_to_apply, clobber=True)
+
return config
diff --git a/invokeai/app/services/external_generation/__init__.py b/invokeai/app/services/external_generation/__init__.py
new file mode 100644
index 0000000000..b933811d29
--- /dev/null
+++ b/invokeai/app/services/external_generation/__init__.py
@@ -0,0 +1,23 @@
+from invokeai.app.services.external_generation.external_generation_base import (
+ ExternalGenerationServiceBase,
+ ExternalProvider,
+)
+from invokeai.app.services.external_generation.external_generation_common import (
+ ExternalGeneratedImage,
+ ExternalGenerationRequest,
+ ExternalGenerationResult,
+ ExternalProviderStatus,
+ ExternalReferenceImage,
+)
+from invokeai.app.services.external_generation.external_generation_default import ExternalGenerationService
+
+__all__ = [
+ "ExternalGenerationRequest",
+ "ExternalGenerationResult",
+ "ExternalGeneratedImage",
+ "ExternalGenerationService",
+ "ExternalGenerationServiceBase",
+ "ExternalProvider",
+ "ExternalProviderStatus",
+ "ExternalReferenceImage",
+]
diff --git a/invokeai/app/services/external_generation/errors.py b/invokeai/app/services/external_generation/errors.py
new file mode 100644
index 0000000000..f61a6a8c73
--- /dev/null
+++ b/invokeai/app/services/external_generation/errors.py
@@ -0,0 +1,28 @@
+class ExternalGenerationError(Exception):
+ """Base error for external generation."""
+
+
+class ExternalProviderNotFoundError(ExternalGenerationError):
+ """Raised when no provider is registered for a model."""
+
+
+class ExternalProviderNotConfiguredError(ExternalGenerationError):
+ """Raised when a provider is missing required credentials."""
+
+
+class ExternalProviderCapabilityError(ExternalGenerationError):
+ """Raised when a request is not supported by provider capabilities."""
+
+
+class ExternalProviderRequestError(ExternalGenerationError):
+ """Raised when a provider rejects the request or returns an error."""
+
+
+class ExternalProviderRateLimitError(ExternalProviderRequestError):
+ """Raised when a provider returns HTTP 429 (rate limit exceeded)."""
+
+ retry_after: float | None
+
+ def __init__(self, message: str, retry_after: float | None = None) -> None:
+ super().__init__(message)
+ self.retry_after = retry_after
diff --git a/invokeai/app/services/external_generation/external_generation_base.py b/invokeai/app/services/external_generation/external_generation_base.py
new file mode 100644
index 0000000000..2145ff5ca4
--- /dev/null
+++ b/invokeai/app/services/external_generation/external_generation_base.py
@@ -0,0 +1,40 @@
+from __future__ import annotations
+
+from abc import ABC, abstractmethod
+from logging import Logger
+
+from invokeai.app.services.config import InvokeAIAppConfig
+from invokeai.app.services.external_generation.external_generation_common import (
+ ExternalGenerationRequest,
+ ExternalGenerationResult,
+ ExternalProviderStatus,
+)
+
+
+class ExternalProvider(ABC):
+ provider_id: str
+
+ def __init__(self, app_config: InvokeAIAppConfig, logger: Logger) -> None:
+ self._app_config = app_config
+ self._logger = logger
+
+ @abstractmethod
+ def is_configured(self) -> bool:
+ raise NotImplementedError
+
+ @abstractmethod
+ def generate(self, request: ExternalGenerationRequest) -> ExternalGenerationResult:
+ raise NotImplementedError
+
+ def get_status(self) -> ExternalProviderStatus:
+ return ExternalProviderStatus(provider_id=self.provider_id, configured=self.is_configured())
+
+
+class ExternalGenerationServiceBase(ABC):
+ @abstractmethod
+ def generate(self, request: ExternalGenerationRequest) -> ExternalGenerationResult:
+ raise NotImplementedError
+
+ @abstractmethod
+ def get_provider_statuses(self) -> dict[str, ExternalProviderStatus]:
+ raise NotImplementedError
diff --git a/invokeai/app/services/external_generation/external_generation_common.py b/invokeai/app/services/external_generation/external_generation_common.py
new file mode 100644
index 0000000000..f14bff52dd
--- /dev/null
+++ b/invokeai/app/services/external_generation/external_generation_common.py
@@ -0,0 +1,52 @@
+from __future__ import annotations
+
+from dataclasses import dataclass
+from typing import Any
+
+from PIL.Image import Image as PILImageType
+
+from invokeai.backend.model_manager.configs.external_api import ExternalApiModelConfig, ExternalGenerationMode
+
+
+@dataclass(frozen=True)
+class ExternalReferenceImage:
+ image: PILImageType
+
+
+@dataclass(frozen=True)
+class ExternalGenerationRequest:
+ model: ExternalApiModelConfig
+ mode: ExternalGenerationMode
+ prompt: str
+ seed: int | None
+ num_images: int
+ width: int
+ height: int
+ image_size: str | None
+ init_image: PILImageType | None
+ mask_image: PILImageType | None
+ reference_images: list[ExternalReferenceImage]
+ metadata: dict[str, Any] | None
+ provider_options: dict[str, Any] | None = None
+
+
+@dataclass(frozen=True)
+class ExternalGeneratedImage:
+ image: PILImageType
+ seed: int | None = None
+
+
+@dataclass(frozen=True)
+class ExternalGenerationResult:
+ images: list[ExternalGeneratedImage]
+ seed_used: int | None = None
+ provider_request_id: str | None = None
+ provider_metadata: dict[str, Any] | None = None
+ content_filters: dict[str, str] | None = None
+
+
+@dataclass(frozen=True)
+class ExternalProviderStatus:
+ provider_id: str
+ configured: bool
+ message: str | None = None
diff --git a/invokeai/app/services/external_generation/external_generation_default.py b/invokeai/app/services/external_generation/external_generation_default.py
new file mode 100644
index 0000000000..d6a266753b
--- /dev/null
+++ b/invokeai/app/services/external_generation/external_generation_default.py
@@ -0,0 +1,369 @@
+from __future__ import annotations
+
+import dataclasses
+import time
+from logging import Logger
+from typing import TYPE_CHECKING
+
+from PIL import Image
+from PIL.Image import Image as PILImageType
+
+from invokeai.app.services.external_generation.errors import (
+ ExternalProviderCapabilityError,
+ ExternalProviderNotConfiguredError,
+ ExternalProviderNotFoundError,
+ ExternalProviderRateLimitError,
+)
+from invokeai.app.services.external_generation.external_generation_base import (
+ ExternalGenerationServiceBase,
+ ExternalProvider,
+)
+from invokeai.app.services.external_generation.external_generation_common import (
+ ExternalGeneratedImage,
+ ExternalGenerationRequest,
+ ExternalGenerationResult,
+ ExternalProviderStatus,
+)
+from invokeai.backend.model_manager.configs.external_api import ExternalApiModelConfig, ExternalImageSize
+from invokeai.backend.model_manager.starter_models import STARTER_MODELS
+
+if TYPE_CHECKING:
+ from invokeai.app.services.model_records import ModelRecordServiceBase
+
+
+class ExternalGenerationService(ExternalGenerationServiceBase):
+ def __init__(
+ self,
+ providers: dict[str, ExternalProvider],
+ logger: Logger,
+ record_store: ModelRecordServiceBase | None = None,
+ ) -> None:
+ self._providers = providers
+ self._logger = logger
+ self._record_store = record_store
+
+ def generate(self, request: ExternalGenerationRequest) -> ExternalGenerationResult:
+ provider = self._providers.get(request.model.provider_id)
+ if provider is None:
+ raise ExternalProviderNotFoundError(f"No external provider registered for '{request.model.provider_id}'")
+
+ if not provider.is_configured():
+ raise ExternalProviderNotConfiguredError(f"Provider '{request.model.provider_id}' is missing credentials")
+
+ request = self._refresh_model_capabilities(request)
+ resize_to_original_inpaint_size = _get_resize_target_for_inpaint(request)
+ request = self._bucket_request(request)
+ request = self._drop_unsupported_capabilities(request)
+
+ self._validate_request(request)
+ result = self._generate_with_retry(provider, request)
+
+ if resize_to_original_inpaint_size is None:
+ return result
+
+ width, height = resize_to_original_inpaint_size
+ return _resize_result_images(result, width, height)
+
+ _MAX_RETRIES = 3
+ _DEFAULT_RETRY_DELAY = 10.0
+ _MAX_RETRY_DELAY = 60.0
+
+ def _generate_with_retry(
+ self, provider: ExternalProvider, request: ExternalGenerationRequest
+ ) -> ExternalGenerationResult:
+ for attempt in range(self._MAX_RETRIES):
+ try:
+ return provider.generate(request)
+ except ExternalProviderRateLimitError as exc:
+ if attempt == self._MAX_RETRIES - 1:
+ raise
+ delay = min(exc.retry_after or self._DEFAULT_RETRY_DELAY, self._MAX_RETRY_DELAY)
+ self._logger.warning(
+ "Rate limited by %s (attempt %d/%d), retrying in %.0fs",
+ request.model.provider_id,
+ attempt + 1,
+ self._MAX_RETRIES,
+ delay,
+ )
+ time.sleep(delay)
+ raise ExternalProviderRateLimitError("Rate limit exceeded after all retries")
+
+ def get_provider_statuses(self) -> dict[str, ExternalProviderStatus]:
+ return {provider_id: provider.get_status() for provider_id, provider in self._providers.items()}
+
+ def _validate_request(self, request: ExternalGenerationRequest) -> None:
+ capabilities = request.model.capabilities
+
+ self._logger.debug(
+ "Validating external request provider=%s model=%s mode=%s supported=%s",
+ request.model.provider_id,
+ request.model.provider_model_id,
+ request.mode,
+ capabilities.modes,
+ )
+
+ if request.mode not in capabilities.modes:
+ raise ExternalProviderCapabilityError(f"Mode '{request.mode}' is not supported by {request.model.name}")
+
+ if request.reference_images and not capabilities.supports_reference_images:
+ raise ExternalProviderCapabilityError(f"Reference images are not supported by {request.model.name}")
+
+ if capabilities.max_reference_images is not None:
+ if len(request.reference_images) > capabilities.max_reference_images:
+ raise ExternalProviderCapabilityError(
+ f"{request.model.name} supports at most {capabilities.max_reference_images} reference images"
+ )
+
+ if capabilities.max_images_per_request is not None and request.num_images > capabilities.max_images_per_request:
+ raise ExternalProviderCapabilityError(
+ f"{request.model.name} supports at most {capabilities.max_images_per_request} images per request"
+ )
+
+ if capabilities.max_image_size is not None:
+ if request.width > capabilities.max_image_size.width or request.height > capabilities.max_image_size.height:
+ raise ExternalProviderCapabilityError(
+ f"{request.model.name} supports a maximum size of {capabilities.max_image_size.width}x{capabilities.max_image_size.height}"
+ )
+
+ if capabilities.allowed_aspect_ratios:
+ aspect_ratio = _format_aspect_ratio(request.width, request.height)
+ if aspect_ratio not in capabilities.allowed_aspect_ratios:
+ size_ratio = None
+ if capabilities.aspect_ratio_sizes:
+ size_ratio = _ratio_for_size(request.width, request.height, capabilities.aspect_ratio_sizes)
+ if size_ratio is None or size_ratio not in capabilities.allowed_aspect_ratios:
+ ratio_label = size_ratio or aspect_ratio
+ raise ExternalProviderCapabilityError(
+ f"{request.model.name} does not support aspect ratio {ratio_label}"
+ )
+
+ required_modes = capabilities.input_image_required_for or ["img2img", "inpaint"]
+ if request.mode in required_modes and request.init_image is None:
+ raise ExternalProviderCapabilityError(
+ f"Mode '{request.mode}' requires an init image for {request.model.name}"
+ )
+
+ if request.mode == "inpaint" and request.mask_image is None:
+ raise ExternalProviderCapabilityError(
+ f"Mode '{request.mode}' requires a mask image for {request.model.name}"
+ )
+
+ def _drop_unsupported_capabilities(self, request: ExternalGenerationRequest) -> ExternalGenerationRequest:
+ """Silently drop request fields the selected model does not support so workflow-editor runs don't fail
+ when users wire them in regardless."""
+ capabilities = request.model.capabilities
+ updates: dict[str, object] = {}
+
+ if request.seed is not None and not capabilities.supports_seed:
+ self._logger.debug(
+ "Dropping seed for %s: model does not support seed control",
+ request.model.name,
+ )
+ updates["seed"] = None
+
+ if updates:
+ return dataclasses.replace(request, **updates)
+ return request
+
+ def _refresh_model_capabilities(self, request: ExternalGenerationRequest) -> ExternalGenerationRequest:
+ if self._record_store is None:
+ return request
+
+ try:
+ record = self._record_store.get_model(request.model.key)
+ except Exception:
+ record = None
+
+ if not isinstance(record, ExternalApiModelConfig):
+ return request
+
+ if record.key != request.model.key:
+ return request
+
+ if record.provider_id != request.model.provider_id:
+ return request
+
+ if record.provider_model_id != request.model.provider_model_id:
+ return request
+
+ record = _apply_starter_overrides(record)
+
+ if record == request.model:
+ return request
+
+ return ExternalGenerationRequest(
+ model=record,
+ mode=request.mode,
+ prompt=request.prompt,
+ seed=request.seed,
+ num_images=request.num_images,
+ width=request.width,
+ height=request.height,
+ image_size=request.image_size,
+ init_image=request.init_image,
+ mask_image=request.mask_image,
+ reference_images=request.reference_images,
+ metadata=request.metadata,
+ provider_options=request.provider_options,
+ )
+
+ def _bucket_request(self, request: ExternalGenerationRequest) -> ExternalGenerationRequest:
+ capabilities = request.model.capabilities
+ if not capabilities.allowed_aspect_ratios:
+ return request
+
+ aspect_ratio = _format_aspect_ratio(request.width, request.height)
+ size = None
+ if capabilities.aspect_ratio_sizes:
+ size = capabilities.aspect_ratio_sizes.get(aspect_ratio)
+
+ if size is not None:
+ if request.width == size.width and request.height == size.height:
+ return request
+ return self._bucket_to_size(request, size.width, size.height, aspect_ratio)
+
+ if aspect_ratio in capabilities.allowed_aspect_ratios:
+ return request
+
+ if not capabilities.aspect_ratio_sizes:
+ return request
+
+ closest = _select_closest_ratio(
+ request.width,
+ request.height,
+ capabilities.allowed_aspect_ratios,
+ )
+ if closest is None:
+ return request
+
+ size = capabilities.aspect_ratio_sizes.get(closest)
+ if size is None:
+ return request
+
+ return self._bucket_to_size(request, size.width, size.height, closest)
+
+ def _bucket_to_size(
+ self,
+ request: ExternalGenerationRequest,
+ width: int,
+ height: int,
+ ratio: str,
+ ) -> ExternalGenerationRequest:
+ self._logger.info(
+ "Bucketing external request provider=%s model=%s %sx%s -> %sx%s (ratio %s)",
+ request.model.provider_id,
+ request.model.provider_model_id,
+ request.width,
+ request.height,
+ width,
+ height,
+ ratio,
+ )
+
+ return ExternalGenerationRequest(
+ model=request.model,
+ mode=request.mode,
+ prompt=request.prompt,
+ seed=request.seed,
+ num_images=request.num_images,
+ width=width,
+ height=height,
+ image_size=request.image_size,
+ init_image=_resize_image(request.init_image, width, height, "RGB"),
+ mask_image=_resize_image(request.mask_image, width, height, "L"),
+ reference_images=request.reference_images,
+ metadata=request.metadata,
+ provider_options=request.provider_options,
+ )
+
+
+def _format_aspect_ratio(width: int, height: int) -> str:
+ divisor = _gcd(width, height)
+ return f"{width // divisor}:{height // divisor}"
+
+
+def _select_closest_ratio(width: int, height: int, ratios: list[str]) -> str | None:
+ ratio = width / height
+ parsed: list[tuple[str, float]] = []
+ for value in ratios:
+ parsed_ratio = _parse_ratio(value)
+ if parsed_ratio is not None:
+ parsed.append((value, parsed_ratio))
+ if not parsed:
+ return None
+ return min(parsed, key=lambda item: abs(item[1] - ratio))[0]
+
+
+def _ratio_for_size(width: int, height: int, sizes: dict[str, ExternalImageSize]) -> str | None:
+ for ratio, size in sizes.items():
+ if size.width == width and size.height == height:
+ return ratio
+ return None
+
+
+def _parse_ratio(value: str) -> float | None:
+ if ":" not in value:
+ return None
+ left, right = value.split(":", 1)
+ try:
+ numerator = float(left)
+ denominator = float(right)
+ except ValueError:
+ return None
+ if denominator == 0:
+ return None
+ return numerator / denominator
+
+
+def _gcd(a: int, b: int) -> int:
+ while b:
+ a, b = b, a % b
+ return a
+
+
+def _resize_image(image: PILImageType | None, width: int, height: int, mode: str) -> PILImageType | None:
+ if image is None:
+ return None
+ if image.width == width and image.height == height:
+ return image
+ return image.convert(mode).resize((width, height), Image.Resampling.LANCZOS)
+
+
+def _get_resize_target_for_inpaint(request: ExternalGenerationRequest) -> tuple[int, int] | None:
+ if request.mode != "inpaint" or request.init_image is None:
+ return None
+ return request.init_image.width, request.init_image.height
+
+
+def _resize_result_images(result: ExternalGenerationResult, width: int, height: int) -> ExternalGenerationResult:
+ resized_images = [
+ ExternalGeneratedImage(
+ image=generated.image
+ if generated.image.width == width and generated.image.height == height
+ else generated.image.resize((width, height), Image.Resampling.LANCZOS),
+ seed=generated.seed,
+ )
+ for generated in result.images
+ ]
+ return ExternalGenerationResult(
+ images=resized_images,
+ seed_used=result.seed_used,
+ provider_request_id=result.provider_request_id,
+ provider_metadata=result.provider_metadata,
+ content_filters=result.content_filters,
+ )
+
+
+def _apply_starter_overrides(model: ExternalApiModelConfig) -> ExternalApiModelConfig:
+ source = model.source or f"external://{model.provider_id}/{model.provider_model_id}"
+ starter_match = next((starter for starter in STARTER_MODELS if starter.source == source), None)
+ if starter_match is None:
+ return model
+ updates: dict[str, object] = {}
+ if starter_match.capabilities is not None:
+ updates["capabilities"] = starter_match.capabilities
+ if starter_match.default_settings is not None:
+ updates["default_settings"] = starter_match.default_settings
+ if not updates:
+ return model
+ return model.model_copy(update=updates)
diff --git a/invokeai/app/services/external_generation/image_utils.py b/invokeai/app/services/external_generation/image_utils.py
new file mode 100644
index 0000000000..a23c1f11d6
--- /dev/null
+++ b/invokeai/app/services/external_generation/image_utils.py
@@ -0,0 +1,19 @@
+from __future__ import annotations
+
+import base64
+import io
+
+from PIL import Image
+from PIL.Image import Image as PILImageType
+
+
+def encode_image_base64(image: PILImageType, format: str = "PNG") -> str:
+ buffer = io.BytesIO()
+ image.save(buffer, format=format)
+ return base64.b64encode(buffer.getvalue()).decode("ascii")
+
+
+def decode_image_base64(encoded: str) -> PILImageType:
+ data = base64.b64decode(encoded)
+ image = Image.open(io.BytesIO(data))
+ return image.convert("RGB")
diff --git a/invokeai/app/services/external_generation/providers/__init__.py b/invokeai/app/services/external_generation/providers/__init__.py
new file mode 100644
index 0000000000..9e380fca1e
--- /dev/null
+++ b/invokeai/app/services/external_generation/providers/__init__.py
@@ -0,0 +1,4 @@
+from invokeai.app.services.external_generation.providers.gemini import GeminiProvider
+from invokeai.app.services.external_generation.providers.openai import OpenAIProvider
+
+__all__ = ["GeminiProvider", "OpenAIProvider"]
diff --git a/invokeai/app/services/external_generation/providers/gemini.py b/invokeai/app/services/external_generation/providers/gemini.py
new file mode 100644
index 0000000000..a642160eda
--- /dev/null
+++ b/invokeai/app/services/external_generation/providers/gemini.py
@@ -0,0 +1,246 @@
+from __future__ import annotations
+
+import requests
+
+from invokeai.app.services.external_generation.errors import (
+ ExternalProviderRateLimitError,
+ ExternalProviderRequestError,
+)
+from invokeai.app.services.external_generation.external_generation_base import ExternalProvider
+from invokeai.app.services.external_generation.external_generation_common import (
+ ExternalGeneratedImage,
+ ExternalGenerationRequest,
+ ExternalGenerationResult,
+)
+from invokeai.app.services.external_generation.image_utils import decode_image_base64, encode_image_base64
+
+
+class GeminiProvider(ExternalProvider):
+ provider_id = "gemini"
+ _SYSTEM_INSTRUCTION = (
+ "You are an image generation model. Always respond with an image based on the user's prompt. "
+ "Do not return text-only responses. If the user input is not an edit instruction, "
+ "interpret it as a request to create a new image."
+ )
+
+ def is_configured(self) -> bool:
+ return bool(self._app_config.external_gemini_api_key)
+
+ def generate(self, request: ExternalGenerationRequest) -> ExternalGenerationResult:
+ api_key = self._app_config.external_gemini_api_key
+ if not api_key:
+ raise ExternalProviderRequestError("Gemini API key is not configured")
+
+ base_url = (self._app_config.external_gemini_base_url or "https://generativelanguage.googleapis.com").rstrip(
+ "/"
+ )
+ if not base_url.endswith("/v1") and not base_url.endswith("/v1beta"):
+ base_url = f"{base_url}/v1beta"
+ model_id = request.model.provider_model_id.removeprefix("models/")
+ endpoint = f"{base_url}/models/{model_id}:generateContent"
+
+ request_parts: list[dict[str, object]] = []
+
+ if request.init_image is not None:
+ request_parts.append(
+ {
+ "inlineData": {
+ "mimeType": "image/png",
+ "data": encode_image_base64(request.init_image),
+ }
+ }
+ )
+
+ request_parts.append({"text": request.prompt})
+
+ for reference in request.reference_images:
+ request_parts.append(
+ {
+ "inlineData": {
+ "mimeType": "image/png",
+ "data": encode_image_base64(reference.image),
+ }
+ }
+ )
+
+ opts = request.provider_options or {}
+
+ generation_config: dict[str, object] = {
+ "candidateCount": request.num_images,
+ "responseModalities": ["IMAGE"],
+ }
+ if "temperature" in opts:
+ generation_config["temperature"] = opts["temperature"]
+ aspect_ratio = _select_aspect_ratio(
+ request.width,
+ request.height,
+ request.model.capabilities.allowed_aspect_ratios,
+ )
+ uses_image_config = request.model.capabilities.resolution_presets is not None
+ if uses_image_config:
+ image_config: dict[str, str] = {}
+ if aspect_ratio is not None:
+ image_config["aspectRatio"] = aspect_ratio
+ if request.image_size is not None:
+ image_config["imageSize"] = request.image_size
+ if image_config:
+ generation_config["imageConfig"] = image_config
+ system_instruction = self._SYSTEM_INSTRUCTION
+ if request.init_image is not None:
+ system_instruction = (
+ f"{system_instruction} An input image is provided. "
+ "Treat the prompt as an edit instruction and modify the image accordingly. "
+ "Do not return the original image unchanged."
+ )
+ if not uses_image_config and aspect_ratio is not None:
+ system_instruction = f"{system_instruction} Use an aspect ratio of {aspect_ratio}."
+
+ payload: dict[str, object] = {
+ "systemInstruction": {"parts": [{"text": system_instruction}]},
+ "contents": [{"role": "user", "parts": request_parts}],
+ "generationConfig": generation_config,
+ }
+
+ response = requests.post(
+ endpoint,
+ params={"key": api_key},
+ json=payload,
+ timeout=120,
+ )
+
+ if not response.ok:
+ if response.status_code == 429:
+ retry_after = _parse_retry_after(response.headers.get("retry-after"))
+ raise ExternalProviderRateLimitError(
+ f"Gemini rate limit exceeded. {f'Retry after {retry_after:.0f}s.' if retry_after else 'Please try again later.'}",
+ retry_after=retry_after,
+ )
+ raise ExternalProviderRequestError(
+ f"Gemini request failed with status {response.status_code} for model '{model_id}': {response.text}"
+ )
+
+ data = response.json()
+ if not isinstance(data, dict):
+ raise ExternalProviderRequestError("Gemini response payload was not a JSON object")
+ images: list[ExternalGeneratedImage] = []
+ text_parts: list[str] = []
+ finish_messages: list[str] = []
+ candidates = data.get("candidates")
+ if not isinstance(candidates, list):
+ raise ExternalProviderRequestError("Gemini response payload missing candidates")
+ for candidate in candidates:
+ if not isinstance(candidate, dict):
+ continue
+ finish_message = candidate.get("finishMessage")
+ finish_reason = candidate.get("finishReason")
+ if isinstance(finish_message, str):
+ finish_messages.append(finish_message)
+ elif isinstance(finish_reason, str):
+ finish_messages.append(f"Finish reason: {finish_reason}")
+ for part in _iter_response_parts(candidate):
+ inline_data = part.get("inline_data") or part.get("inlineData")
+ if isinstance(inline_data, dict):
+ encoded = inline_data.get("data")
+ if encoded:
+ image = decode_image_base64(encoded)
+ images.append(ExternalGeneratedImage(image=image, seed=request.seed))
+ continue
+ file_data = part.get("fileData") or part.get("file_data")
+ if isinstance(file_data, dict):
+ file_uri = file_data.get("fileUri") or file_data.get("file_uri")
+ if isinstance(file_uri, str) and file_uri:
+ raise ExternalProviderRequestError(
+ f"Gemini returned fileUri instead of inline image data: {file_uri}"
+ )
+ text = part.get("text")
+ if isinstance(text, str):
+ text_parts.append(text)
+
+ if not images:
+ self._logger.error("Gemini response contained no images: %s", data)
+ detail = ""
+ if finish_messages:
+ combined = " ".join(message.strip() for message in finish_messages if message.strip())
+ if combined:
+ detail = f" Response status: {combined[:500]}"
+ elif text_parts:
+ combined = " ".join(text_parts).strip()
+ if combined:
+ detail = f" Response text: {combined[:500]}"
+ raise ExternalProviderRequestError(f"Gemini response contained no images.{detail}")
+
+ return ExternalGenerationResult(
+ images=images,
+ seed_used=request.seed,
+ provider_metadata={"model": request.model.provider_model_id},
+ )
+
+
+def _iter_response_parts(candidate: dict[str, object]) -> list[dict[str, object]]:
+ content = candidate.get("content")
+ if isinstance(content, dict):
+ content_parts = content.get("parts")
+ if isinstance(content_parts, list):
+ return [part for part in content_parts if isinstance(part, dict)]
+ contents = candidate.get("contents")
+ if isinstance(contents, list):
+ parts: list[dict[str, object]] = []
+ for item in contents:
+ if not isinstance(item, dict):
+ continue
+ item_parts = item.get("parts")
+ if isinstance(item_parts, list):
+ parts.extend([part for part in item_parts if isinstance(part, dict)])
+ if parts:
+ return parts
+ return []
+
+
+def _select_aspect_ratio(width: int, height: int, allowed: list[str] | None) -> str | None:
+ if width <= 0 or height <= 0:
+ return None
+ ratio = width / height
+ default_ratio = _format_aspect_ratio(width, height)
+ if not allowed:
+ return default_ratio
+ parsed = [(value, _parse_ratio(value)) for value in allowed]
+ filtered = [(value, parsed_ratio) for value, parsed_ratio in parsed if parsed_ratio is not None]
+ if not filtered:
+ return default_ratio
+ return min(filtered, key=lambda item: abs(item[1] - ratio))[0]
+
+
+def _format_aspect_ratio(width: int, height: int) -> str | None:
+ if width <= 0 or height <= 0:
+ return None
+ divisor = _gcd(width, height)
+ return f"{width // divisor}:{height // divisor}"
+
+
+def _parse_ratio(value: str) -> float | None:
+ if ":" not in value:
+ return None
+ left, right = value.split(":", 1)
+ try:
+ numerator = float(left)
+ denominator = float(right)
+ except ValueError:
+ return None
+ if denominator == 0:
+ return None
+ return numerator / denominator
+
+
+def _parse_retry_after(value: str | None) -> float | None:
+ if not value:
+ return None
+ try:
+ return float(value)
+ except ValueError:
+ return None
+
+
+def _gcd(a: int, b: int) -> int:
+ while b:
+ a, b = b, a % b
+ return a
diff --git a/invokeai/app/services/external_generation/providers/openai.py b/invokeai/app/services/external_generation/providers/openai.py
new file mode 100644
index 0000000000..033f6cd4a6
--- /dev/null
+++ b/invokeai/app/services/external_generation/providers/openai.py
@@ -0,0 +1,159 @@
+from __future__ import annotations
+
+import io
+
+import requests
+from PIL.Image import Image as PILImageType
+
+from invokeai.app.services.external_generation.errors import (
+ ExternalProviderRateLimitError,
+ ExternalProviderRequestError,
+)
+from invokeai.app.services.external_generation.external_generation_base import ExternalProvider
+from invokeai.app.services.external_generation.external_generation_common import (
+ ExternalGeneratedImage,
+ ExternalGenerationRequest,
+ ExternalGenerationResult,
+)
+from invokeai.app.services.external_generation.image_utils import decode_image_base64
+
+
+class OpenAIProvider(ExternalProvider):
+ provider_id = "openai"
+
+ _GPT_IMAGE_MODELS = {"gpt-image-1", "gpt-image-1.5", "gpt-image-1-mini"}
+
+ def is_configured(self) -> bool:
+ return bool(self._app_config.external_openai_api_key)
+
+ def generate(self, request: ExternalGenerationRequest) -> ExternalGenerationResult:
+ api_key = self._app_config.external_openai_api_key
+ if not api_key:
+ raise ExternalProviderRequestError("OpenAI API key is not configured")
+
+ model_id = request.model.provider_model_id
+ is_gpt_image = model_id in self._GPT_IMAGE_MODELS
+ size = f"{request.width}x{request.height}"
+ base_url = (self._app_config.external_openai_base_url or "https://api.openai.com").rstrip("/")
+ headers = {"Authorization": f"Bearer {api_key}"}
+
+ use_edits_endpoint = request.mode != "txt2img" or bool(request.reference_images)
+
+ opts = request.provider_options or {}
+
+ if not use_edits_endpoint:
+ payload: dict[str, object] = {
+ "model": model_id,
+ "prompt": request.prompt,
+ "n": request.num_images,
+ "size": size,
+ }
+ # GPT Image models use output_format; DALL-E uses response_format
+ if is_gpt_image:
+ payload["output_format"] = "png"
+ else:
+ payload["response_format"] = "b64_json"
+ if is_gpt_image:
+ if opts.get("quality") and opts["quality"] != "auto":
+ payload["quality"] = opts["quality"]
+ if opts.get("background") and opts["background"] != "auto":
+ payload["background"] = opts["background"]
+ response = requests.post(
+ f"{base_url}/v1/images/generations",
+ headers=headers,
+ json=payload,
+ timeout=120,
+ )
+ else:
+ images: list[PILImageType] = []
+ if request.init_image is not None:
+ images.append(request.init_image)
+ images.extend(reference.image for reference in request.reference_images)
+ if not images:
+ raise ExternalProviderRequestError(
+ "OpenAI image edits require at least one image (init image or reference image)"
+ )
+
+ files: list[tuple[str, tuple[str, io.BytesIO, str]]] = []
+ image_field_name = "image" if len(images) == 1 else "image[]"
+ for index, image in enumerate(images):
+ image_buffer = io.BytesIO()
+ image.save(image_buffer, format="PNG")
+ image_buffer.seek(0)
+ files.append((image_field_name, (f"image_{index}.png", image_buffer, "image/png")))
+
+ if request.mask_image is not None:
+ mask_buffer = io.BytesIO()
+ request.mask_image.save(mask_buffer, format="PNG")
+ mask_buffer.seek(0)
+ files.append(("mask", ("mask.png", mask_buffer, "image/png")))
+
+ data: dict[str, object] = {
+ "model": model_id,
+ "prompt": request.prompt,
+ "n": request.num_images,
+ "size": size,
+ }
+ if is_gpt_image:
+ data["output_format"] = "png"
+ else:
+ data["response_format"] = "b64_json"
+ if is_gpt_image:
+ if opts.get("quality") and opts["quality"] != "auto":
+ data["quality"] = opts["quality"]
+ if opts.get("background") and opts["background"] != "auto":
+ data["background"] = opts["background"]
+ if opts.get("input_fidelity"):
+ data["input_fidelity"] = opts["input_fidelity"]
+ response = requests.post(
+ f"{base_url}/v1/images/edits",
+ headers=headers,
+ data=data,
+ files=files,
+ timeout=120,
+ )
+
+ if not response.ok:
+ if response.status_code == 429:
+ retry_after = _parse_retry_after(response.headers.get("retry-after"))
+ raise ExternalProviderRateLimitError(
+ f"OpenAI rate limit exceeded. {f'Retry after {retry_after:.0f}s.' if retry_after else 'Please try again later.'}",
+ retry_after=retry_after,
+ )
+ raise ExternalProviderRequestError(
+ f"OpenAI request failed with status {response.status_code}: {response.text}"
+ )
+
+ response_payload = response.json()
+ if not isinstance(response_payload, dict):
+ raise ExternalProviderRequestError("OpenAI response payload was not a JSON object")
+ images: list[ExternalGeneratedImage] = []
+ data_items = response_payload.get("data")
+ if not isinstance(data_items, list):
+ raise ExternalProviderRequestError("OpenAI response payload missing image data")
+ for item in data_items:
+ if not isinstance(item, dict):
+ continue
+ encoded = item.get("b64_json")
+ if not encoded:
+ continue
+ images.append(ExternalGeneratedImage(image=decode_image_base64(encoded), seed=request.seed))
+
+ if not images:
+ raise ExternalProviderRequestError("OpenAI response contained no images")
+
+ return ExternalGenerationResult(
+ images=images,
+ seed_used=request.seed,
+ provider_request_id=response.headers.get("x-request-id"),
+ provider_metadata={"model": model_id},
+ )
+
+
+def _parse_retry_after(value: str | None) -> float | None:
+ if not value:
+ return None
+ try:
+ return float(value)
+ except ValueError:
+ return None
diff --git a/invokeai/app/services/external_generation/startup.py b/invokeai/app/services/external_generation/startup.py
new file mode 100644
index 0000000000..a95e6c9418
--- /dev/null
+++ b/invokeai/app/services/external_generation/startup.py
@@ -0,0 +1,59 @@
+from logging import Logger
+from typing import TYPE_CHECKING
+
+from invokeai.app.services.model_records.model_records_base import ModelRecordChanges
+from invokeai.backend.model_manager.configs.external_api import ExternalApiModelConfig
+from invokeai.backend.model_manager.starter_models import STARTER_MODELS
+from invokeai.backend.model_manager.taxonomy import BaseModelType, ModelType
+
+if TYPE_CHECKING:
+ from invokeai.app.services.model_manager.model_manager_base import ModelManagerServiceBase
+
+
+def sync_configured_external_starter_models(
+ configured_provider_ids: set[str],
+ model_manager: "ModelManagerServiceBase",
+ logger: Logger,
+) -> list[str]:
+ """Queue missing external starter models for configured providers."""
+
+ if not configured_provider_ids:
+ return []
+
+ installed_sources = {
+ model.source
+ for model in model_manager.store.search_by_attr(
+ base_model=BaseModelType.External,
+ model_type=ModelType.ExternalImageGenerator,
+ )
+ if isinstance(model, ExternalApiModelConfig) and model.source
+ }
+
+ queued_sources: list[str] = []
+ for starter_model in STARTER_MODELS:
+ if not starter_model.source.startswith("external://"):
+ continue
+
+ provider_id = starter_model.source.removeprefix("external://").split("/", 1)[0]
+ if provider_id not in configured_provider_ids:
+ continue
+
+ if starter_model.source in installed_sources:
+ continue
+
+ model_manager.install.heuristic_import(
+ starter_model.source,
+ config=ModelRecordChanges(
+ name=starter_model.name,
+ base=starter_model.base,
+ type=starter_model.type,
+ description=starter_model.description,
+ format=starter_model.format,
+ capabilities=starter_model.capabilities,
+ default_settings=starter_model.default_settings,
+ ),
+ )
+ queued_sources.append(starter_model.source)
+ logger.info("Queued external starter model sync for %s", starter_model.source)
+
+ return queued_sources
diff --git a/invokeai/app/services/invocation_services.py b/invokeai/app/services/invocation_services.py
index 7a33f49940..2c95f87b41 100644
--- a/invokeai/app/services/invocation_services.py
+++ b/invokeai/app/services/invocation_services.py
@@ -21,6 +21,7 @@ if TYPE_CHECKING:
from invokeai.app.services.config import InvokeAIAppConfig
from invokeai.app.services.download import DownloadQueueServiceBase
from invokeai.app.services.events.events_base import EventServiceBase
+ from invokeai.app.services.external_generation.external_generation_base import ExternalGenerationServiceBase
from invokeai.app.services.image_files.image_files_base import ImageFileStorageBase
from invokeai.app.services.image_records.image_records_base import ImageRecordStorageBase
from invokeai.app.services.images.images_base import ImageServiceABC
@@ -63,6 +64,7 @@ class InvocationServices:
model_relationships: "ModelRelationshipsServiceABC",
model_relationship_records: "ModelRelationshipRecordStorageBase",
download_queue: "DownloadQueueServiceBase",
+ external_generation: "ExternalGenerationServiceBase",
performance_statistics: "InvocationStatsServiceBase",
session_queue: "SessionQueueBase",
session_processor: "SessionProcessorBase",
@@ -94,6 +96,7 @@ class InvocationServices:
self.model_relationships = model_relationships
self.model_relationship_records = model_relationship_records
self.download_queue = download_queue
+ self.external_generation = external_generation
self.performance_statistics = performance_statistics
self.session_queue = session_queue
self.session_processor = session_processor
diff --git a/invokeai/app/services/model_install/model_install_common.py b/invokeai/app/services/model_install/model_install_common.py
index 1006135a95..f223c4698c 100644
--- a/invokeai/app/services/model_install/model_install_common.py
+++ b/invokeai/app/services/model_install/model_install_common.py
@@ -139,12 +139,27 @@ class URLModelSource(StringLikeSource):
return str(self.url)
-ModelSource = Annotated[Union[LocalModelSource, HFModelSource, URLModelSource], Field(discriminator="type")]
+class ExternalModelSource(StringLikeSource):
+ """An external provider model identifier."""
+
+ provider_id: str
+ provider_model_id: str
+ type: Literal["external"] = "external"
+
+ def __str__(self) -> str:
+ return f"external://{self.provider_id}/{self.provider_model_id}"
+
+
+ModelSource = Annotated[
+ Union[LocalModelSource, HFModelSource, URLModelSource, ExternalModelSource],
+ Field(discriminator="type"),
+]
MODEL_SOURCE_TO_TYPE_MAP = {
URLModelSource: ModelSourceType.Url,
HFModelSource: ModelSourceType.HFRepoID,
LocalModelSource: ModelSourceType.Path,
+ ExternalModelSource: ModelSourceType.External,
}
diff --git a/invokeai/app/services/model_install/model_install_default.py b/invokeai/app/services/model_install/model_install_default.py
index 91acc22d03..49d3cfdf7f 100644
--- a/invokeai/app/services/model_install/model_install_default.py
+++ b/invokeai/app/services/model_install/model_install_default.py
@@ -28,6 +28,7 @@ from invokeai.app.services.invoker import Invoker
from invokeai.app.services.model_install.model_install_base import ModelInstallServiceBase
from invokeai.app.services.model_install.model_install_common import (
MODEL_SOURCE_TO_TYPE_MAP,
+ ExternalModelSource,
HFModelSource,
InstallStatus,
InvalidModelConfigException,
@@ -37,10 +38,15 @@ from invokeai.app.services.model_install.model_install_common import (
StringLikeSource,
URLModelSource,
)
-from invokeai.app.services.model_records import DuplicateModelException, ModelRecordServiceBase
+from invokeai.app.services.model_records import DuplicateModelException, ModelRecordServiceBase, UnknownModelException
from invokeai.app.services.model_records.model_records_base import ModelRecordChanges
from invokeai.app.util.misc import get_iso_timestamp
from invokeai.backend.model_manager.configs.base import Checkpoint_Config_Base
+from invokeai.backend.model_manager.configs.external_api import (
+ ExternalApiModelConfig,
+ ExternalApiModelDefaultSettings,
+ ExternalModelCapabilities,
+)
from invokeai.backend.model_manager.configs.factory import (
AnyModelConfig,
ModelConfigFactory,
@@ -55,7 +61,13 @@ from invokeai.backend.model_manager.metadata import (
)
from invokeai.backend.model_manager.metadata.metadata_base import HuggingFaceMetadata
from invokeai.backend.model_manager.search import ModelSearch
-from invokeai.backend.model_manager.taxonomy import ModelRepoVariant, ModelSourceType
+from invokeai.backend.model_manager.taxonomy import (
+ BaseModelType,
+ ModelFormat,
+ ModelRepoVariant,
+ ModelSourceType,
+ ModelType,
+)
from invokeai.backend.model_manager.util.lora_metadata_extractor import apply_lora_metadata
from invokeai.backend.util import InvokeAILogger
from invokeai.backend.util.catch_sigint import catch_sigint
@@ -459,6 +471,9 @@ class ModelInstallService(ModelInstallServiceBase):
install_job = self._import_from_hf(source, config)
elif isinstance(source, URLModelSource):
install_job = self._import_from_url(source, config)
+ elif isinstance(source, ExternalModelSource):
+ install_job = self._import_external_model(source, config)
+ self._put_in_queue(install_job)
else:
raise ValueError(f"Unsupported model source: '{type(source)}'")
@@ -758,7 +773,13 @@ class ModelInstallService(ModelInstallServiceBase):
source_obj: Optional[StringLikeSource] = None
source_stripped = source.strip('"')
- if Path(source_stripped).exists(): # A local file or directory
+ if source_stripped.startswith("external://"):
+ external_id = source_stripped.removeprefix("external://")
+ provider_id, _, provider_model_id = external_id.partition("/")
+ if not provider_id or not provider_model_id:
+ raise ValueError(f"Invalid external model source: '{source_stripped}'")
+ source_obj = ExternalModelSource(provider_id=provider_id, provider_model_id=provider_model_id)
+ elif Path(source_stripped).exists(): # A local file or directory
source_obj = LocalModelSource(path=Path(source_stripped))
elif match := re.match(hf_repoid_re, source):
source_obj = HFModelSource(
@@ -850,6 +871,9 @@ class ModelInstallService(ModelInstallServiceBase):
self._logger.info(f"Installer thread {threading.get_ident()} exiting")
def _register_or_install(self, job: ModelInstallJob) -> None:
+ if isinstance(job.source, ExternalModelSource):
+ self._register_external_model(job)
+ return
# local jobs will be in waiting state, remote jobs will be downloading state
job.total_bytes = self._stat_size(job.local_path)
job.bytes = job.total_bytes
@@ -870,6 +894,71 @@ class ModelInstallService(ModelInstallServiceBase):
job.config_out = self.record_store.get_model(key)
self._signal_job_completed(job)
+ def _register_external_model(self, job: ModelInstallJob) -> None:
+ job.total_bytes = 0
+ job.bytes = 0
+ self._signal_job_running(job)
+ job.config_in.source = str(job.source)
+ job.config_in.source_type = MODEL_SOURCE_TO_TYPE_MAP[job.source.__class__]
+
+ provider_id = job.source.provider_id
+ provider_model_id = job.source.provider_model_id
+ capabilities = job.config_in.capabilities or ExternalModelCapabilities()
+ default_settings = (
+ job.config_in.default_settings
+ if isinstance(job.config_in.default_settings, ExternalApiModelDefaultSettings)
+ else None
+ )
+ name = job.config_in.name or f"{provider_id} {provider_model_id}"
+ key = job.config_in.key or slugify(f"{provider_id}-{provider_model_id}")
+
+ existing_external = next(
+ (
+ model
+ for model in self.record_store.search_by_attr(
+ base_model=BaseModelType.External, model_type=ModelType.ExternalImageGenerator
+ )
+ if isinstance(model, ExternalApiModelConfig)
+ and model.provider_id == provider_id
+ and model.provider_model_id == provider_model_id
+ ),
+ None,
+ )
+
+ if existing_external is not None:
+ key = existing_external.key
+ else:
+ try:
+ self.record_store.get_model(key)
+ raise DuplicateModelException(
+ f"Model key '{key}' already exists. Provide a different key to install this external model."
+ )
+ except UnknownModelException:
+ pass
+
+ config = ExternalApiModelConfig(
+ key=key,
+ name=name,
+ description=job.config_in.description,
+ provider_id=provider_id,
+ provider_model_id=provider_model_id,
+ capabilities=capabilities,
+ default_settings=default_settings,
+ source=str(job.source),
+ source_type=MODEL_SOURCE_TO_TYPE_MAP[job.source.__class__],
+ path="",
+ hash="",
+ file_size=0,
+ )
+
+ if existing_external is not None:
+ self.record_store.replace_model(existing_external.key, config)
+ else:
+ self.record_store.add_model(config)
+
+ job.config_out = self.record_store.get_model(config.key)
+ self._signal_job_completed(job)
+
def _set_error(self, install_job: ModelInstallJob, excp: Exception) -> None:
multifile_download_job = install_job._multifile_job
if multifile_download_job and any(
@@ -905,6 +994,8 @@ class ModelInstallService(ModelInstallServiceBase):
"""Scan the models directory for missing models and return a list of them."""
missing_models: list[AnyModelConfig] = []
for model_config in self.record_store.all_models():
+ if model_config.base == BaseModelType.External or model_config.format == ModelFormat.ExternalApi:
+ continue
if not (self.app_config.models_path / model_config.path).resolve().exists():
missing_models.append(model_config)
return missing_models
@@ -1046,6 +1137,19 @@ class ModelInstallService(ModelInstallServiceBase):
remote_files=remote_files,
)
+ def _import_external_model(
+ self,
+ source: ExternalModelSource,
+ config: Optional[ModelRecordChanges] = None,
+ ) -> ModelInstallJob:
+ return ModelInstallJob(
+ id=self._next_id(),
+ source=source,
+ config_in=config or ModelRecordChanges(),
+ local_path=self._app_config.models_path,
+ inplace=True,
+ )
+
def _import_remote_model(
self,
source: HFModelSource | URLModelSource,
diff --git a/invokeai/app/services/model_records/model_records_base.py b/invokeai/app/services/model_records/model_records_base.py
index dcdc0ce595..6420949c29 100644
--- a/invokeai/app/services/model_records/model_records_base.py
+++ b/invokeai/app/services/model_records/model_records_base.py
@@ -13,6 +13,10 @@ from pydantic import BaseModel, Field
from invokeai.app.services.shared.pagination import PaginatedResults
from invokeai.app.util.model_exclude_null import BaseModelExcludeNull
from invokeai.backend.model_manager.configs.controlnet import ControlAdapterDefaultSettings
+from invokeai.backend.model_manager.configs.external_api import (
+ ExternalApiModelDefaultSettings,
+ ExternalModelCapabilities,
+)
from invokeai.backend.model_manager.configs.factory import AnyModelConfig
from invokeai.backend.model_manager.configs.lora import LoraModelDefaultSettings
from invokeai.backend.model_manager.configs.main import MainModelDefaultSettings
@@ -87,8 +91,19 @@ class ModelRecordChanges(BaseModelExcludeNull):
file_size: Optional[int] = Field(description="Size of model file", default=None)
format: Optional[str] = Field(description="format of model file", default=None)
trigger_phrases: Optional[set[str]] = Field(description="Set of trigger phrases for this model", default=None)
- default_settings: Optional[MainModelDefaultSettings | LoraModelDefaultSettings | ControlAdapterDefaultSettings] = (
- Field(description="Default settings for this model", default=None)
+ default_settings: Optional[
+ MainModelDefaultSettings
+ | LoraModelDefaultSettings
+ | ControlAdapterDefaultSettings
+ | ExternalApiModelDefaultSettings
+ ] = Field(description="Default settings for this model", default=None)
+
+ # External API model changes
+ provider_id: Optional[str] = Field(description="External provider identifier", default=None)
+ provider_model_id: Optional[str] = Field(description="External provider model identifier", default=None)
+ capabilities: Optional[ExternalModelCapabilities] = Field(
+ description="External model capabilities",
+ default=None,
)
cpu_only: Optional[bool] = Field(description="Whether this model should run on CPU only", default=None)
diff --git a/invokeai/app/services/shared/invocation_context.py b/invokeai/app/services/shared/invocation_context.py
index 67e3c99f1a..e38766d5ba 100644
--- a/invokeai/app/services/shared/invocation_context.py
+++ b/invokeai/app/services/shared/invocation_context.py
@@ -388,6 +388,8 @@ class ModelsInterface(InvocationContextInterface):
submodel_type = submodel_type or identifier.submodel_type
model = self._services.model_manager.store.get_model(identifier.key)
+ self._raise_if_external(model)
+
message = f"Loading model {model.name}"
if submodel_type:
message += f" ({submodel_type.value})"
@@ -417,12 +419,18 @@ class ModelsInterface(InvocationContextInterface):
if len(configs) > 1:
raise ValueError(f"More than one model found with name {name}, base {base}, and type {type}")
+ self._raise_if_external(configs[0])
message = f"Loading model {name}"
if submodel_type:
message += f" ({submodel_type.value})"
self._util.signal_progress(message)
return self._services.model_manager.load.load_model(configs[0], submodel_type)
+ @staticmethod
+ def _raise_if_external(model: AnyModelConfig) -> None:
+ if model.base == BaseModelType.External or model.format == ModelFormat.ExternalApi:
+ raise ValueError("External API models cannot be loaded from disk")
+
def get_config(self, identifier: Union[str, "ModelIdentifierField"]) -> AnyModelConfig:
"""Get a model's config.
diff --git a/invokeai/backend/image_util/controlnet_processor.py b/invokeai/backend/image_util/controlnet_processor.py
index 87739f69e1..81eed42097 100644
--- a/invokeai/backend/image_util/controlnet_processor.py
+++ b/invokeai/backend/image_util/controlnet_processor.py
@@ -14,43 +14,61 @@ def _get_processor_invocation_class(processor_type: str):
"""Get the invocation class for a processor type."""
# Import processor invocation classes on demand
processor_class_map = {
- "canny_image_processor": lambda: __import__(
- "invokeai.app.invocations.canny", fromlist=["CannyEdgeDetectionInvocation"]
- ).CannyEdgeDetectionInvocation,
- "hed_image_processor": lambda: __import__(
- "invokeai.app.invocations.hed", fromlist=["HEDEdgeDetectionInvocation"]
- ).HEDEdgeDetectionInvocation,
- "mlsd_image_processor": lambda: __import__(
- "invokeai.app.invocations.mlsd", fromlist=["MLSDDetectionInvocation"]
- ).MLSDDetectionInvocation,
- "depth_anything_image_processor": lambda: __import__(
- "invokeai.app.invocations.depth_anything", fromlist=["DepthAnythingDepthEstimationInvocation"]
- ).DepthAnythingDepthEstimationInvocation,
- "normalbae_image_processor": lambda: __import__(
- "invokeai.app.invocations.normal_bae", fromlist=["NormalMapInvocation"]
- ).NormalMapInvocation,
- "pidi_image_processor": lambda: __import__(
- "invokeai.app.invocations.pidi", fromlist=["PiDiNetEdgeDetectionInvocation"]
- ).PiDiNetEdgeDetectionInvocation,
- "lineart_image_processor": lambda: __import__(
- "invokeai.app.invocations.lineart", fromlist=["LineartEdgeDetectionInvocation"]
- ).LineartEdgeDetectionInvocation,
- "lineart_anime_image_processor": lambda: __import__(
- "invokeai.app.invocations.lineart_anime", fromlist=["LineartAnimeEdgeDetectionInvocation"]
- ).LineartAnimeEdgeDetectionInvocation,
- "content_shuffle_image_processor": lambda: __import__(
- "invokeai.app.invocations.content_shuffle", fromlist=["ContentShuffleInvocation"]
- ).ContentShuffleInvocation,
- "dw_openpose_image_processor": lambda: __import__(
- "invokeai.app.invocations.dw_openpose", fromlist=["DWOpenposeDetectionInvocation"]
- ).DWOpenposeDetectionInvocation,
- "mediapipe_face_processor": lambda: __import__(
- "invokeai.app.invocations.mediapipe_face", fromlist=["MediaPipeFaceDetectionInvocation"]
- ).MediaPipeFaceDetectionInvocation,
+ "canny_image_processor": lambda: (
+ __import__(
+ "invokeai.app.invocations.canny", fromlist=["CannyEdgeDetectionInvocation"]
+ ).CannyEdgeDetectionInvocation
+ ),
+ "hed_image_processor": lambda: (
+ __import__(
+ "invokeai.app.invocations.hed", fromlist=["HEDEdgeDetectionInvocation"]
+ ).HEDEdgeDetectionInvocation
+ ),
+ "mlsd_image_processor": lambda: (
+ __import__("invokeai.app.invocations.mlsd", fromlist=["MLSDDetectionInvocation"]).MLSDDetectionInvocation
+ ),
+ "depth_anything_image_processor": lambda: (
+ __import__(
+ "invokeai.app.invocations.depth_anything", fromlist=["DepthAnythingDepthEstimationInvocation"]
+ ).DepthAnythingDepthEstimationInvocation
+ ),
+ "normalbae_image_processor": lambda: (
+ __import__("invokeai.app.invocations.normal_bae", fromlist=["NormalMapInvocation"]).NormalMapInvocation
+ ),
+ "pidi_image_processor": lambda: (
+ __import__(
+ "invokeai.app.invocations.pidi", fromlist=["PiDiNetEdgeDetectionInvocation"]
+ ).PiDiNetEdgeDetectionInvocation
+ ),
+ "lineart_image_processor": lambda: (
+ __import__(
+ "invokeai.app.invocations.lineart", fromlist=["LineartEdgeDetectionInvocation"]
+ ).LineartEdgeDetectionInvocation
+ ),
+ "lineart_anime_image_processor": lambda: (
+ __import__(
+ "invokeai.app.invocations.lineart_anime", fromlist=["LineartAnimeEdgeDetectionInvocation"]
+ ).LineartAnimeEdgeDetectionInvocation
+ ),
+ "content_shuffle_image_processor": lambda: (
+ __import__(
+ "invokeai.app.invocations.content_shuffle", fromlist=["ContentShuffleInvocation"]
+ ).ContentShuffleInvocation
+ ),
+ "dw_openpose_image_processor": lambda: (
+ __import__(
+ "invokeai.app.invocations.dw_openpose", fromlist=["DWOpenposeDetectionInvocation"]
+ ).DWOpenposeDetectionInvocation
+ ),
+ "mediapipe_face_processor": lambda: (
+ __import__(
+ "invokeai.app.invocations.mediapipe_face", fromlist=["MediaPipeFaceDetectionInvocation"]
+ ).MediaPipeFaceDetectionInvocation
+ ),
# Note: zoe_depth_image_processor doesn't have a processor invocation implementation
- "color_map_image_processor": lambda: __import__(
- "invokeai.app.invocations.color_map", fromlist=["ColorMapInvocation"]
- ).ColorMapInvocation,
+ "color_map_image_processor": lambda: (
+ __import__("invokeai.app.invocations.color_map", fromlist=["ColorMapInvocation"]).ColorMapInvocation
+ ),
}
if processor_type in processor_class_map:
diff --git a/invokeai/backend/model_manager/configs/external_api.py b/invokeai/backend/model_manager/configs/external_api.py
index e69de29bb2..da58cba410 100644
--- a/invokeai/backend/model_manager/configs/external_api.py
+++ b/invokeai/backend/model_manager/configs/external_api.py
@@ -0,0 +1,113 @@
+from typing import Literal, Self
+
+from pydantic import BaseModel, ConfigDict, Field, model_validator
+
+from invokeai.backend.model_manager.configs.base import Config_Base
+from invokeai.backend.model_manager.configs.identification_utils import NotAMatchError
+from invokeai.backend.model_manager.model_on_disk import ModelOnDisk
+from invokeai.backend.model_manager.taxonomy import BaseModelType, ModelFormat, ModelSourceType, ModelType
+
+ExternalGenerationMode = Literal["txt2img", "img2img", "inpaint"]
+ExternalMaskFormat = Literal["alpha", "binary", "none"]
+ExternalPanelControlName = Literal["reference_images", "dimensions", "seed"]
+
+
+class ExternalImageSize(BaseModel):
+ width: int = Field(gt=0)
+ height: int = Field(gt=0)
+
+ model_config = ConfigDict(extra="forbid")
+
+
+class ExternalResolutionPreset(BaseModel):
+ label: str = Field(min_length=1, description="Display label, e.g. '1:1 (1K)'")
+ aspect_ratio: str = Field(min_length=1, description="Aspect ratio string, e.g. '1:1'")
+ image_size: str = Field(min_length=1, description="Image size preset, e.g. '1K'")
+ width: int = Field(gt=0)
+ height: int = Field(gt=0)
+
+ model_config = ConfigDict(extra="forbid")
+
+
+class ExternalModelCapabilities(BaseModel):
+ modes: list[ExternalGenerationMode] = Field(default_factory=lambda: ["txt2img"])
+ supports_reference_images: bool = Field(default=False)
+ supports_negative_prompt: bool = Field(default=True)
+ supports_seed: bool = Field(default=False)
+ supports_guidance: bool = Field(default=False)
+ supports_steps: bool = Field(default=False)
+ max_images_per_request: int | None = Field(default=None, gt=0)
+ max_image_size: ExternalImageSize | None = Field(default=None)
+ allowed_aspect_ratios: list[str] | None = Field(default=None)
+ aspect_ratio_sizes: dict[str, ExternalImageSize] | None = Field(default=None)
+ resolution_presets: list[ExternalResolutionPreset] | None = Field(default=None)
+ max_reference_images: int | None = Field(default=None, gt=0)
+ mask_format: ExternalMaskFormat = Field(default="none")
+ input_image_required_for: list[ExternalGenerationMode] | None = Field(default=None)
+
+ model_config = ConfigDict(extra="forbid")
+
+
+class ExternalApiModelDefaultSettings(BaseModel):
+ width: int | None = Field(default=None, gt=0)
+ height: int | None = Field(default=None, gt=0)
+ num_images: int | None = Field(default=None, gt=0)
+
+ model_config = ConfigDict(extra="forbid")
+
+
+class ExternalModelPanelControl(BaseModel):
+ name: ExternalPanelControlName
+ slider_min: float | None = Field(default=None)
+ slider_max: float | None = Field(default=None)
+ number_input_min: float | None = Field(default=None)
+ number_input_max: float | None = Field(default=None)
+ fine_step: float | None = Field(default=None)
+ coarse_step: float | None = Field(default=None)
+ marks: list[float] | None = Field(default=None)
+
+ model_config = ConfigDict(extra="forbid")
+
+
+class ExternalModelPanelSchema(BaseModel):
+ prompts: list[ExternalModelPanelControl] = Field(default_factory=list)
+ image: list[ExternalModelPanelControl] = Field(default_factory=list)
+ generation: list[ExternalModelPanelControl] = Field(default_factory=list)
+
+ model_config = ConfigDict(extra="forbid")
+
+
+class ExternalApiModelConfig(Config_Base):
+ base: Literal[BaseModelType.External] = Field(default=BaseModelType.External)
+ type: Literal[ModelType.ExternalImageGenerator] = Field(default=ModelType.ExternalImageGenerator)
+ format: Literal[ModelFormat.ExternalApi] = Field(default=ModelFormat.ExternalApi)
+
+ provider_id: str = Field(min_length=1, description="External provider ID")
+ provider_model_id: str = Field(min_length=1, description="Provider-specific model ID")
+ capabilities: ExternalModelCapabilities = Field(description="Provider capability matrix")
+ default_settings: ExternalApiModelDefaultSettings | None = Field(default=None)
+ panel_schema: ExternalModelPanelSchema | None = Field(default=None)
+ tags: list[str] | None = Field(default=None)
+ is_default: bool = Field(default=False)
+
+ source_type: ModelSourceType = Field(default=ModelSourceType.External)
+ path: str = Field(default="")
+ source: str = Field(default="")
+ hash: str = Field(default="")
+ file_size: int = Field(default=0, ge=0)
+
+ model_config = ConfigDict(extra="forbid")
+
+ @model_validator(mode="after")
+ def _populate_external_fields(self) -> "ExternalApiModelConfig":
+ if not self.path:
+ self.path = f"external://{self.provider_id}/{self.provider_model_id}"
+ if not self.source:
+ self.source = self.path
+ if not self.hash:
+ self.hash = f"external:{self.provider_id}:{self.provider_model_id}"
+ return self
+
+ @classmethod
+ def from_model_on_disk(cls, mod: ModelOnDisk, override_fields: dict[str, object]) -> Self:
+ raise NotAMatchError("external API models are not probed from disk")
diff --git a/invokeai/backend/model_manager/configs/factory.py b/invokeai/backend/model_manager/configs/factory.py
index 5a376cfad9..4d26b4c334 100644
--- a/invokeai/backend/model_manager/configs/factory.py
+++ b/invokeai/backend/model_manager/configs/factory.py
@@ -26,6 +26,7 @@ from invokeai.backend.model_manager.configs.controlnet import (
ControlNet_Diffusers_SD2_Config,
ControlNet_Diffusers_SDXL_Config,
)
+from invokeai.backend.model_manager.configs.external_api import ExternalApiModelConfig
from invokeai.backend.model_manager.configs.flux_redux import FLUXRedux_Checkpoint_Config
from invokeai.backend.model_manager.configs.identification_utils import NotAMatchError
from invokeai.backend.model_manager.configs.ip_adapter import (
@@ -268,6 +269,7 @@ AnyModelConfig = Annotated[
Annotated[SigLIP_Diffusers_Config, SigLIP_Diffusers_Config.get_tag()],
Annotated[FLUXRedux_Checkpoint_Config, FLUXRedux_Checkpoint_Config.get_tag()],
Annotated[LlavaOnevision_Diffusers_Config, LlavaOnevision_Diffusers_Config.get_tag()],
+ Annotated[ExternalApiModelConfig, ExternalApiModelConfig.get_tag()],
# Unknown model (fallback)
Annotated[Unknown_Config, Unknown_Config.get_tag()],
],
diff --git a/invokeai/backend/model_manager/starter_models.py b/invokeai/backend/model_manager/starter_models.py
index 66637a5970..be8b9f7399 100644
--- a/invokeai/backend/model_manager/starter_models.py
+++ b/invokeai/backend/model_manager/starter_models.py
@@ -2,6 +2,13 @@ from typing import Optional
from pydantic import BaseModel
+from invokeai.backend.model_manager.configs.external_api import (
+ ExternalApiModelDefaultSettings,
+ ExternalImageSize,
+ ExternalModelCapabilities,
+ ExternalModelPanelSchema,
+ ExternalResolutionPreset,
+)
from invokeai.backend.model_manager.taxonomy import (
AnyVariant,
BaseModelType,
@@ -20,6 +27,9 @@ class StarterModelWithoutDependencies(BaseModel):
format: Optional[ModelFormat] = None
variant: Optional[AnyVariant] = None
is_installed: bool = False
+ capabilities: ExternalModelCapabilities | None = None
+ default_settings: ExternalApiModelDefaultSettings | None = None
+ panel_schema: ExternalModelPanelSchema | None = None
# allows us to track what models a user has installed across name changes within starter models
# if you update a starter model name, please add the old one to this list for that starter model
previous_names: list[str] = []
@@ -1001,6 +1011,226 @@ z_image_controlnet_tile = StarterModel(
)
# endregion
+# region External API
+GEMINI_3_IMAGE_ALLOWED_ASPECT_RATIOS = [
+ "1:1",
+ "1:4",
+ "1:8",
+ "2:3",
+ "3:2",
+ "3:4",
+ "4:1",
+ "4:3",
+ "4:5",
+ "5:4",
+ "8:1",
+ "9:16",
+ "16:9",
+ "21:9",
+]
+GEMINI_3_IMAGE_MAX_SIZE = ExternalImageSize(width=4096, height=4096)
+
+
+def _gemini_3_resolution_presets(
+ image_sizes: list[str],
+ aspect_ratios: list[str] | None = None,
+) -> list[ExternalResolutionPreset]:
+ """Build resolution presets for Gemini 3 models.
+
+ Each preset combines an aspect ratio with an image size preset (512/1K/2K/4K).
+ Pixel dimensions are approximations based on the preset name (longest side).
+ """
+ if aspect_ratios is None:
+ aspect_ratios = GEMINI_3_IMAGE_ALLOWED_ASPECT_RATIOS
+ base_pixels = {"512": 512, "1K": 1024, "2K": 2048, "4K": 4096}
+ presets: list[ExternalResolutionPreset] = []
+ for image_size in image_sizes:
+ base = base_pixels[image_size]
+ for ratio_str in aspect_ratios:
+ w_part, h_part = (int(x) for x in ratio_str.split(":"))
+ if w_part >= h_part:
+ w = base
+ h = max(1, round(base * h_part / w_part))
+ else:
+ h = base
+ w = max(1, round(base * w_part / h_part))
+ presets.append(
+ ExternalResolutionPreset(
+ label=f"{ratio_str} ({image_size}) — {w}\u00d7{h}",
+ aspect_ratio=ratio_str,
+ image_size=image_size,
+ width=w,
+ height=h,
+ )
+ )
+ return presets
+
+
+GEMINI_3_PRO_RESOLUTION_PRESETS = _gemini_3_resolution_presets(["1K", "2K", "4K"])
+GEMINI_3_1_FLASH_RESOLUTION_PRESETS = _gemini_3_resolution_presets(["512", "1K", "2K", "4K"])
+
+gemini_flash_image = StarterModel(
+ name="Gemini 2.5 Flash Image",
+ base=BaseModelType.External,
+ source="external://gemini/gemini-2.5-flash-image",
+ description="Google Gemini 2.5 Flash image generation model (external API). Requires a configured Gemini API key and may incur provider usage costs.",
+ type=ModelType.ExternalImageGenerator,
+ format=ModelFormat.ExternalApi,
+ capabilities=ExternalModelCapabilities(
+ modes=["txt2img"],
+ supports_seed=True,
+ supports_reference_images=True,
+ max_images_per_request=1,
+ allowed_aspect_ratios=[
+ "1:1",
+ "2:3",
+ "3:2",
+ "3:4",
+ "4:3",
+ "4:5",
+ "5:4",
+ "9:16",
+ "16:9",
+ "21:9",
+ ],
+ aspect_ratio_sizes={
+ "1:1": ExternalImageSize(width=1024, height=1024),
+ "2:3": ExternalImageSize(width=832, height=1248),
+ "3:2": ExternalImageSize(width=1248, height=832),
+ "3:4": ExternalImageSize(width=864, height=1184),
+ "4:3": ExternalImageSize(width=1184, height=864),
+ "4:5": ExternalImageSize(width=896, height=1152),
+ "5:4": ExternalImageSize(width=1152, height=896),
+ "9:16": ExternalImageSize(width=768, height=1344),
+ "16:9": ExternalImageSize(width=1344, height=768),
+ "21:9": ExternalImageSize(width=1536, height=672),
+ },
+ ),
+ default_settings=ExternalApiModelDefaultSettings(width=1024, height=1024, num_images=1),
+ panel_schema=ExternalModelPanelSchema(prompts=[{"name": "reference_images"}], image=[{"name": "dimensions"}]),
+)
+gemini_pro_image_preview = StarterModel(
+ name="Gemini 3 Pro Image Preview",
+ base=BaseModelType.External,
+ source="external://gemini/gemini-3-pro-image-preview",
+ description="Google Gemini 3 Pro image generation preview model (external API). Supports up to 14 reference images, including up to 6 object references and up to 5 character references. Supports 1K/2K/4K resolution presets. Requires a configured Gemini API key and may incur provider usage costs.",
+ type=ModelType.ExternalImageGenerator,
+ format=ModelFormat.ExternalApi,
+ capabilities=ExternalModelCapabilities(
+ modes=["txt2img"],
+ supports_seed=True,
+ supports_reference_images=True,
+ max_reference_images=14,
+ max_images_per_request=1,
+ max_image_size=GEMINI_3_IMAGE_MAX_SIZE,
+ allowed_aspect_ratios=GEMINI_3_IMAGE_ALLOWED_ASPECT_RATIOS,
+ resolution_presets=GEMINI_3_PRO_RESOLUTION_PRESETS,
+ ),
+ default_settings=ExternalApiModelDefaultSettings(width=1024, height=1024, num_images=1),
+ panel_schema=ExternalModelPanelSchema(prompts=[{"name": "reference_images"}], image=[{"name": "dimensions"}]),
+)
+gemini_3_1_flash_image_preview = StarterModel(
+ name="Gemini 3.1 Flash Image Preview",
+ base=BaseModelType.External,
+ source="external://gemini/gemini-3.1-flash-image-preview",
+ description="Google Gemini 3.1 Flash image generation preview model (external API). Supports up to 14 reference images, including up to 10 object references and up to 4 character references. Supports 512/1K/2K/4K resolution presets. Requires a configured Gemini API key and may incur provider usage costs.",
+ type=ModelType.ExternalImageGenerator,
+ format=ModelFormat.ExternalApi,
+ capabilities=ExternalModelCapabilities(
+ modes=["txt2img"],
+ supports_seed=True,
+ supports_reference_images=True,
+ max_reference_images=14,
+ max_images_per_request=1,
+ max_image_size=GEMINI_3_IMAGE_MAX_SIZE,
+ allowed_aspect_ratios=GEMINI_3_IMAGE_ALLOWED_ASPECT_RATIOS,
+ resolution_presets=GEMINI_3_1_FLASH_RESOLUTION_PRESETS,
+ ),
+ default_settings=ExternalApiModelDefaultSettings(width=1024, height=1024, num_images=1),
+ panel_schema=ExternalModelPanelSchema(prompts=[{"name": "reference_images"}], image=[{"name": "dimensions"}]),
+)
+OPENAI_GPT_IMAGE_ASPECT_RATIOS = ["1:1", "3:2", "2:3"]
+OPENAI_GPT_IMAGE_ASPECT_RATIO_SIZES = {
+ "1:1": ExternalImageSize(width=1024, height=1024),
+ "3:2": ExternalImageSize(width=1536, height=1024),
+ "2:3": ExternalImageSize(width=1024, height=1536),
+}
+OPENAI_GPT_IMAGE_PANEL_SCHEMA = ExternalModelPanelSchema(
+ prompts=[{"name": "reference_images"}], image=[{"name": "dimensions"}]
+)
+
+openai_gpt_image_1_5 = StarterModel(
+ name="GPT Image 1.5",
+ base=BaseModelType.External,
+ source="external://openai/gpt-image-1.5",
+ description="OpenAI GPT-Image-1.5 image generation model. Fastest and most affordable GPT image model. Requires a configured OpenAI API key and may incur provider usage costs.",
+ type=ModelType.ExternalImageGenerator,
+ format=ModelFormat.ExternalApi,
+ capabilities=ExternalModelCapabilities(
+ modes=["txt2img", "img2img"],
+ supports_reference_images=True,
+ max_images_per_request=10,
+ allowed_aspect_ratios=OPENAI_GPT_IMAGE_ASPECT_RATIOS,
+ aspect_ratio_sizes=OPENAI_GPT_IMAGE_ASPECT_RATIO_SIZES,
+ ),
+ default_settings=ExternalApiModelDefaultSettings(width=1024, height=1024, num_images=1),
+ panel_schema=OPENAI_GPT_IMAGE_PANEL_SCHEMA,
+)
+openai_gpt_image_1 = StarterModel(
+ name="GPT Image 1",
+ base=BaseModelType.External,
+ source="external://openai/gpt-image-1",
+ description="OpenAI GPT-Image-1 image generation model. High quality image generation. Requires a configured OpenAI API key and may incur provider usage costs.",
+ type=ModelType.ExternalImageGenerator,
+ format=ModelFormat.ExternalApi,
+ capabilities=ExternalModelCapabilities(
+ modes=["txt2img", "img2img"],
+ supports_reference_images=True,
+ max_images_per_request=10,
+ allowed_aspect_ratios=OPENAI_GPT_IMAGE_ASPECT_RATIOS,
+ aspect_ratio_sizes=OPENAI_GPT_IMAGE_ASPECT_RATIO_SIZES,
+ ),
+ default_settings=ExternalApiModelDefaultSettings(width=1024, height=1024, num_images=1),
+ panel_schema=OPENAI_GPT_IMAGE_PANEL_SCHEMA,
+)
+openai_gpt_image_1_mini = StarterModel(
+ name="GPT Image 1 Mini",
+ base=BaseModelType.External,
+ source="external://openai/gpt-image-1-mini",
+ description="OpenAI GPT-Image-1-Mini image generation model. Cost-efficient option, 80%% cheaper than GPT-Image-1. Requires a configured OpenAI API key and may incur provider usage costs.",
+ type=ModelType.ExternalImageGenerator,
+ format=ModelFormat.ExternalApi,
+ capabilities=ExternalModelCapabilities(
+ modes=["txt2img", "img2img"],
+ supports_reference_images=True,
+ max_images_per_request=10,
+ allowed_aspect_ratios=OPENAI_GPT_IMAGE_ASPECT_RATIOS,
+ aspect_ratio_sizes=OPENAI_GPT_IMAGE_ASPECT_RATIO_SIZES,
+ ),
+ default_settings=ExternalApiModelDefaultSettings(width=1024, height=1024, num_images=1),
+ panel_schema=OPENAI_GPT_IMAGE_PANEL_SCHEMA,
+)
+openai_dall_e_3 = StarterModel(
+ name="DALL-E 3",
+ base=BaseModelType.External,
+ source="external://openai/dall-e-3",
+ description="OpenAI DALL-E 3 image generation model. Supports vivid and natural styles. Only text-to-image, no editing. Requires a configured OpenAI API key and may incur provider usage costs.",
+ type=ModelType.ExternalImageGenerator,
+ format=ModelFormat.ExternalApi,
+ capabilities=ExternalModelCapabilities(
+ modes=["txt2img"],
+ max_images_per_request=1,
+ allowed_aspect_ratios=["1:1", "7:4", "4:7"],
+ aspect_ratio_sizes={
+ "1:1": ExternalImageSize(width=1024, height=1024),
+ "7:4": ExternalImageSize(width=1792, height=1024),
+ "4:7": ExternalImageSize(width=1024, height=1792),
+ },
+ ),
+ default_settings=ExternalApiModelDefaultSettings(width=1024, height=1024, num_images=1),
+ panel_schema=ExternalModelPanelSchema(image=[{"name": "dimensions"}]),
+)
+# DALL-E 2 removed — deprecated by OpenAI, shutdown May 12, 2026.
# region Anima
anima_qwen3_encoder = StarterModel(
name="Anima Qwen3 0.6B Text Encoder",
@@ -1140,6 +1370,13 @@ STARTER_MODELS: list[StarterModel] = [
z_image_qwen3_encoder_quantized,
z_image_controlnet_union,
z_image_controlnet_tile,
+ gemini_flash_image,
+ gemini_pro_image_preview,
+ gemini_3_1_flash_image_preview,
+ openai_gpt_image_1_5,
+ openai_gpt_image_1,
+ openai_gpt_image_1_mini,
+ openai_dall_e_3,
anima_preview3,
anima_qwen3_encoder,
anima_vae,
diff --git a/invokeai/backend/model_manager/taxonomy.py b/invokeai/backend/model_manager/taxonomy.py
index 861984f304..b2b55ebd3f 100644
--- a/invokeai/backend/model_manager/taxonomy.py
+++ b/invokeai/backend/model_manager/taxonomy.py
@@ -52,6 +52,8 @@ class BaseModelType(str, Enum):
"""Indicates the model is associated with CogView 4 model architecture."""
ZImage = "z-image"
"""Indicates the model is associated with Z-Image model architecture, including Z-Image-Turbo."""
+ External = "external"
+ """Indicates the model is hosted by an external provider."""
QwenImage = "qwen-image"
"""Indicates the model is associated with Qwen Image Edit 2511 model architecture."""
Anima = "anima"
@@ -80,6 +82,7 @@ class ModelType(str, Enum):
SigLIP = "siglip"
FluxRedux = "flux_redux"
LlavaOnevision = "llava_onevision"
+ ExternalImageGenerator = "external_image_generator"
Unknown = "unknown"
@@ -187,6 +190,7 @@ class ModelFormat(str, Enum):
BnbQuantizedLlmInt8b = "bnb_quantized_int8b"
BnbQuantizednf4b = "bnb_quantized_nf4b"
GGUFQuantized = "gguf_quantized"
+ ExternalApi = "external_api"
Unknown = "unknown"
@@ -215,6 +219,7 @@ class ModelSourceType(str, Enum):
Path = "path"
Url = "url"
HFRepoID = "hf_repo_id"
+ External = "external"
class FluxLoRAFormat(str, Enum):
diff --git a/invokeai/frontend/web/public/locales/en.json b/invokeai/frontend/web/public/locales/en.json
index fd6154760e..b4290a3a4d 100644
--- a/invokeai/frontend/web/public/locales/en.json
+++ b/invokeai/frontend/web/public/locales/en.json
@@ -994,10 +994,16 @@
"dypeScale": "$t(parameters.dypeScale)",
"dypeExponent": "$t(parameters.dypeExponent)",
"generationMode": "Generation Mode",
+ "geminiTemperature": "Gemini Temperature",
+ "geminiThinkingLevel": "Gemini Thinking Level",
+ "openaiQuality": "OpenAI Quality",
+ "openaiBackground": "OpenAI Background",
+ "openaiInputFidelity": "OpenAI Input Fidelity",
"guidance": "Guidance",
"height": "Height",
"imageDetails": "Image Details",
"imageDimensions": "Image Dimensions",
+ "imageSize": "Image Size",
"metadata": "Metadata",
"model": "Model",
"negativePrompt": "Negative Prompt",
@@ -1115,6 +1121,22 @@
"fileSize": "File Size",
"filterModels": "Filter models",
"fluxRedux": "FLUX Redux",
+ "externalImageGenerator": "External Image Generator",
+ "externalProviders": "External Providers",
+ "externalSetupTitle": "External Providers Setup",
+ "externalSetupDescription": "Connect an API key to enable external image generation. External starter models auto-install when a provider is configured.",
+ "externalInstallDefaults": "Auto-install starter models",
+ "externalProvidersUnavailable": "External providers are not available in this build.",
+ "externalSetupFooter": "An API key is required. External providers use remote APIs; usage may incur provider-side costs.",
+ "externalProviderCardDescription": "Configure {{providerId}} credentials for external image generation.",
+ "externalApiKey": "API Key",
+ "externalApiKeyPlaceholder": "Paste your API key",
+ "externalApiKeyPlaceholderSet": "API key configured",
+ "externalApiKeyHelper": "Stored in your InvokeAI config file.",
+ "externalBaseUrl": "Base URL (optional)",
+ "externalBaseUrlPlaceholder": "https://...",
+ "externalBaseUrlHelper": "Override the default API base URL if needed.",
+ "externalResetHelper": "Clear API key and base URL.",
"height": "Height",
"huggingFace": "HuggingFace",
"huggingFacePlaceholder": "owner/model-name",
@@ -1182,6 +1204,21 @@
"modelUpdated": "Model Updated",
"modelUpdateFailed": "Model Update Failed",
"name": "Name",
+ "externalProvider": "External Provider",
+ "externalCapabilities": "External Capabilities",
+ "externalDefaults": "External Defaults",
+ "providerId": "Provider ID",
+ "providerModelId": "Provider Model ID",
+ "supportedModes": "Supported Modes",
+ "supportsNegativePrompt": "Supports Negative Prompt",
+ "supportsReferenceImages": "Supports Reference Images",
+ "supportsSeed": "Supports Seed",
+ "supportsGuidance": "Supports Guidance",
+ "maxImagesPerRequest": "Max Images Per Request",
+ "maxReferenceImages": "Max Reference Images",
+ "maxImageWidth": "Max Image Width",
+ "maxImageHeight": "Max Image Height",
+ "numImages": "Num Images",
"modelPickerFallbackNoModelsInstalled": "No models installed.",
"modelPickerFallbackNoModelsInstalled2": "Visit the <LinkComponent>Model Manager</LinkComponent> to install models.",
"modelPickerFallbackNoModelsInstalledNonAdmin": "No models installed. Ask your InvokeAI administrator (<AdminEmailLink />) to install some models.",
@@ -1226,6 +1263,7 @@
"urlDescription": "Install models from a URL or local file path. Perfect for specific models you want to add.",
"huggingFaceDescription": "Browse and install models directly from HuggingFace repositories.",
"scanFolderDescription": "Scan a local folder to automatically detect and install models.",
+ "externalDescription": "Connect a Gemini or OpenAI API key to enable external generation. Usage may incur provider-side costs.",
"recommendedModels": "Recommended Models",
"exploreStarter": "Or browse all available starter models",
"quickStart": "Quick Start Bundles",
@@ -1544,6 +1582,7 @@
"copyImage": "Copy Image",
"denoisingStrength": "Denoising Strength",
"disabledNoRasterContent": "Disabled (No Raster Content)",
+ "disabledNotSupported": "Not supported by model",
"downloadImage": "Download Image",
"general": "General",
"guidance": "Guidance",
@@ -1661,6 +1700,7 @@
"boxBlur": "Box Blur",
"staged": "Staged",
"resolution": "Resolution",
+ "imageSize": "Image Size",
"modelDisabledForTrial": "Generating with {{modelName}} is not available on trial accounts. Visit your <LinkComponent>account settings</LinkComponent> to upgrade."
},
"dynamicPrompts": {
@@ -1737,7 +1777,11 @@
"intermediatesCleared_one": "Cleared {{count}} Intermediate",
"intermediatesCleared_other": "Cleared {{count}} Intermediates",
"intermediatesClearedFailed": "Problem Clearing Intermediates",
- "reloadingIn": "Reloading in"
+ "reloadingIn": "Reloading in",
+ "externalProviders": "External Providers",
+ "externalProviderConfigured": "Configured",
+ "externalProviderNotConfigured": "API Key Required",
+ "externalProviderNotConfiguredHint": "Add your API key in Model Manager or the server config to enable this provider."
},
"toast": {
"addedToBoard": "Added to board {{name}}'s assets",
diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/modelSelected.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/modelSelected.ts
index 8fe6b1e2a4..11056a1f56 100644
--- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/modelSelected.ts
+++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/modelSelected.ts
@@ -7,10 +7,12 @@ import {
animaQwen3EncoderModelSelected,
animaT5EncoderModelSelected,
animaVaeModelSelected,
+ aspectRatioIdChanged,
kleinQwen3EncoderModelSelected,
kleinVaeModelSelected,
modelChanged,
qwenImageComponentSourceSelected,
+ resolutionPresetSelected,
setZImageScheduler,
syncedToOptimalDimension,
vaeSelected,
@@ -30,6 +32,7 @@ import {
} from 'features/controlLayers/store/selectors';
import {
getEntityIdentifier,
+ isAspectRatioID,
isFlux2ReferenceImageConfig,
isQwenImageReferenceImageConfig,
} from 'features/controlLayers/store/types';
@@ -59,7 +62,7 @@ import {
selectZImageDiffusersModels,
} from 'services/api/hooks/modelsByType';
import type { FLUXKontextModelConfig, FLUXReduxModelConfig, IPAdapterModelConfig } from 'services/api/types';
-import { isFluxKontextModelConfig, isFluxReduxModelConfig } from 'services/api/types';
+import { isExternalApiModelConfig, isFluxKontextModelConfig, isFluxReduxModelConfig } from 'services/api/types';
const log = logger('models');
@@ -285,7 +288,7 @@ export const addModelSelectedListener = (startAppListening: AppStartListening) =
}
}
- if (SUPPORTS_REF_IMAGES_BASE_MODELS.includes(newModel.base)) {
+ if (newModel.base !== 'external' && SUPPORTS_REF_IMAGES_BASE_MODELS.includes(newModel.base)) {
// Handle incompatible reference image models - switch to first compatible model, with some smart logic
// to choose the best available model based on the new main model.
const allRefImageModels = selectGlobalRefImageModels(state).filter(({ base }) => base === newBase);
@@ -533,6 +536,34 @@ export const addModelSelectedListener = (startAppListening: AppStartListening) =
dispatch(bboxSyncedToOptimalDimension());
}
}
+
+ // When switching to an external model, sync bbox to the model's first preset dimensions
+ if (newBase === 'external') {
+ const modelConfigsResult = selectModelConfigsQuery(getState());
+ if (modelConfigsResult.data) {
+ const newModelConfig = modelConfigsAdapterSelectors.selectById(modelConfigsResult.data, newModel.key);
+ if (newModelConfig && isExternalApiModelConfig(newModelConfig)) {
+ const { aspect_ratio_sizes, resolution_presets } = newModelConfig.capabilities;
+ if (resolution_presets && resolution_presets.length > 0) {
+ const firstPreset = resolution_presets[0]!;
+ dispatch(
+ resolutionPresetSelected({
+ imageSize: firstPreset.image_size,
+ aspectRatio: firstPreset.aspect_ratio,
+ width: firstPreset.width,
+ height: firstPreset.height,
+ })
+ );
+ } else if (aspect_ratio_sizes) {
+ const firstRatio = Object.keys(aspect_ratio_sizes)[0];
+ const firstSize = firstRatio ? aspect_ratio_sizes[firstRatio] : undefined;
+ if (firstRatio && firstSize && isAspectRatioID(firstRatio)) {
+ dispatch(aspectRatioIdChanged({ id: firstRatio, fixedSize: firstSize }));
+ }
+ }
+ }
+ }
+ }
},
});
};
diff --git a/invokeai/frontend/web/src/features/controlLayers/components/ParamDenoisingStrength.tsx b/invokeai/frontend/web/src/features/controlLayers/components/ParamDenoisingStrength.tsx
index 34fb96f063..658fb8b745 100644
--- a/invokeai/frontend/web/src/features/controlLayers/components/ParamDenoisingStrength.tsx
+++ b/invokeai/frontend/web/src/features/controlLayers/components/ParamDenoisingStrength.tsx
@@ -11,7 +11,7 @@ import { createSelector } from '@reduxjs/toolkit';
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
import { InformationalPopover } from 'common/components/InformationalPopover/InformationalPopover';
import WavyLine from 'common/components/WavyLine';
-import { selectImg2imgStrength, setImg2imgStrength } from 'features/controlLayers/store/paramsSlice';
+import { selectImg2imgStrength, selectIsExternal, setImg2imgStrength } from 'features/controlLayers/store/paramsSlice';
import { selectActiveRasterLayerEntities } from 'features/controlLayers/store/selectors';
import { memo, useCallback, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
@@ -37,6 +37,7 @@ export const ParamDenoisingStrength = memo(() => {
const img2imgStrength = useAppSelector(selectImg2imgStrength);
const dispatch = useAppDispatch();
const hasRasterLayersWithContent = useAppSelector(selectHasRasterLayersWithContent);
+ const isExternal = useAppSelector(selectIsExternal);
const selectedModelConfig = useSelectedModelConfig();
const onChange = useCallback(
@@ -55,12 +56,16 @@ export const ParamDenoisingStrength = memo(() => {
// Denoising strength does nothing if there are no raster layers w/ content
return true;
}
+ if (isExternal) {
+ // External models don't support denoise strength - they handle img2img via prompt
+ return true;
+ }
if (selectedModelConfig && isFluxFillMainModelModelConfig(selectedModelConfig)) {
// Denoising strength is ignored by FLUX Fill, which is indicated by the variant being 'inpaint'
return true;
}
return false;
- }, [hasRasterLayersWithContent, selectedModelConfig]);
+ }, [hasRasterLayersWithContent, isExternal, selectedModelConfig]);
return (
<FormControl isDisabled={isDisabled} p={1} justifyContent="space-between" h={8}>
@@ -96,7 +101,9 @@ export const ParamDenoisingStrength = memo(() => {
</>
) : (
<Flex alignItems="center">
- <Badge opacity="0.6">{t('parameters.disabledNoRasterContent')}</Badge>
+ <Badge opacity="0.6">
+ {isExternal ? t('parameters.disabledNotSupported') : t('parameters.disabledNoRasterContent')}
+ </Badge>
</Flex>
)}
</FormControl>
diff --git a/invokeai/frontend/web/src/features/controlLayers/components/RefImage/RefImagePreview.tsx b/invokeai/frontend/web/src/features/controlLayers/components/RefImage/RefImagePreview.tsx
index b910f3f139..f0a9948de4 100644
--- a/invokeai/frontend/web/src/features/controlLayers/components/RefImage/RefImagePreview.tsx
+++ b/invokeai/frontend/web/src/features/controlLayers/components/RefImage/RefImagePreview.tsx
@@ -16,6 +16,7 @@ import { memo, useCallback, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { PiExclamationMarkBold, PiEyeSlashBold, PiImageBold } from 'react-icons/pi';
import { useImageDTOFromCroppableImage } from 'services/api/endpoints/images';
+import { isExternalApiModelConfig } from 'services/api/types';
import { RefImageWarningTooltipContent } from './RefImageWarningTooltipContent';
@@ -73,18 +74,19 @@ export const RefImagePreview = memo(() => {
const selectedEntityId = useAppSelector(selectSelectedRefEntityId);
const isPanelOpen = useAppSelector(selectIsRefImagePanelOpen);
const [showWeightDisplay, setShowWeightDisplay] = useState(false);
+ const isExternalModel = !!mainModelConfig && isExternalApiModelConfig(mainModelConfig);
const imageDTO = useImageDTOFromCroppableImage(entity.config.image);
const sx = useMemo(() => {
- if (!isIPAdapterConfig(entity.config)) {
+ if (!isIPAdapterConfig(entity.config) || isExternalModel) {
return baseSx;
}
return getImageSxWithWeight(entity.config.weight);
- }, [entity.config]);
+ }, [entity.config, isExternalModel]);
useEffect(() => {
- if (!isIPAdapterConfig(entity.config)) {
+ if (!isIPAdapterConfig(entity.config) || isExternalModel) {
return;
}
setShowWeightDisplay(true);
@@ -94,7 +96,7 @@ export const RefImagePreview = memo(() => {
return () => {
window.clearTimeout(timeout);
};
- }, [entity.config]);
+ }, [entity.config, isExternalModel]);
const warnings = useMemo(() => {
return getGlobalReferenceImageWarnings(entity, mainModelConfig);
@@ -156,7 +158,7 @@ export const RefImagePreview = memo(() => {
) : (
<Skeleton h="full" aspectRatio="1/1" />
)}
- {isIPAdapterConfig(entity.config) && (
+ {isIPAdapterConfig(entity.config) && !isExternalModel && (
<Flex
position="absolute"
inset={0}
diff --git a/invokeai/frontend/web/src/features/controlLayers/components/RefImage/RefImageSettings.tsx b/invokeai/frontend/web/src/features/controlLayers/components/RefImage/RefImageSettings.tsx
index 98f0873686..54b345361d 100644
--- a/invokeai/frontend/web/src/features/controlLayers/components/RefImage/RefImageSettings.tsx
+++ b/invokeai/frontend/web/src/features/controlLayers/components/RefImage/RefImageSettings.tsx
@@ -15,7 +15,7 @@ import {
useCanvasManagerSafe,
} from 'features/controlLayers/contexts/CanvasManagerProviderGate';
import { useRefImageIdContext } from 'features/controlLayers/contexts/RefImageIdContext';
-import { selectIsFLUX } from 'features/controlLayers/store/paramsSlice';
+import { selectIsFLUX, selectMainModelConfig } from 'features/controlLayers/store/paramsSlice';
import {
refImageFLUXReduxImageInfluenceChanged,
refImageImageChanged,
@@ -50,6 +50,7 @@ import type {
FLUXReduxModelConfig,
IPAdapterModelConfig,
} from 'services/api/types';
+import { isExternalApiModelConfig } from 'services/api/types';
import { RefImageImage } from './RefImageImage';
@@ -65,6 +66,7 @@ const RefImageSettingsContent = memo(() => {
const selectConfig = useMemo(() => buildSelectConfig(id), [id]);
const config = useAppSelector(selectConfig);
const tab = useAppSelector(selectActiveTab);
+ const mainModelConfig = useAppSelector(selectMainModelConfig);
const onChangeBeginEndStepPct = useCallback(
(beginEndStepPct: [number, number]) => {
@@ -125,9 +127,11 @@ const RefImageSettingsContent = memo(() => {
);
const isFLUX = useAppSelector(selectIsFLUX);
+ const isExternalModel = !!mainModelConfig && isExternalApiModelConfig(mainModelConfig);
- // FLUX.2 Klein and Qwen Image Edit have built-in reference image support - no model selector needed
- const showModelSelector = !isFlux2ReferenceImageConfig(config) && !isQwenImageReferenceImageConfig(config);
+ // FLUX.2 Klein, Qwen Image Edit and external API models do not require a ref image model selection.
+ const showModelSelector =
+ !isFlux2ReferenceImageConfig(config) && !isQwenImageReferenceImageConfig(config) && !isExternalModel;
return (
<Flex flexDir="column" gap={2} position="relative" w="full">
@@ -155,14 +159,14 @@ const RefImageSettingsContent = memo(() => {
</Flex>
)}
<Flex gap={2} w="full">
- {isIPAdapterConfig(config) && (
+ {isIPAdapterConfig(config) && !isExternalModel && (
<Flex flexDir="column" gap={2} w="full">
{!isFLUX && <IPAdapterMethod method={config.method} onChange={onChangeIPMethod} />}
<Weight weight={config.weight} onChange={onChangeWeight} />
<BeginEndStepPct beginEndStepPct={config.beginEndStepPct} onChange={onChangeBeginEndStepPct} />
</Flex>
)}
- {isFLUXReduxConfig(config) && (
+ {isFLUXReduxConfig(config) && !isExternalModel && (
<Flex flexDir="column" gap={2} w="full" alignItems="flex-start">
<FLUXReduxImageInfluence
imageInfluence={config.imageInfluence ?? 'lowest'}
diff --git a/invokeai/frontend/web/src/features/controlLayers/components/StagingArea/context.tsx b/invokeai/frontend/web/src/features/controlLayers/components/StagingArea/context.tsx
index 7dfb7f45c3..377ce666bc 100644
--- a/invokeai/frontend/web/src/features/controlLayers/components/StagingArea/context.tsx
+++ b/invokeai/frontend/web/src/features/controlLayers/components/StagingArea/context.tsx
@@ -75,11 +75,18 @@ export const StagingAreaContextProvider = memo(({ children, sessionId }: PropsWi
onAccept: (item, imageDTO) => {
const bboxRect = selectBboxRect(store.getState());
const { x, y } = bboxRect;
+ const imageObject = imageDTOToImageObject(imageDTO, { usePixelBbox: false });
+ const scale = Math.min(bboxRect.width / imageDTO.width, bboxRect.height / imageDTO.height);
+ const scaledWidth = Math.round(imageDTO.width * scale);
+ const scaledHeight = Math.round(imageDTO.height * scale);
+ const position = {
+ x: x + Math.round((bboxRect.width - scaledWidth) / 2),
+ y: y + Math.round((bboxRect.height - scaledHeight) / 2),
+ };
const selectedEntityIdentifier = selectSelectedEntityIdentifier(store.getState());
- const imageObject = imageDTOToImageObject(imageDTO);
const overrides: Partial<CanvasRasterLayerState> = {
- position: { x, y },
+ position,
objects: [imageObject],
};
store.dispatch(rasterLayerAdded({ overrides, isSelected: selectedEntityIdentifier?.type === 'raster_layer' }));
diff --git a/invokeai/frontend/web/src/features/controlLayers/components/StagingArea/shared.test.ts b/invokeai/frontend/web/src/features/controlLayers/components/StagingArea/shared.test.ts
index af35d519b2..d0ce87edfc 100644
--- a/invokeai/frontend/web/src/features/controlLayers/components/StagingArea/shared.test.ts
+++ b/invokeai/frontend/web/src/features/controlLayers/components/StagingArea/shared.test.ts
@@ -183,6 +183,33 @@ describe('StagingAreaApi Utility Functions', () => {
expect(result).toEqual(['first-image.png', 'second-image.png']);
});
+ it('should return first image from image collections', () => {
+ const queueItem: S['SessionQueueItem'] = {
+ item_id: 1,
+ status: 'completed',
+ priority: 0,
+ destination: 'test-session',
+ created_at: '2024-01-01T00:00:00Z',
+ updated_at: '2024-01-01T00:00:00Z',
+ started_at: '2024-01-01T00:00:01Z',
+ completed_at: '2024-01-01T00:01:00Z',
+ error: null,
+ session: {
+ id: 'test-session',
+ source_prepared_mapping: {
+ canvas_output: ['output-node-id'],
+ },
+ results: {
+ 'output-node-id': {
+ images: [{ image_name: 'first.png' }, { image_name: 'second.png' }],
+ },
+ },
+ },
+ } as unknown as S['SessionQueueItem'];
+
+ expect(getOutputImageNames(queueItem)).toEqual(['first.png', 'second.png']);
+ });
+
it('should handle empty session mapping', () => {
const queueItem: S['SessionQueueItem'] = {
item_id: 1,
diff --git a/invokeai/frontend/web/src/features/controlLayers/components/StagingArea/shared.ts b/invokeai/frontend/web/src/features/controlLayers/components/StagingArea/shared.ts
index 51702d60c9..bc13ee16f8 100644
--- a/invokeai/frontend/web/src/features/controlLayers/components/StagingArea/shared.ts
+++ b/invokeai/frontend/web/src/features/controlLayers/components/StagingArea/shared.ts
@@ -1,4 +1,4 @@
-import { isImageField } from 'features/nodes/types/common';
+import { isImageField, isImageFieldCollection } from 'features/nodes/types/common';
import { isCanvasOutputNodeId } from 'features/nodes/util/graph/graphBuilderUtils';
import type { S } from 'services/api/types';
import { formatProgressMessage } from 'services/events/stores';
@@ -32,6 +32,11 @@ export const getOutputImageNames = (item: S['SessionQueueItem']): string[] => {
if (isImageField(value)) {
imageNames.push(value.image_name);
}
+ if (isImageFieldCollection(value)) {
+ for (const img of value) {
+ imageNames.push(img.image_name);
+ }
+ }
}
}
diff --git a/invokeai/frontend/web/src/features/controlLayers/hooks/saveCanvasHooks.ts b/invokeai/frontend/web/src/features/controlLayers/hooks/saveCanvasHooks.ts
index 6b089c4592..1b95aef000 100644
--- a/invokeai/frontend/web/src/features/controlLayers/hooks/saveCanvasHooks.ts
+++ b/invokeai/frontend/web/src/features/controlLayers/hooks/saveCanvasHooks.ts
@@ -45,7 +45,7 @@ import { toast } from 'features/toast/toast';
import { useCallback, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { serializeError } from 'serialize-error';
-import type { ImageDTO } from 'services/api/types';
+import { type ImageDTO, isExternalApiModelConfig } from 'services/api/types';
import type { JsonObject } from 'type-fest';
const log = logger('canvas');
@@ -90,7 +90,7 @@ const useSaveCanvas = ({ region, saveToGallery, toastOk, toastError, onSave, wit
metadata.negative_prompt = selectNegativePrompt(state);
metadata.seed = selectSeed(state);
const model = selectMainModelConfig(state);
- if (model) {
+ if (model && !isExternalApiModelConfig(model)) {
metadata.model = Graph.getModelMetadataField(model);
}
}
diff --git a/invokeai/frontend/web/src/features/controlLayers/hooks/useIsEntityTypeEnabled.ts b/invokeai/frontend/web/src/features/controlLayers/hooks/useIsEntityTypeEnabled.ts
index b852d11914..4c4617f1b8 100644
--- a/invokeai/frontend/web/src/features/controlLayers/hooks/useIsEntityTypeEnabled.ts
+++ b/invokeai/frontend/web/src/features/controlLayers/hooks/useIsEntityTypeEnabled.ts
@@ -1,5 +1,10 @@
import { useAppSelector } from 'app/store/storeHooks';
-import { selectIsCogView4, selectIsFluxKontext, selectIsSD3 } from 'features/controlLayers/store/paramsSlice';
+import {
+ selectIsCogView4,
+ selectIsExternal,
+ selectIsFluxKontext,
+ selectIsSD3,
+} from 'features/controlLayers/store/paramsSlice';
import type { CanvasEntityType } from 'features/controlLayers/store/types';
import { useMemo } from 'react';
import type { Equals } from 'tsafe';
@@ -9,23 +14,24 @@ export const useIsEntityTypeEnabled = (entityType: CanvasEntityType) => {
const isSD3 = useAppSelector(selectIsSD3);
const isCogView4 = useAppSelector(selectIsCogView4);
const isFluxKontext = useAppSelector(selectIsFluxKontext);
+ const isExternal = useAppSelector(selectIsExternal);
// TODO(psyche): consider using a constant to define which entity types are supported by which model,
// see invokeai/frontend/web/src/features/modelManagerV2/models.ts for ref
const isEntityTypeEnabled = useMemo<boolean>(() => {
switch (entityType) {
case 'regional_guidance':
- return !isSD3 && !isCogView4 && !isFluxKontext;
+ return !isSD3 && !isCogView4 && !isFluxKontext && !isExternal;
case 'control_layer':
- return !isSD3 && !isCogView4 && !isFluxKontext;
+ return !isSD3 && !isCogView4 && !isFluxKontext && !isExternal;
case 'inpaint_mask':
- return !isFluxKontext;
+ return !isFluxKontext && !isExternal;
case 'raster_layer':
return !isFluxKontext;
default:
assert<Equals<typeof entityType, never>>(false);
}
- }, [entityType, isSD3, isCogView4, isFluxKontext]);
+ }, [entityType, isSD3, isCogView4, isFluxKontext, isExternal]);
return isEntityTypeEnabled;
};
diff --git a/invokeai/frontend/web/src/features/controlLayers/konva/CanvasTool/CanvasBboxToolModule.ts b/invokeai/frontend/web/src/features/controlLayers/konva/CanvasTool/CanvasBboxToolModule.ts
index ecf9a5d1c7..2ab2d1f281 100644
--- a/invokeai/frontend/web/src/features/controlLayers/konva/CanvasTool/CanvasBboxToolModule.ts
+++ b/invokeai/frontend/web/src/features/controlLayers/konva/CanvasTool/CanvasBboxToolModule.ts
@@ -10,7 +10,7 @@ import {
getPrefixedId,
} from 'features/controlLayers/konva/util';
import { selectBboxOverlay } from 'features/controlLayers/store/canvasSettingsSlice';
-import { selectModel } from 'features/controlLayers/store/paramsSlice';
+import { selectHasFixedDimensionSizes, selectModel } from 'features/controlLayers/store/paramsSlice';
import { selectBbox } from 'features/controlLayers/store/selectors';
import type { Coordinate, Rect, Tool } from 'features/controlLayers/store/types';
import Konva from 'konva';
@@ -191,6 +191,9 @@ export class CanvasBboxToolModule extends CanvasModuleBase {
// Listen for the model changing - some model types constraint the bbox to a certain size or aspect ratio.
this.subscriptions.add(this.manager.stateApi.createStoreSubscription(selectModel, this.render));
+ // Listen for fixed dimension sizes changes - external models may lock bbox resizing
+ this.subscriptions.add(this.manager.stateApi.createStoreSubscription(selectHasFixedDimensionSizes, this.render));
+
// Update on busy state changes
this.subscriptions.add(this.manager.$isBusy.listen(this.render));
@@ -246,6 +249,10 @@ export class CanvasBboxToolModule extends CanvasModuleBase {
if (tool !== 'bbox') {
return NO_ANCHORS;
}
+ // External models with fixed dimension presets don't allow free bbox resizing
+ if (this.manager.stateApi.runSelector(selectHasFixedDimensionSizes)) {
+ return NO_ANCHORS;
+ }
return ALL_ANCHORS;
};
diff --git a/invokeai/frontend/web/src/features/controlLayers/store/canvasSlice.ts b/invokeai/frontend/web/src/features/controlLayers/store/canvasSlice.ts
index fd170e19e8..358c27b50f 100644
--- a/invokeai/frontend/web/src/features/controlLayers/store/canvasSlice.ts
+++ b/invokeai/frontend/web/src/features/controlLayers/store/canvasSlice.ts
@@ -7,7 +7,7 @@ import { roundDownToMultiple, roundToMultiple } from 'common/util/roundDownToMul
import { merge } from 'es-toolkit/compat';
import { getPrefixedId } from 'features/controlLayers/konva/util';
import { canvasReset } from 'features/controlLayers/store/actions';
-import { modelChanged } from 'features/controlLayers/store/paramsSlice';
+import { aspectRatioIdChanged, modelChanged, resolutionPresetSelected } from 'features/controlLayers/store/paramsSlice';
import {
selectAllEntities,
selectAllEntitiesOfType,
@@ -31,6 +31,7 @@ import type {
RgbColor,
SimpleAdjustmentsConfig,
} from 'features/controlLayers/store/types';
+import { isAspectRatioID } from 'features/controlLayers/store/types';
import {
calculateNewSize,
getScaledBoundingBoxDimensions,
@@ -1288,21 +1289,31 @@ const slice = createSlice({
state.bbox.aspectRatio.isLocked = !state.bbox.aspectRatio.isLocked;
syncScaledSize(state);
},
- bboxAspectRatioIdChanged: (state, action: PayloadAction<{ id: AspectRatioID }>) => {
- const { id } = action.payload;
+ bboxAspectRatioIdChanged: (
+ state,
+ action: PayloadAction<{ id: AspectRatioID; fixedSize?: { width: number; height: number } }>
+ ) => {
+ const { id, fixedSize } = action.payload;
state.bbox.aspectRatio.id = id;
if (id === 'Free') {
state.bbox.aspectRatio.isLocked = false;
} else {
state.bbox.aspectRatio.isLocked = true;
- state.bbox.aspectRatio.value = ASPECT_RATIO_MAP[id].ratio;
- const { width, height } = calculateNewSize(
- state.bbox.aspectRatio.value,
- state.bbox.rect.width * state.bbox.rect.height,
- state.bbox.modelBase
- );
- state.bbox.rect.width = width;
- state.bbox.rect.height = height;
+ if (fixedSize) {
+ // External models provide fixed dimensions for each aspect ratio
+ state.bbox.aspectRatio.value = fixedSize.width / fixedSize.height;
+ state.bbox.rect.width = fixedSize.width;
+ state.bbox.rect.height = fixedSize.height;
+ } else {
+ state.bbox.aspectRatio.value = ASPECT_RATIO_MAP[id].ratio;
+ const { width, height } = calculateNewSize(
+ state.bbox.aspectRatio.value,
+ state.bbox.rect.width * state.bbox.rect.height,
+ state.bbox.modelBase
+ );
+ state.bbox.rect.width = width;
+ state.bbox.rect.height = height;
+ }
}
syncScaledSize(state);
@@ -1800,6 +1811,29 @@ const slice = createSlice({
syncScaledSize(state);
}
});
+ // Sync bbox when external model resolution preset is selected (aspect_ratio_sizes)
+ builder.addCase(aspectRatioIdChanged, (state, action) => {
+ const { id, fixedSize } = action.payload;
+ // Only sync when fixedSize is provided (external models with aspect_ratio_sizes)
+ if (fixedSize) {
+ state.bbox.rect.width = fixedSize.width;
+ state.bbox.rect.height = fixedSize.height;
+ state.bbox.aspectRatio.value = fixedSize.width / fixedSize.height;
+ state.bbox.aspectRatio.id = id;
+ state.bbox.aspectRatio.isLocked = true;
+ syncScaledSize(state);
+ }
+ });
+ // Sync bbox when external model resolution preset is selected (resolution_presets)
+ builder.addCase(resolutionPresetSelected, (state, action) => {
+ const { width, height, aspectRatio } = action.payload;
+ state.bbox.rect.width = width;
+ state.bbox.rect.height = height;
+ state.bbox.aspectRatio.value = width / height;
+ state.bbox.aspectRatio.id = isAspectRatioID(aspectRatio) ? aspectRatio : 'Free';
+ state.bbox.aspectRatio.isLocked = true;
+ syncScaledSize(state);
+ });
},
});
diff --git a/invokeai/frontend/web/src/features/controlLayers/store/paramsSlice.test.ts b/invokeai/frontend/web/src/features/controlLayers/store/paramsSlice.test.ts
new file mode 100644
index 0000000000..7d665a3818
--- /dev/null
+++ b/invokeai/frontend/web/src/features/controlLayers/store/paramsSlice.test.ts
@@ -0,0 +1,133 @@
+import type {
+ ExternalApiModelConfig,
+ ExternalApiModelDefaultSettings,
+ ExternalImageSize,
+ ExternalModelCapabilities,
+ ExternalModelPanelSchema,
+} from 'services/api/types';
+import { describe, expect, it } from 'vitest';
+
+import {
+ selectModelSupportsDimensions,
+ selectModelSupportsGuidance,
+ selectModelSupportsNegativePrompt,
+ selectModelSupportsRefImages,
+ selectModelSupportsSeed,
+ selectModelSupportsSteps,
+} from './paramsSlice';
+
+const buildExternalModelIdentifier = (config: ExternalApiModelConfig) =>
+ ({
+ key: config.key,
+ hash: config.hash,
+ name: config.name,
+ base: config.base,
+ type: config.type,
+ }) as const;
+
+const createExternalConfig = (
+ capabilities: ExternalModelCapabilities,
+ panelSchema?: ExternalModelPanelSchema
+): ExternalApiModelConfig => {
+ const maxImageSize: ExternalImageSize = { width: 1024, height: 1024 };
+ const defaultSettings: ExternalApiModelDefaultSettings = { width: 1024, height: 1024 };
+
+ return {
+ key: 'external-test',
+ hash: 'external:openai:gpt-image-1',
+ path: 'external://openai/gpt-image-1',
+ file_size: 0,
+ name: 'External Test',
+ description: null,
+ source: 'external://openai/gpt-image-1',
+ source_type: 'url',
+ source_api_response: null,
+ cover_image: null,
+ base: 'external',
+ type: 'external_image_generator',
+ format: 'external_api',
+ provider_id: 'openai',
+ provider_model_id: 'gpt-image-1',
+ capabilities: { ...capabilities, max_image_size: maxImageSize },
+ default_settings: defaultSettings,
+ panel_schema: panelSchema,
+ tags: ['external'],
+ is_default: false,
+ };
+};
+
+describe('paramsSlice selectors for external models', () => {
+ it('returns false for negative prompt support on external models', () => {
+ const config = createExternalConfig({
+ modes: ['txt2img'],
+ supports_reference_images: false,
+ });
+ const model = buildExternalModelIdentifier(config);
+
+ expect(selectModelSupportsNegativePrompt.resultFunc(model)).toBe(false);
+ });
+
+ it('uses external capabilities for ref image support', () => {
+ const config = createExternalConfig({
+ modes: ['txt2img'],
+ supports_reference_images: false,
+ });
+ const model = buildExternalModelIdentifier(config);
+
+ expect(selectModelSupportsRefImages.resultFunc(model, config)).toBe(false);
+ });
+
+ it('returns false for guidance support on external models', () => {
+ const config = createExternalConfig({
+ modes: ['txt2img'],
+ supports_reference_images: false,
+ });
+ const model = buildExternalModelIdentifier(config);
+
+ expect(selectModelSupportsGuidance.resultFunc(model)).toBe(false);
+ });
+
+ it('uses external capabilities for seed support', () => {
+ const config = createExternalConfig({
+ modes: ['txt2img'],
+ supports_reference_images: false,
+ supports_seed: false,
+ });
+ const model = buildExternalModelIdentifier(config);
+
+ expect(selectModelSupportsSeed.resultFunc(model, config)).toBe(false);
+ });
+
+ it('returns false for steps support on external models', () => {
+ const config = createExternalConfig({
+ modes: ['txt2img'],
+ supports_reference_images: false,
+ });
+ const model = buildExternalModelIdentifier(config);
+
+ expect(selectModelSupportsSteps.resultFunc(model)).toBe(false);
+ });
+
+ it('prefers panel schema over capabilities for control visibility', () => {
+ const config = createExternalConfig(
+ {
+ modes: ['txt2img'],
+ supports_reference_images: true,
+ supports_seed: true,
+ },
+ {
+ prompts: [{ name: 'reference_images' }],
+ image: [{ name: 'dimensions' }],
+ generation: [],
+ }
+ );
+ const model = buildExternalModelIdentifier(config);
+
+ expect(selectModelSupportsNegativePrompt.resultFunc(model)).toBe(false);
+ expect(selectModelSupportsRefImages.resultFunc(model, config)).toBe(true);
+ expect(selectModelSupportsGuidance.resultFunc(model)).toBe(false);
+ expect(selectModelSupportsSeed.resultFunc(model, config)).toBe(false);
+ expect(selectModelSupportsSteps.resultFunc(model)).toBe(false);
+ expect(selectModelSupportsDimensions.resultFunc(model, config)).toBe(true);
+ });
+});
diff --git a/invokeai/frontend/web/src/features/controlLayers/store/paramsSlice.ts b/invokeai/frontend/web/src/features/controlLayers/store/paramsSlice.ts
index 9aabba94ae..25670b28df 100644
--- a/invokeai/frontend/web/src/features/controlLayers/store/paramsSlice.ts
+++ b/invokeai/frontend/web/src/features/controlLayers/store/paramsSlice.ts
@@ -21,6 +21,7 @@ import {
SUPPORTS_OPTIMIZED_DENOISING_BASE_MODELS,
SUPPORTS_REF_IMAGES_BASE_MODELS,
} from 'features/modelManagerV2/models';
+import type { BaseModelType } from 'features/nodes/types/common';
import { CLIP_SKIP_MAP } from 'features/parameters/types/constants';
import type {
ParameterCanvasCoherenceMode,
@@ -41,9 +42,11 @@ import type {
ParameterT5EncoderModel,
ParameterVAEModel,
} from 'features/parameters/types/parameterSchemas';
+import { getExternalPanelControl, hasExternalPanelControl } from 'features/parameters/util/externalPanelSchema';
import { getGridSize, getIsSizeOptimal, getOptimalDimension } from 'features/parameters/util/optimalDimension';
import { modelConfigsAdapterSelectors, selectModelConfigsQuery } from 'services/api/endpoints/models';
-import { isNonRefinerMainModelConfig } from 'services/api/types';
+import type { AnyModelConfigWithExternal } from 'services/api/types';
+import { isExternalApiModelConfig, isNonRefinerMainModelConfig } from 'services/api/types';
import { assert } from 'tsafe';
const slice = createSlice({
@@ -357,7 +360,7 @@ const slice = createSlice({
//#region Dimensions
sizeRecalled: (state, action: PayloadAction<{ width: number; height: number }>) => {
const { width, height } = action.payload;
- const gridSize = getGridSize(state.model?.base);
+ const gridSize = getGridSize(state.model?.base as BaseModelType | undefined);
state.dimensions.width = Math.max(roundDownToMultiple(width, gridSize), 64);
state.dimensions.height = Math.max(roundDownToMultiple(height, gridSize), 64);
state.dimensions.aspectRatio.value = state.dimensions.width / state.dimensions.height;
@@ -366,7 +369,7 @@ const slice = createSlice({
},
widthChanged: (state, action: PayloadAction<{ width: number; updateAspectRatio?: boolean; clamp?: boolean }>) => {
const { width, updateAspectRatio, clamp } = action.payload;
- const gridSize = getGridSize(state.model?.base);
+ const gridSize = getGridSize(state.model?.base as BaseModelType | undefined);
state.dimensions.width = clamp ? Math.max(roundDownToMultiple(width, gridSize), 64) : width;
if (state.dimensions.aspectRatio.isLocked) {
@@ -384,7 +387,7 @@ const slice = createSlice({
},
heightChanged: (state, action: PayloadAction<{ height: number; updateAspectRatio?: boolean; clamp?: boolean }>) => {
const { height, updateAspectRatio, clamp } = action.payload;
- const gridSize = getGridSize(state.model?.base);
+ const gridSize = getGridSize(state.model?.base as BaseModelType | undefined);
state.dimensions.height = clamp ? Math.max(roundDownToMultiple(height, gridSize), 64) : height;
if (state.dimensions.aspectRatio.isLocked) {
@@ -403,21 +406,30 @@ const slice = createSlice({
aspectRatioLockToggled: (state) => {
state.dimensions.aspectRatio.isLocked = !state.dimensions.aspectRatio.isLocked;
},
- aspectRatioIdChanged: (state, action: PayloadAction<{ id: AspectRatioID }>) => {
- const { id } = action.payload;
+ aspectRatioIdChanged: (
+ state,
+ action: PayloadAction<{ id: AspectRatioID; fixedSize?: { width: number; height: number } }>
+ ) => {
+ const { id, fixedSize } = action.payload;
state.dimensions.aspectRatio.id = id;
if (id === 'Free') {
state.dimensions.aspectRatio.isLocked = false;
} else {
state.dimensions.aspectRatio.isLocked = true;
- state.dimensions.aspectRatio.value = ASPECT_RATIO_MAP[id].ratio;
- const { width, height } = calculateNewSize(
- state.dimensions.aspectRatio.value,
- state.dimensions.width * state.dimensions.height,
- state.model?.base
- );
- state.dimensions.width = width;
- state.dimensions.height = height;
+ if (fixedSize) {
+ state.dimensions.aspectRatio.value = fixedSize.width / fixedSize.height;
+ state.dimensions.width = fixedSize.width;
+ state.dimensions.height = fixedSize.height;
+ } else {
+ state.dimensions.aspectRatio.value = ASPECT_RATIO_MAP[id].ratio;
+ const { width, height } = calculateNewSize(
+ state.dimensions.aspectRatio.value,
+ state.dimensions.width * state.dimensions.height,
+ state.model?.base as BaseModelType | undefined
+ );
+ state.dimensions.width = width;
+ state.dimensions.height = height;
+ }
}
},
dimensionsSwapped: (state) => {
@@ -431,7 +443,7 @@ const slice = createSlice({
const { width, height } = calculateNewSize(
state.dimensions.aspectRatio.value,
state.dimensions.width * state.dimensions.height,
- state.model?.base
+ state.model?.base as BaseModelType | undefined
);
state.dimensions.width = width;
state.dimensions.height = height;
@@ -439,12 +451,12 @@ const slice = createSlice({
}
},
sizeOptimized: (state) => {
- const optimalDimension = getOptimalDimension(state.model?.base);
+ const optimalDimension = getOptimalDimension(state.model?.base as BaseModelType | undefined);
if (state.dimensions.aspectRatio.isLocked) {
const { width, height } = calculateNewSize(
state.dimensions.aspectRatio.value,
optimalDimension * optimalDimension,
- state.model?.base
+ state.model?.base as BaseModelType | undefined
);
state.dimensions.width = width;
state.dimensions.height = height;
@@ -455,18 +467,51 @@ const slice = createSlice({
}
},
syncedToOptimalDimension: (state) => {
- const optimalDimension = getOptimalDimension(state.model?.base);
-
- if (!getIsSizeOptimal(state.dimensions.width, state.dimensions.height, state.model?.base)) {
+ const optimalDimension = getOptimalDimension(state.model?.base as BaseModelType | undefined);
+
+ if (
+ !getIsSizeOptimal(
+ state.dimensions.width,
+ state.dimensions.height,
+ state.model?.base as BaseModelType | undefined
+ )
+ ) {
const bboxDims = calculateNewSize(
state.dimensions.aspectRatio.value,
optimalDimension * optimalDimension,
- state.model?.base
+ state.model?.base as BaseModelType | undefined
);
state.dimensions.width = bboxDims.width;
state.dimensions.height = bboxDims.height;
}
},
+ imageSizeChanged: (state, action: PayloadAction<string | null>) => {
+ state.imageSize = action.payload;
+ },
+ openaiQualityChanged: (state, action: PayloadAction<'auto' | 'high' | 'medium' | 'low'>) => {
+ state.openaiQuality = action.payload;
+ },
+ openaiBackgroundChanged: (state, action: PayloadAction<'auto' | 'transparent' | 'opaque'>) => {
+ state.openaiBackground = action.payload;
+ },
+ openaiInputFidelityChanged: (state, action: PayloadAction<'low' | 'high' | null>) => {
+ state.openaiInputFidelity = action.payload;
+ },
+ geminiTemperatureChanged: (state, action: PayloadAction<number | null>) => {
+ state.geminiTemperature = action.payload;
+ },
+ resolutionPresetSelected: (
+ state,
+ action: PayloadAction<{ imageSize: string; aspectRatio: string; width: number; height: number }>
+ ) => {
+ const { imageSize, aspectRatio, width, height } = action.payload;
+ state.imageSize = imageSize;
+ state.dimensions.width = width;
+ state.dimensions.height = height;
+ state.dimensions.aspectRatio.id = aspectRatio as AspectRatioID;
+ state.dimensions.aspectRatio.value = width / height;
+ state.dimensions.aspectRatio.isLocked = true;
+ },
paramsReset: (state) => resetState(state),
paramsRecalled: (_state, action: PayloadAction<ParamsState>) => {
return action.payload;
@@ -499,6 +544,9 @@ const hasModelClipSkip = (model: ParameterModel | null) => {
};
const getModelMaxClipSkip = (model: ParameterModel) => {
+ if (model.base === 'external') {
+ return undefined;
+ }
if (model.base === 'sdxl') {
// We don't support user-defined CLIP skip for SDXL because it doesn't do anything useful
return 0;
@@ -608,7 +656,13 @@ export const {
sizeOptimized,
syncedToOptimalDimension,
+ resolutionPresetSelected,
+ imageSizeChanged,
paramsReset,
+ openaiQualityChanged,
+ openaiBackgroundChanged,
+ openaiInputFidelityChanged,
+ geminiTemperatureChanged,
paramsRecalled,
animaVaeModelSelected,
animaQwen3EncoderModelSelected,
@@ -653,6 +707,7 @@ export const selectIsCogView4 = createParamsSelector((params) => params.model?.b
export const selectIsZImage = createParamsSelector((params) => params.model?.base === 'z-image');
export const selectIsAnima = createParamsSelector((params) => params.model?.base === 'anima');
export const selectIsFlux2 = createParamsSelector((params) => params.model?.base === 'flux2');
+export const selectIsExternal = createParamsSelector((params) => params.model?.base === 'external');
export const selectIsQwenImage = createParamsSelector((params) => params.model?.base === 'qwen-image');
export const selectIsFluxKontext = createParamsSelector((params) => {
if (params.model?.base === 'flux' && params.model?.name.toLowerCase().includes('kontext')) {
@@ -705,19 +760,91 @@ export const selectOptimizedDenoisingEnabled = createParamsSelector((params) =>
export const selectPositivePrompt = createParamsSelector((params) => params.positivePrompt);
export const selectNegativePrompt = createParamsSelector((params) => params.negativePrompt);
export const selectNegativePromptWithFallback = createParamsSelector((params) => params.negativePrompt ?? '');
-export const selectHasNegativePrompt = createParamsSelector((params) => params.negativePrompt !== null);
-export const selectModelSupportsNegativePrompt = createSelector(
- selectModel,
- (model) => !!model && SUPPORTS_NEGATIVE_PROMPT_BASE_MODELS.includes(model.base)
-);
-export const selectModelSupportsRefImages = createSelector(
- selectModel,
- (model) => !!model && SUPPORTS_REF_IMAGES_BASE_MODELS.includes(model.base)
+export const selectModelConfig = createSelector(
+ selectModelConfigsQuery,
+ selectParamsSlice,
+ (modelConfigs, { model }) => {
+ if (!modelConfigs.data) {
+ return null;
+ }
+ if (!model) {
+ return null;
+ }
+ return (
+ (modelConfigsAdapterSelectors.selectById(modelConfigs.data, model.key) as
+ | AnyModelConfigWithExternal
+ | undefined) ?? null
+ );
+ }
);
+export const selectHasNegativePrompt = createParamsSelector((params) => params.negativePrompt !== null);
+export const selectModelSupportsNegativePrompt = createSelector(selectModel, (model) => {
+ if (!model) {
+ return false;
+ }
+ if (model.base === 'external') {
+ return false;
+ }
+ return SUPPORTS_NEGATIVE_PROMPT_BASE_MODELS.includes(model.base);
+});
+export const selectModelSupportsRefImages = createSelector(selectModel, selectModelConfig, (model, modelConfig) => {
+ if (!model) {
+ return false;
+ }
+ if (modelConfig && isExternalApiModelConfig(modelConfig)) {
+ return hasExternalPanelControl(modelConfig, 'prompts', 'reference_images');
+ }
+ if (model.base === 'external') {
+ return false;
+ }
+ return SUPPORTS_REF_IMAGES_BASE_MODELS.includes(model.base);
+});
export const selectModelSupportsOptimizedDenoising = createSelector(
selectModel,
- (model) => !!model && SUPPORTS_OPTIMIZED_DENOISING_BASE_MODELS.includes(model.base)
+ (model) => !!model && model.base !== 'external' && SUPPORTS_OPTIMIZED_DENOISING_BASE_MODELS.includes(model.base)
);
+export const selectModelSupportsGuidance = createSelector(selectModel, (model) => {
+ if (!model) {
+ return false;
+ }
+ if (model.base === 'external') {
+ return false;
+ }
+ return true;
+});
+export const selectModelSupportsSeed = createSelector(selectModel, selectModelConfig, (model, modelConfig) => {
+ if (!model) {
+ return false;
+ }
+ if (modelConfig && isExternalApiModelConfig(modelConfig)) {
+ return hasExternalPanelControl(modelConfig, 'image', 'seed');
+ }
+ return true;
+});
+export const selectModelSupportsSteps = createSelector(selectModel, (model) => {
+ if (!model) {
+ return false;
+ }
+ if (model.base === 'external') {
+ return false;
+ }
+ return true;
+});
+export const selectModelSupportsDimensions = createSelector(selectModel, selectModelConfig, (model, modelConfig) => {
+ if (!model) {
+ return false;
+ }
+ if (modelConfig && isExternalApiModelConfig(modelConfig)) {
+ return hasExternalPanelControl(modelConfig, 'image', 'dimensions');
+ }
+ return true;
+});
+export const selectSeedControl = createSelector(selectModelConfig, (modelConfig) => {
+ if (modelConfig && isExternalApiModelConfig(modelConfig)) {
+ return getExternalPanelControl(modelConfig, 'image', 'seed');
+ }
+ return null;
+});
export const selectScheduler = createParamsSelector((params) => params.scheduler);
export const selectFluxScheduler = createParamsSelector((params) => params.fluxScheduler);
export const selectFluxDypePreset = createParamsSelector((params) => params.fluxDypePreset);
@@ -761,24 +888,51 @@ export const selectHeight = createParamsSelector((params) => params.dimensions.h
export const selectAspectRatioID = createParamsSelector((params) => params.dimensions.aspectRatio.id);
export const selectAspectRatioValue = createParamsSelector((params) => params.dimensions.aspectRatio.value);
export const selectAspectRatioIsLocked = createParamsSelector((params) => params.dimensions.aspectRatio.isLocked);
+export const selectAllowedAspectRatioIDs = createSelector(selectModelConfig, (modelConfig) => {
+ if (!modelConfig || !isExternalApiModelConfig(modelConfig)) {
+ return null;
+ }
+ const allowed = modelConfig.capabilities.allowed_aspect_ratios;
+ return allowed?.length ? allowed : null;
+});
+export const selectAspectRatioSizes = createSelector(selectModelConfig, (modelConfig) => {
+ if (!modelConfig || !isExternalApiModelConfig(modelConfig)) {
+ return null;
+ }
+ return modelConfig.capabilities.aspect_ratio_sizes ?? null;
+});
+export const selectResolutionPresets = createSelector(selectModelConfig, (modelConfig) => {
+ if (!modelConfig || !isExternalApiModelConfig(modelConfig)) {
+ return null;
+ }
+ return modelConfig.capabilities.resolution_presets ?? null;
+});
+export const selectHasFixedDimensionSizes = createSelector(
+ selectAspectRatioSizes,
+ selectResolutionPresets,
+ (sizes, presets) => sizes !== null || (presets !== null && presets.length > 0)
+);
+export const selectImageSize = createParamsSelector((params) => params.imageSize);
+export const selectOpenaiQuality = createParamsSelector((params) => params.openaiQuality);
+export const selectOpenaiBackground = createParamsSelector((params) => params.openaiBackground);
+export const selectOpenaiInputFidelity = createParamsSelector((params) => params.openaiInputFidelity);
+export const selectGeminiTemperature = createParamsSelector((params) => params.geminiTemperature);
+export const selectExternalProviderId = createSelector(selectModelConfig, (modelConfig) => {
+ if (modelConfig && isExternalApiModelConfig(modelConfig)) {
+ return modelConfig.provider_id;
+ }
+ return null;
+});
-export const selectMainModelConfig = createSelector(
- selectModelConfigsQuery,
- selectParamsSlice,
- (modelConfigs, { model }) => {
- if (!modelConfigs.data) {
- return null;
- }
- if (!model) {
- return null;
- }
- const modelConfig = modelConfigsAdapterSelectors.selectById(modelConfigs.data, model.key);
- if (!modelConfig) {
- return null;
- }
- if (!isNonRefinerMainModelConfig(modelConfig)) {
- return null;
- }
+export const selectMainModelConfig = createSelector(selectModelConfig, (modelConfig) => {
+ if (!modelConfig) {
+ return null;
+ }
+ if (isExternalApiModelConfig(modelConfig)) {
return modelConfig;
}
-);
+ if (!isNonRefinerMainModelConfig(modelConfig)) {
+ return null;
+ }
+ return modelConfig;
+});
diff --git a/invokeai/frontend/web/src/features/controlLayers/store/selectors.ts b/invokeai/frontend/web/src/features/controlLayers/store/selectors.ts
index 2e2ae09212..db37f32d49 100644
--- a/invokeai/frontend/web/src/features/controlLayers/store/selectors.ts
+++ b/invokeai/frontend/web/src/features/controlLayers/store/selectors.ts
@@ -13,6 +13,7 @@ import type {
CanvasRegionalGuidanceState,
CanvasState,
} from 'features/controlLayers/store/types';
+import type { BaseModelType } from 'features/nodes/types/common';
import { getGridSize, getOptimalDimension } from 'features/parameters/util/optimalDimension';
import type { Equals } from 'tsafe';
import { assert } from 'tsafe';
@@ -74,7 +75,7 @@ export const selectHasEntities = createSelector(selectEntityCountAll, (count) =>
* Selects the optimal dimension for the canvas based on the currently-selected model
*/
export const selectOptimalDimension = createSelector(selectParamsSlice, (params): number => {
- const modelBase = params.model?.base;
+ const modelBase = params.model?.base as BaseModelType | undefined;
return getOptimalDimension(modelBase ?? null);
});
@@ -82,7 +83,7 @@ export const selectOptimalDimension = createSelector(selectParamsSlice, (params)
* Selects the grid size for the canvas based on the currently-selected model
*/
export const selectGridSize = createSelector(selectParamsSlice, (params): number => {
- const modelBase = params.model?.base;
+ const modelBase = params.model?.base as BaseModelType | undefined;
return getGridSize(modelBase ?? null);
});
diff --git a/invokeai/frontend/web/src/features/controlLayers/store/types.ts b/invokeai/frontend/web/src/features/controlLayers/store/types.ts
index c16ffdbeab..ef44d0cad2 100644
--- a/invokeai/frontend/web/src/features/controlLayers/store/types.ts
+++ b/invokeai/frontend/web/src/features/controlLayers/store/types.ts
@@ -663,19 +663,42 @@ export const zLoRA = z.object({
});
export type LoRA = z.infer<typeof zLoRA>;
-export const zAspectRatioID = z.enum(['Free', '21:9', '16:9', '3:2', '4:3', '1:1', '3:4', '2:3', '9:16', '9:21']);
+export const zAspectRatioID = z.enum([
+ 'Free',
+ '8:1',
+ '4:1',
+ '21:9',
+ '16:9',
+ '3:2',
+ '5:4',
+ '4:3',
+ '1:1',
+ '3:4',
+ '4:5',
+ '2:3',
+ '9:16',
+ '1:4',
+ '9:21',
+ '1:8',
+]);
export type AspectRatioID = z.infer<typeof zAspectRatioID>;
export const isAspectRatioID = (v: unknown): v is AspectRatioID => zAspectRatioID.safeParse(v).success;
export const ASPECT_RATIO_MAP: Record<Exclude<AspectRatioID, 'Free'>, { ratio: number; inverseID: AspectRatioID }> = {
+ '8:1': { ratio: 8 / 1, inverseID: '1:8' },
+ '4:1': { ratio: 4 / 1, inverseID: '1:4' },
'21:9': { ratio: 21 / 9, inverseID: '9:21' },
'16:9': { ratio: 16 / 9, inverseID: '9:16' },
'3:2': { ratio: 3 / 2, inverseID: '2:3' },
+ '5:4': { ratio: 5 / 4, inverseID: '4:5' },
'4:3': { ratio: 4 / 3, inverseID: '4:3' },
'1:1': { ratio: 1, inverseID: '1:1' },
'3:4': { ratio: 3 / 4, inverseID: '4:3' },
+ '4:5': { ratio: 4 / 5, inverseID: '5:4' },
'2:3': { ratio: 2 / 3, inverseID: '3:2' },
'9:16': { ratio: 9 / 16, inverseID: '16:9' },
+ '1:4': { ratio: 1 / 4, inverseID: '4:1' },
'9:21': { ratio: 9 / 21, inverseID: '21:9' },
+ '1:8': { ratio: 1 / 8, inverseID: '8:1' },
};
const zAspectRatioConfig = z.object({
@@ -794,6 +817,13 @@ export const zParamsState = z.object({
zImageSeedVarianceEnabled: z.boolean(),
zImageSeedVarianceStrength: z.number().min(0).max(2),
zImageSeedVarianceRandomizePercent: z.number().min(1).max(100),
+ imageSize: z.string().nullable().default(null),
+ // OpenAI-specific external options
+ openaiQuality: z.enum(['auto', 'high', 'medium', 'low']).default('auto'),
+ openaiBackground: z.enum(['auto', 'transparent', 'opaque']).default('auto'),
+ openaiInputFidelity: z.enum(['low', 'high']).nullable().default(null),
+ // Gemini-specific external options
+ geminiTemperature: z.number().min(0).max(2).nullable().default(null),
dimensions: zDimensionsState,
});
export type ParamsState = z.infer<typeof zParamsState>;
@@ -865,6 +895,11 @@ export const getInitialParamsState = (): ParamsState => ({
zImageSeedVarianceEnabled: false,
zImageSeedVarianceStrength: 0.1,
zImageSeedVarianceRandomizePercent: 50,
+ imageSize: null,
+ openaiQuality: 'auto',
+ openaiBackground: 'auto',
+ openaiInputFidelity: null,
+ geminiTemperature: null,
dimensions: {
width: 512,
height: 512,
diff --git a/invokeai/frontend/web/src/features/controlLayers/store/validators.ts b/invokeai/frontend/web/src/features/controlLayers/store/validators.ts
index 99e9592977..db5ad4f766 100644
--- a/invokeai/frontend/web/src/features/controlLayers/store/validators.ts
+++ b/invokeai/frontend/web/src/features/controlLayers/store/validators.ts
@@ -6,7 +6,11 @@ import type {
RefImageState,
} from 'features/controlLayers/store/types';
import type { ModelIdentifierField } from 'features/nodes/types/common';
-import type { AnyModelConfig, MainModelConfig } from 'services/api/types';
+import {
+ type AnyModelConfigWithExternal,
+ isExternalApiModelConfig,
+ type MainOrExternalModelConfig,
+} from 'services/api/types';
const WARNINGS = {
UNSUPPORTED_MODEL: 'controlLayers.warnings.unsupportedModel',
@@ -28,7 +32,7 @@ type WarningTKey = (typeof WARNINGS)[keyof typeof WARNINGS];
export const getRegionalGuidanceWarnings = (
entity: CanvasRegionalGuidanceState,
- model: MainModelConfig | null | undefined
+ model: MainOrExternalModelConfig | null | undefined
): WarningTKey[] => {
const warnings: WarningTKey[] = [];
@@ -100,8 +104,8 @@ export const getRegionalGuidanceWarnings = (
};
export const areBasesCompatibleForRefImage = (
- first?: ModelIdentifierField | AnyModelConfig | null,
- second?: ModelIdentifierField | AnyModelConfig | null
+ first?: ModelIdentifierField | AnyModelConfigWithExternal | null,
+ second?: ModelIdentifierField | AnyModelConfigWithExternal | null
): boolean => {
if (!first || !second) {
return false;
@@ -122,11 +126,19 @@ export const areBasesCompatibleForRefImage = (
export const getGlobalReferenceImageWarnings = (
entity: RefImageState,
- model: MainModelConfig | null | undefined
+ model: MainOrExternalModelConfig | null | undefined
): WarningTKey[] => {
const warnings: WarningTKey[] = [];
if (model) {
+ if (isExternalApiModelConfig(model)) {
+ if (!entity.config.image) {
+ // No image selected
+ warnings.push(WARNINGS.IP_ADAPTER_NO_IMAGE_SELECTED);
+ }
+ return warnings;
+ }
+
if (model.base === 'sd-3' || model.base === 'sd-2' || model.base === 'anima') {
// Unsupported model architecture
warnings.push(WARNINGS.UNSUPPORTED_MODEL);
@@ -159,7 +171,7 @@ export const getGlobalReferenceImageWarnings = (
export const getControlLayerWarnings = (
entity: CanvasControlLayerState,
- model: MainModelConfig | null | undefined
+ model: MainOrExternalModelConfig | null | undefined
): WarningTKey[] => {
const warnings: WarningTKey[] = [];
@@ -193,7 +205,7 @@ export const getControlLayerWarnings = (
export const getRasterLayerWarnings = (
_entity: CanvasRasterLayerState,
- _model: MainModelConfig | null | undefined
+ _model: MainOrExternalModelConfig | null | undefined
): WarningTKey[] => {
const warnings: WarningTKey[] = [];
@@ -204,7 +216,7 @@ export const getRasterLayerWarnings = (
export const getInpaintMaskWarnings = (
_entity: CanvasInpaintMaskState,
- _model: MainModelConfig | null | undefined
+ _model: MainOrExternalModelConfig | null | undefined
): WarningTKey[] => {
const warnings: WarningTKey[] = [];
diff --git a/invokeai/frontend/web/src/features/metadata/parsing.tsx b/invokeai/frontend/web/src/features/metadata/parsing.tsx
index fc8f3f7f6c..24b643da31 100644
--- a/invokeai/frontend/web/src/features/metadata/parsing.tsx
+++ b/invokeai/frontend/web/src/features/metadata/parsing.tsx
@@ -11,10 +11,15 @@ import {
animaQwen3EncoderModelSelected,
animaT5EncoderModelSelected,
animaVaeModelSelected,
+ geminiTemperatureChanged,
heightChanged,
+ imageSizeChanged,
kleinQwen3EncoderModelSelected,
kleinVaeModelSelected,
negativePromptChanged,
+ openaiBackgroundChanged,
+ openaiInputFidelityChanged,
+ openaiQualityChanged,
positivePromptChanged,
qwenImageComponentSourceSelected,
qwenImageQuantizationChanged,
@@ -1186,7 +1191,8 @@ const LoRAs: CollectionMetadataHandler<LoRA[]> = {
const key = getProperty(rawItem, 'lora.key');
assert(isString(key));
// No need to catch here - if this throws, we move on to the next item
- identifier = await getModelIdentiferFromKey(key, store);
+ const modelConfig = await getModelIdentiferFromKey(key, store);
+ identifier = zModelIdentifierField.parse(modelConfig);
}
assert(identifier.type === 'lora');
@@ -1372,6 +1378,100 @@ const RefImages: CollectionMetadataHandler<RefImageState[]> = {
};
//#endregion RefImages
+//#region External Image Size
+const ImageSize: SingleMetadataHandler<string> = {
+ [SingleMetadataKey]: true,
+ type: 'ImageSize',
+ parse: (metadata, _store) => {
+ const raw = getProperty(metadata, 'image_size');
+ const parsed = z.string().min(1).parse(raw);
+ return Promise.resolve(parsed);
+ },
+ recall: (value, store) => {
+ store.dispatch(imageSizeChanged(value));
+ },
+ i18nKey: 'metadata.imageSize',
+ LabelComponent: MetadataLabel,
+ ValueComponent: ({ value }: SingleMetadataValueProps<string>) => <MetadataPrimitiveValue value={value} />,
+};
+//#endregion External Image Size
+
+//#region Gemini Temperature
+const GeminiTemperature: SingleMetadataHandler<number> = {
+ [SingleMetadataKey]: true,
+ type: 'GeminiTemperature',
+ parse: (metadata, _store) => {
+ const raw = getProperty(metadata, 'gemini_temperature');
+ const parsed = z.number().min(0).max(2).parse(raw);
+ return Promise.resolve(parsed);
+ },
+ recall: (value, store) => {
+ store.dispatch(geminiTemperatureChanged(value));
+ },
+ i18nKey: 'metadata.geminiTemperature',
+ LabelComponent: MetadataLabel,
+ ValueComponent: ({ value }: SingleMetadataValueProps<number>) => <MetadataPrimitiveValue value={value} />,
+};
+//#endregion Gemini Temperature
+
+//#region OpenAI Quality
+const OpenaiQuality: SingleMetadataHandler<'auto' | 'high' | 'medium' | 'low'> = {
+ [SingleMetadataKey]: true,
+ type: 'OpenaiQuality',
+ parse: (metadata, _store) => {
+ const raw = getProperty(metadata, 'openai_quality');
+ const parsed = z.enum(['auto', 'high', 'medium', 'low']).parse(raw);
+ return Promise.resolve(parsed);
+ },
+ recall: (value, store) => {
+ store.dispatch(openaiQualityChanged(value));
+ },
+ i18nKey: 'metadata.openaiQuality',
+ LabelComponent: MetadataLabel,
+ ValueComponent: ({ value }: SingleMetadataValueProps<'auto' | 'high' | 'medium' | 'low'>) => (
+ <MetadataPrimitiveValue value={value} />
+ ),
+};
+//#endregion OpenAI Quality
+
+//#region OpenAI Background
+const OpenaiBackground: SingleMetadataHandler<'auto' | 'transparent' | 'opaque'> = {
+ [SingleMetadataKey]: true,
+ type: 'OpenaiBackground',
+ parse: (metadata, _store) => {
+ const raw = getProperty(metadata, 'openai_background');
+ const parsed = z.enum(['auto', 'transparent', 'opaque']).parse(raw);
+ return Promise.resolve(parsed);
+ },
+ recall: (value, store) => {
+ store.dispatch(openaiBackgroundChanged(value));
+ },
+ i18nKey: 'metadata.openaiBackground',
+ LabelComponent: MetadataLabel,
+ ValueComponent: ({ value }: SingleMetadataValueProps<'auto' | 'transparent' | 'opaque'>) => (
+ <MetadataPrimitiveValue value={value} />
+ ),
+};
+//#endregion OpenAI Background
+
+//#region OpenAI Input Fidelity
+const OpenaiInputFidelity: SingleMetadataHandler<'low' | 'high'> = {
+ [SingleMetadataKey]: true,
+ type: 'OpenaiInputFidelity',
+ parse: (metadata, _store) => {
+ const raw = getProperty(metadata, 'openai_input_fidelity');
+ const parsed = z.enum(['low', 'high']).parse(raw);
+ return Promise.resolve(parsed);
+ },
+ recall: (value, store) => {
+ store.dispatch(openaiInputFidelityChanged(value));
+ },
+ i18nKey: 'metadata.openaiInputFidelity',
+ LabelComponent: MetadataLabel,
+ ValueComponent: ({ value }: SingleMetadataValueProps<'low' | 'high'>) => <MetadataPrimitiveValue value={value} />,
+};
+//#endregion OpenAI Input Fidelity
+
export const ImageMetadataHandlers = {
CreatedBy,
GenerationMode,
@@ -1420,6 +1520,11 @@ export const ImageMetadataHandlers = {
LoRAs,
CanvasLayers,
RefImages,
+ ImageSize,
+ GeminiTemperature,
+ OpenaiQuality,
+ OpenaiBackground,
+ OpenaiInputFidelity,
// TODO: These had parsers in the prev implementation, but they were never actually used?
// controlNet: parseControlNet,
// controlNets: parseAllControlNets,
diff --git a/invokeai/frontend/web/src/features/modelManagerV2/models.ts b/invokeai/frontend/web/src/features/modelManagerV2/models.ts
index 5cf18b337b..9cc4ed24d9 100644
--- a/invokeai/frontend/web/src/features/modelManagerV2/models.ts
+++ b/invokeai/frontend/web/src/features/modelManagerV2/models.ts
@@ -1,10 +1,11 @@
import type { AnyModelVariant, BaseModelType, ModelFormat, ModelType } from 'features/nodes/types/common';
-import type { AnyModelConfig } from 'services/api/types';
import {
+ type AnyModelConfig,
isCLIPEmbedModelConfig,
isCLIPVisionModelConfig,
isControlLoRAModelConfig,
isControlNetModelConfig,
+ isExternalApiModelConfig,
isFluxReduxModelConfig,
isIPAdapterModelConfig,
isLLaVAModelConfig,
@@ -121,6 +122,11 @@ export const MODEL_CATEGORIES: Record<ModelCategoryType, ModelCategoryData> = {
i18nKey: 'modelManager.llavaOnevision',
filter: isLLaVAModelConfig,
},
+ external_image_generator: {
+ category: 'external_image_generator',
+ i18nKey: 'modelManager.externalImageGenerator',
+ filter: isExternalApiModelConfig,
+ },
};
export const MODEL_CATEGORIES_AS_LIST = objectEntries(MODEL_CATEGORIES).map(([category, { i18nKey, filter }]) => ({
@@ -144,6 +150,7 @@ export const MODEL_BASE_TO_COLOR: Record<BaseModelType, string> = {
cogview4: 'red',
'qwen-image': 'orange',
'z-image': 'cyan',
+ external: 'orange',
anima: 'invokePurple',
unknown: 'red',
};
@@ -169,6 +176,7 @@ export const MODEL_TYPE_TO_LONG_NAME: Record<ModelType, string> = {
clip_embed: 'CLIP Embed',
siglip: 'SigLIP',
flux_redux: 'FLUX Redux',
+ external_image_generator: 'External Image Generator',
unknown: 'Unknown',
};
@@ -187,6 +195,7 @@ export const MODEL_BASE_TO_LONG_NAME: Record<BaseModelType, string> = {
cogview4: 'CogView4',
'qwen-image': 'Qwen Image',
'z-image': 'Z-Image',
+ external: 'External',
anima: 'Anima',
unknown: 'Unknown',
};
@@ -206,6 +215,7 @@ export const MODEL_BASE_TO_SHORT_NAME: Record<BaseModelType, string> = {
cogview4: 'CogView4',
'qwen-image': 'QwenImg',
'z-image': 'Z-Image',
+ external: 'External',
anima: 'Anima',
unknown: 'Unknown',
};
@@ -237,6 +247,7 @@ export const MODEL_FORMAT_TO_LONG_NAME: Record<ModelFormat, string> = {
checkpoint: 'Checkpoint',
lycoris: 'LyCORIS',
onnx: 'ONNX',
+ external_api: 'External API',
olive: 'Olive',
embedding_file: 'Embedding (file)',
embedding_folder: 'Embedding (folder)',
diff --git a/invokeai/frontend/web/src/features/modelManagerV2/store/installModelsStore.ts b/invokeai/frontend/web/src/features/modelManagerV2/store/installModelsStore.ts
index b99a1212fe..79b7bfe31a 100644
--- a/invokeai/frontend/web/src/features/modelManagerV2/store/installModelsStore.ts
+++ b/invokeai/frontend/web/src/features/modelManagerV2/store/installModelsStore.ts
@@ -1,13 +1,14 @@
import { atom } from 'nanostores';
-type InstallModelsTabName = 'launchpad' | 'urlOrLocal' | 'huggingface' | 'scanFolder' | 'starterModels';
+type InstallModelsTabName = 'launchpad' | 'urlOrLocal' | 'huggingface' | 'external' | 'scanFolder' | 'starterModels';
const TAB_TO_INDEX_MAP: Record<InstallModelsTabName, number> = {
launchpad: 0,
urlOrLocal: 1,
huggingface: 2,
- scanFolder: 3,
- starterModels: 4,
+ external: 3,
+ scanFolder: 4,
+ starterModels: 5,
};
export const setInstallModelsTabByName = (tab: InstallModelsTabName) => {
diff --git a/invokeai/frontend/web/src/features/modelManagerV2/store/modelManagerV2Slice.ts b/invokeai/frontend/web/src/features/modelManagerV2/store/modelManagerV2Slice.ts
index 092998d0c3..44df38d911 100644
--- a/invokeai/frontend/web/src/features/modelManagerV2/store/modelManagerV2Slice.ts
+++ b/invokeai/frontend/web/src/features/modelManagerV2/store/modelManagerV2Slice.ts
@@ -7,7 +7,10 @@ import { zModelType } from 'features/nodes/types/common';
import { assert } from 'tsafe';
import z from 'zod';
-const zModelCategoryType = zModelType.exclude(['onnx']).or(z.literal('refiner'));
+const zModelCategoryType = zModelType
+ .exclude(['onnx'])
+ .or(z.literal('refiner'))
+ .or(z.literal('external_image_generator'));
export type ModelCategoryType = z.infer<typeof zModelCategoryType>;
const zFilterableModelType = zModelCategoryType.or(z.literal('missing'));
diff --git a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/AddModelPanel/ExternalProviders/ExternalProvidersForm.tsx b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/AddModelPanel/ExternalProviders/ExternalProvidersForm.tsx
new file mode 100644
index 0000000000..aa54071868
--- /dev/null
+++ b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/AddModelPanel/ExternalProviders/ExternalProvidersForm.tsx
@@ -0,0 +1,267 @@
+import {
+ Badge,
+ Button,
+ Card,
+ Flex,
+ FormControl,
+ FormHelperText,
+ FormLabel,
+ Heading,
+ Input,
+ Text,
+ Tooltip,
+} from '@invoke-ai/ui-library';
+import { useStore } from '@nanostores/react';
+import ScrollableContent from 'common/components/OverlayScrollbars/ScrollableContent';
+import { useBuildModelInstallArg } from 'features/modelManagerV2/hooks/useBuildModelsToInstall';
+import { useInstallModel } from 'features/modelManagerV2/hooks/useInstallModel';
+import { $installModelsTabIndex } from 'features/modelManagerV2/store/installModelsStore';
+import type { ChangeEvent } from 'react';
+import { memo, useCallback, useEffect, useMemo, useState } from 'react';
+import { useTranslation } from 'react-i18next';
+import { PiCheckBold, PiWarningBold } from 'react-icons/pi';
+import {
+ useGetExternalProviderConfigsQuery,
+ useResetExternalProviderConfigMutation,
+ useSetExternalProviderConfigMutation,
+} from 'services/api/endpoints/appInfo';
+import { useGetStarterModelsQuery } from 'services/api/endpoints/models';
+import type { ExternalProviderConfig, StarterModel } from 'services/api/types';
+
+const PROVIDER_SORT_ORDER = ['gemini', 'openai'];
+
+type ProviderCardProps = {
+ provider: ExternalProviderConfig;
+ onInstallModels: (providerId: string) => void;
+};
+
+type UpdatePayload = {
+ provider_id: string;
+ api_key?: string;
+ base_url?: string;
+};
+
+export const ExternalProvidersForm = memo(() => {
+ const { t } = useTranslation();
+ const { data, isLoading } = useGetExternalProviderConfigsQuery();
+ const { data: starterModels } = useGetStarterModelsQuery();
+ const [installModel] = useInstallModel();
+ const { getIsInstalled, buildModelInstallArg } = useBuildModelInstallArg();
+ const tabIndex = useStore($installModelsTabIndex);
+
+ const externalModelsByProvider = useMemo(() => {
+ const groups = new Map<string, StarterModel[]>();
+ for (const model of starterModels?.starter_models ?? []) {
+ if (!model.source.startsWith('external://')) {
+ continue;
+ }
+ const providerId = model.source.replace('external://', '').split('/')[0];
+ if (!providerId) {
+ continue;
+ }
+ const models = groups.get(providerId) ?? [];
+ models.push(model);
+ groups.set(providerId, models);
+ }
+
+ for (const [providerId, models] of groups.entries()) {
+ models.sort((a, b) => a.name.localeCompare(b.name));
+ groups.set(providerId, models);
+ }
+
+ return groups;
+ }, [starterModels]);
+
+ const handleInstallProviderModels = useCallback(
+ (providerId: string) => {
+ const models = externalModelsByProvider.get(providerId);
+ if (!models?.length) {
+ return;
+ }
+ const modelsToInstall = models.filter((model) => !getIsInstalled(model)).map(buildModelInstallArg);
+ modelsToInstall.forEach((model) => installModel(model));
+ },
+ [buildModelInstallArg, externalModelsByProvider, getIsInstalled, installModel]
+ );
+
+ const sortedProviders = useMemo(() => {
+ if (!data) {
+ return [];
+ }
+ return [...data].sort((a, b) => {
+ const aIndex = PROVIDER_SORT_ORDER.indexOf(a.provider_id);
+ const bIndex = PROVIDER_SORT_ORDER.indexOf(b.provider_id);
+ if (aIndex === -1 && bIndex === -1) {
+ return a.provider_id.localeCompare(b.provider_id);
+ }
+ if (aIndex === -1) {
+ return 1;
+ }
+ if (bIndex === -1) {
+ return -1;
+ }
+ return aIndex - bIndex;
+ });
+ }, [data]);
+
+ return (
+ <Flex flexDir="column" height="100%" gap={4}>
+ <Flex flexDir="column" gap={1}>
+ <Heading size="sm">{t('modelManager.externalSetupTitle')}</Heading>
+ <Text color="base.300">{t('modelManager.externalSetupDescription')}</Text>
+ </Flex>
+ <ScrollableContent>
+ <Flex flexDir="column" gap={4}>
+ {isLoading && <Text color="base.300">{t('common.loading')}</Text>}
+ {!isLoading && sortedProviders.length === 0 && (
+ <Text color="base.300">{t('modelManager.externalProvidersUnavailable')}</Text>
+ )}
+ {sortedProviders.map((provider) => (
+ <ProviderCard
+ key={provider.provider_id}
+ provider={provider}
+ onInstallModels={handleInstallProviderModels}
+ />
+ ))}
+ </Flex>
+ </ScrollableContent>
+ {tabIndex === 3 && (
+ <Text variant="subtext" color="base.400">
+ {t('modelManager.externalSetupFooter')}
+ </Text>
+ )}
+ </Flex>
+ );
+});
+
+ExternalProvidersForm.displayName = 'ExternalProvidersForm';
+
+const ProviderCard = memo(({ provider, onInstallModels }: ProviderCardProps) => {
+ const { t } = useTranslation();
+ const [apiKey, setApiKey] = useState('');
+ const [baseUrl, setBaseUrl] = useState(provider.base_url ?? '');
+ const [saveConfig, { isLoading }] = useSetExternalProviderConfigMutation();
+ const [resetConfig, { isLoading: isResetting }] = useResetExternalProviderConfigMutation();
+
+ useEffect(() => {
+ setBaseUrl(provider.base_url ?? '');
+ }, [provider.base_url]);
+
+ const handleSave = useCallback(() => {
+ const trimmedApiKey = apiKey.trim();
+ const trimmedBaseUrl = baseUrl.trim();
+ const updatePayload: UpdatePayload = {
+ provider_id: provider.provider_id,
+ };
+ if (trimmedApiKey) {
+ updatePayload.api_key = trimmedApiKey;
+ }
+ if (trimmedBaseUrl !== (provider.base_url ?? '')) {
+ updatePayload.base_url = trimmedBaseUrl;
+ }
+
+ if (!updatePayload.api_key && updatePayload.base_url === undefined) {
+ return;
+ }
+
+ saveConfig(updatePayload)
+ .unwrap()
+ .then((result) => {
+ if (result.api_key_configured) {
+ setApiKey('');
+ onInstallModels(provider.provider_id);
+ }
+ if (result.base_url !== undefined) {
+ setBaseUrl(result.base_url ?? '');
+ }
+ });
+ }, [apiKey, baseUrl, onInstallModels, provider.base_url, provider.provider_id, saveConfig]);
+
+ const handleReset = useCallback(() => {
+ resetConfig(provider.provider_id)
+ .unwrap()
+ .then((result) => {
+ setApiKey('');
+ setBaseUrl(result.base_url ?? '');
+ });
+ }, [provider.provider_id, resetConfig]);
+
+ const handleApiKeyChange = useCallback((event: ChangeEvent<HTMLInputElement>) => {
+ setApiKey(event.target.value);
+ }, []);
+
+ const handleBaseUrlChange = useCallback((event: ChangeEvent<HTMLInputElement>) => {
+ setBaseUrl(event.target.value);
+ }, []);
+
+ const statusBadge = provider.api_key_configured ? (
+ <Badge colorScheme="green" display="flex" alignItems="center" gap={2}>
+ <PiCheckBold />
+ {t('settings.externalProviderConfigured')}
+ </Badge>
+ ) : (
+ <Badge colorScheme="warning" display="flex" alignItems="center" gap={2}>
+ <PiWarningBold />
+ {t('settings.externalProviderNotConfigured')}
+ </Badge>
+ );
+
+ return (
+ <Card p={4} gap={4} variant="outline">
+ <Flex justifyContent="space-between" alignItems="center" flexWrap="wrap" gap={3}>
+ <Flex flexDir="column" gap={1}>
+ <Heading size="xs" textTransform="capitalize">
+ {provider.provider_id}
+ </Heading>
+ <Text variant="subtext">
+ {t('modelManager.externalProviderCardDescription', { providerId: provider.provider_id })}
+ </Text>
+ </Flex>
+ {statusBadge}
+ </Flex>
+ <Flex flexDir="column" gap={4}>
+ <FormControl>
+ <FormLabel>{t('modelManager.externalApiKey')}</FormLabel>
+ <Input
+ type="password"
+ autoComplete="off"
+ placeholder={
+ provider.api_key_configured
+ ? t('modelManager.externalApiKeyPlaceholderSet')
+ : t('modelManager.externalApiKeyPlaceholder')
+ }
+ value={apiKey}
+ onChange={handleApiKeyChange}
+ />
+ <FormHelperText>{t('modelManager.externalApiKeyHelper')}</FormHelperText>
+ </FormControl>
+ <FormControl>
+ <FormLabel>{t('modelManager.externalBaseUrl')}</FormLabel>
+ <Input
+ placeholder={t('modelManager.externalBaseUrlPlaceholder')}
+ value={baseUrl}
+ onChange={handleBaseUrlChange}
+ />
+ <FormHelperText>{t('modelManager.externalBaseUrlHelper')}</FormHelperText>
+ </FormControl>
+ <Flex gap={2} justifyContent="flex-end" flexWrap="wrap">
+ <Tooltip label={t('modelManager.externalResetHelper')}>
+ <Button variant="ghost" onClick={handleReset} isLoading={isResetting}>
+ {t('common.reset')}
+ </Button>
+ </Tooltip>
+ <Button
+ colorScheme="invokeYellow"
+ onClick={handleSave}
+ isLoading={isLoading}
+ isDisabled={!apiKey.trim() && baseUrl.trim() === (provider.base_url ?? '')}
+ >
+ {t('common.save')}
+ </Button>
+ </Flex>
+ </Flex>
+ </Card>
+ );
+});
+
+ProviderCard.displayName = 'ProviderCard';
diff --git a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/AddModelPanel/LaunchpadForm/LaunchpadForm.tsx b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/AddModelPanel/LaunchpadForm/LaunchpadForm.tsx
index fc99bcec7b..591c61a4b2 100644
--- a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/AddModelPanel/LaunchpadForm/LaunchpadForm.tsx
+++ b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/AddModelPanel/LaunchpadForm/LaunchpadForm.tsx
@@ -6,7 +6,7 @@ import { StarterBundleButton } from 'features/modelManagerV2/subpanels/AddModelP
import { StarterBundleTooltipContentCompact } from 'features/modelManagerV2/subpanels/AddModelPanel/StarterModels/StarterBundleTooltipContentCompact';
import { memo, useCallback } from 'react';
import { useTranslation } from 'react-i18next';
-import { PiFolderOpenBold, PiLinkBold, PiStarBold } from 'react-icons/pi';
+import { PiFolderOpenBold, PiLinkBold, PiPlugBold, PiStarBold } from 'react-icons/pi';
import { SiHuggingface } from 'react-icons/si';
import { useGetStarterModelsQuery } from 'services/api/endpoints/models';
@@ -28,6 +28,10 @@ export const LaunchpadForm = memo(() => {
setInstallModelsTabByName('scanFolder');
}, []);
+ const navigateToExternalTab = useCallback(() => {
+ setInstallModelsTabByName('external');
+ }, []);
+
const navigateToStarterModelsTab = useCallback(() => {
setInstallModelsTabByName('starterModels');
}, []);
@@ -63,6 +67,12 @@ export const LaunchpadForm = memo(() => {
title={t('modelManager.scanFolder')}
description={t('modelManager.launchpad.scanFolderDescription')}
/>
+ <LaunchpadButton
+ onClick={navigateToExternalTab}
+ icon={PiPlugBold}
+ title={t('modelManager.externalProviders')}
+ description={t('modelManager.launchpad.externalDescription')}
+ />
</Grid>
</Flex>
{/* Recommended Section */}
diff --git a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/AddModelPanel/ModelInstallQueue/ModelInstallQueueItem.tsx b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/AddModelPanel/ModelInstallQueue/ModelInstallQueueItem.tsx
index 1f4fc2a910..b2bad4c386 100644
--- a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/AddModelPanel/ModelInstallQueue/ModelInstallQueueItem.tsx
+++ b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/AddModelPanel/ModelInstallQueue/ModelInstallQueueItem.tsx
@@ -285,6 +285,8 @@ export const ModelInstallQueueItem = memo((props: ModelListItemProps) => {
return installJob.source.url;
case 'local':
return installJob.source.path;
+ case 'external':
+ return `external://${installJob.source.provider_id}/${installJob.source.provider_model_id}`;
default:
return t('common.unknown');
}
@@ -292,6 +294,8 @@ export const ModelInstallQueueItem = memo((props: ModelListItemProps) => {
const displayStatus = optimisticStatus?.status ?? installJob.status;
+ const configuredName = installJob.config_in?.name;
+
const modelName = useMemo(() => {
switch (installJob.source.type) {
case 'hf': {
@@ -302,13 +306,15 @@ export const ModelInstallQueueItem = memo((props: ModelListItemProps) => {
return repo_id;
}
case 'url':
- return installJob.source.url.split('/').slice(-1)[0] ?? t('common.unknown');
+ return configuredName ?? installJob.source.url.split('/').slice(-1)[0] ?? t('common.unknown');
case 'local':
- return installJob.source.path.split(/[/\\]/).slice(-1)[0] ?? t('common.unknown');
+ return configuredName ?? installJob.source.path.split(/[/\\]/).slice(-1)[0] ?? t('common.unknown');
+ case 'external':
+ return configuredName ?? `${installJob.source.provider_id}/${installJob.source.provider_model_id}`;
default:
- return t('common.unknown');
+ return configuredName ?? t('common.unknown');
}
- }, [installJob.source, t]);
+ }, [configuredName, installJob.source, t]);
const progressValue = useMemo(() => {
if (displayStatus === 'completed' || displayStatus === 'error' || displayStatus === 'cancelled') {
diff --git a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/AddModelPanel/StarterModels/StarterModelsResults.tsx b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/AddModelPanel/StarterModels/StarterModelsResults.tsx
index 86350c54c4..20b52cbf94 100644
--- a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/AddModelPanel/StarterModels/StarterModelsResults.tsx
+++ b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/AddModelPanel/StarterModels/StarterModelsResults.tsx
@@ -21,6 +21,9 @@ export const StarterModelsResults = memo(({ results }: StarterModelsResultsProps
const filteredResults = useMemo(() => {
return results.starter_models.filter((result) => {
+ if (result.source.startsWith('external://')) {
+ return false;
+ }
const trimmedSearchTerm = searchTerm.trim().toLowerCase();
const matchStrings = [
result.name.toLowerCase(),
diff --git a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/InstallModels.tsx b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/InstallModels.tsx
index 7957b31c2a..92dea53c8b 100644
--- a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/InstallModels.tsx
+++ b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/InstallModels.tsx
@@ -2,18 +2,18 @@ import type { SystemStyleObject } from '@invoke-ai/ui-library';
import { Box, Divider, Flex, Heading, Tab, TabList, TabPanel, TabPanels, Tabs } from '@invoke-ai/ui-library';
import { useStore } from '@nanostores/react';
import { $installModelsTabIndex } from 'features/modelManagerV2/store/installModelsStore';
+import { ExternalProvidersForm } from 'features/modelManagerV2/subpanels/AddModelPanel/ExternalProviders/ExternalProvidersForm';
+import { HuggingFaceForm } from 'features/modelManagerV2/subpanels/AddModelPanel/HuggingFaceFolder/HuggingFaceForm';
+import { InstallModelForm } from 'features/modelManagerV2/subpanels/AddModelPanel/InstallModelForm';
+import { LaunchpadForm } from 'features/modelManagerV2/subpanels/AddModelPanel/LaunchpadForm/LaunchpadForm';
+import { ModelInstallQueue } from 'features/modelManagerV2/subpanels/AddModelPanel/ModelInstallQueue/ModelInstallQueue';
+import { ScanModelsForm } from 'features/modelManagerV2/subpanels/AddModelPanel/ScanFolder/ScanFolderForm';
import { StarterModelsForm } from 'features/modelManagerV2/subpanels/AddModelPanel/StarterModels/StarterModelsForm';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
-import { PiCubeBold, PiFolderOpenBold, PiLinkSimpleBold, PiShootingStarBold } from 'react-icons/pi';
+import { PiCubeBold, PiFolderOpenBold, PiLinkSimpleBold, PiPlugBold, PiShootingStarBold } from 'react-icons/pi';
import { SiHuggingface } from 'react-icons/si';
-import { HuggingFaceForm } from './AddModelPanel/HuggingFaceFolder/HuggingFaceForm';
-import { InstallModelForm } from './AddModelPanel/InstallModelForm';
-import { LaunchpadForm } from './AddModelPanel/LaunchpadForm/LaunchpadForm';
-import { ModelInstallQueue } from './AddModelPanel/ModelInstallQueue/ModelInstallQueue';
-import { ScanModelsForm } from './AddModelPanel/ScanFolder/ScanFolderForm';
-
const installModelsTabSx: SystemStyleObject = {
display: 'flex',
gap: 2,
@@ -61,6 +61,10 @@ export const InstallModels = memo(() => {
<SiHuggingface />
{t('modelManager.huggingFace')}
</Tab>
+ <Tab sx={installModelsTabSx}>
+ <PiPlugBold />
+ {t('modelManager.externalProviders')}
+ </Tab>
<Tab sx={installModelsTabSx}>
<PiFolderOpenBold />
{t('modelManager.scanFolder')}
@@ -80,6 +84,9 @@ export const InstallModels = memo(() => {
<TabPanel height="100%">
<HuggingFaceForm />
</TabPanel>
+ <TabPanel height="100%">
+ <ExternalProvidersForm />
+ </TabPanel>
<TabPanel height="100%">
<ScanModelsForm />
</TabPanel>
diff --git a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelManagerPanel/ModelFormatBadge.tsx b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelManagerPanel/ModelFormatBadge.tsx
index 7d44ee5463..ff4dbe88fc 100644
--- a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelManagerPanel/ModelFormatBadge.tsx
+++ b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelManagerPanel/ModelFormatBadge.tsx
@@ -19,6 +19,7 @@ const FORMAT_NAME_MAP: Record<ModelFormat, string> = {
bnb_quantized_nf4b: 'quantized',
gguf_quantized: 'gguf',
omi: 'omi',
+ external_api: 'external_api',
unknown: 'unknown',
olive: 'olive',
onnx: 'onnx',
@@ -40,6 +41,7 @@ const FORMAT_COLOR_MAP: Record<ModelFormat, string> = {
unknown: 'red',
olive: 'base',
onnx: 'base',
+ external_api: 'base',
};
const ModelFormatBadge = ({ format }: Props) => {
diff --git a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/Fields/BaseModelSelect.tsx b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/Fields/BaseModelSelect.tsx
index 8235d26efe..e4c8752e56 100644
--- a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/Fields/BaseModelSelect.tsx
+++ b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/Fields/BaseModelSelect.tsx
@@ -5,7 +5,7 @@ import { MODEL_BASE_TO_LONG_NAME } from 'features/modelManagerV2/models';
import { useCallback, useMemo } from 'react';
import type { Control } from 'react-hook-form';
import { useController } from 'react-hook-form';
-import type { UpdateModelArg } from 'services/api/endpoints/models';
+import type { UpdateModelBody } from 'services/api/types';
import { objectEntries } from 'tsafe';
const options: ComboboxOption[] = objectEntries(MODEL_BASE_TO_LONG_NAME).map(([value, label]) => ({
@@ -14,7 +14,7 @@ const options: ComboboxOption[] = objectEntries(MODEL_BASE_TO_LONG_NAME).map(([v
}));
type Props = {
- control: Control<UpdateModelArg['body']>;
+ control: Control<UpdateModelBody>;
};
const BaseModelSelect = ({ control }: Props) => {
diff --git a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/Fields/ModelFormatSelect.tsx b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/Fields/ModelFormatSelect.tsx
index 1057ab7784..2bd3eb954e 100644
--- a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/Fields/ModelFormatSelect.tsx
+++ b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/Fields/ModelFormatSelect.tsx
@@ -5,7 +5,7 @@ import { MODEL_FORMAT_TO_LONG_NAME } from 'features/modelManagerV2/models';
import { useCallback, useMemo } from 'react';
import type { Control } from 'react-hook-form';
import { useController } from 'react-hook-form';
-import type { UpdateModelArg } from 'services/api/endpoints/models';
+import type { UpdateModelBody } from 'services/api/types';
import { objectEntries } from 'tsafe';
const options: ComboboxOption[] = objectEntries(MODEL_FORMAT_TO_LONG_NAME).map(([value, label]) => ({
@@ -14,7 +14,7 @@ const options: ComboboxOption[] = objectEntries(MODEL_FORMAT_TO_LONG_NAME).map((
}));
type Props = {
- control: Control<UpdateModelArg['body']>;
+ control: Control<UpdateModelBody>;
};
const ModelFormatSelect = ({ control }: Props) => {
diff --git a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/Fields/ModelTypeSelect.tsx b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/Fields/ModelTypeSelect.tsx
index 44b41f0151..b35ce7f96d 100644
--- a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/Fields/ModelTypeSelect.tsx
+++ b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/Fields/ModelTypeSelect.tsx
@@ -5,7 +5,7 @@ import { MODEL_TYPE_TO_LONG_NAME } from 'features/modelManagerV2/models';
import { useCallback, useMemo } from 'react';
import type { Control } from 'react-hook-form';
import { useController } from 'react-hook-form';
-import type { UpdateModelArg } from 'services/api/endpoints/models';
+import type { UpdateModelBody } from 'services/api/types';
import { objectEntries } from 'tsafe';
const options: ComboboxOption[] = objectEntries(MODEL_TYPE_TO_LONG_NAME).map(([value, label]) => ({
@@ -14,7 +14,7 @@ const options: ComboboxOption[] = objectEntries(MODEL_TYPE_TO_LONG_NAME).map(([v
}));
type Props = {
- control: Control<UpdateModelArg['body']>;
+ control: Control<UpdateModelBody>;
};
const ModelTypeSelect = ({ control }: Props) => {
diff --git a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/Fields/ModelVariantSelect.tsx b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/Fields/ModelVariantSelect.tsx
index 52eb2a4749..d8e8c6a5b8 100644
--- a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/Fields/ModelVariantSelect.tsx
+++ b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/Fields/ModelVariantSelect.tsx
@@ -5,13 +5,13 @@ import { MODEL_VARIANT_TO_LONG_NAME } from 'features/modelManagerV2/models';
import { useCallback, useMemo } from 'react';
import type { Control } from 'react-hook-form';
import { useController } from 'react-hook-form';
-import type { UpdateModelArg } from 'services/api/endpoints/models';
+import type { UpdateModelBody } from 'services/api/types';
import { objectEntries } from 'tsafe';
const options: ComboboxOption[] = objectEntries(MODEL_VARIANT_TO_LONG_NAME).map(([value, label]) => ({ label, value }));
type Props = {
- control: Control<UpdateModelArg['body']>;
+ control: Control<UpdateModelBody>;
};
const ModelVariantSelect = ({ control }: Props) => {
diff --git a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/Fields/PredictionTypeSelect.tsx b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/Fields/PredictionTypeSelect.tsx
index dcef95b424..593bc4c413 100644
--- a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/Fields/PredictionTypeSelect.tsx
+++ b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/Fields/PredictionTypeSelect.tsx
@@ -4,7 +4,7 @@ import { typedMemo } from 'common/util/typedMemo';
import { useCallback, useMemo } from 'react';
import type { Control } from 'react-hook-form';
import { useController } from 'react-hook-form';
-import type { UpdateModelArg } from 'services/api/endpoints/models';
+import type { UpdateModelBody } from 'services/api/types';
const options: ComboboxOption[] = [
{ value: 'none', label: '-' },
@@ -14,7 +14,7 @@ const options: ComboboxOption[] = [
];
type Props = {
- control: Control<UpdateModelArg['body']>;
+ control: Control<UpdateModelBody>;
};
const PredictionTypeSelect = ({ control }: Props) => {
diff --git a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/Model.tsx b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/Model.tsx
index 0393e32233..4a35a140e1 100644
--- a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/Model.tsx
+++ b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/Model.tsx
@@ -5,6 +5,7 @@ import { memo, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { PiExclamationMarkBold } from 'react-icons/pi';
import { modelConfigsAdapterSelectors, useGetModelConfigsQuery } from 'services/api/endpoints/models';
+import type { AnyModelConfigWithExternal } from 'services/api/types';
import { ModelEdit } from './ModelEdit';
import { ModelView } from './ModelView';
@@ -21,7 +22,9 @@ export const Model = memo(() => {
if (selectedModelKey === null) {
return null;
}
- const modelConfig = modelConfigsAdapterSelectors.selectById(modelConfigs, selectedModelKey);
+ const modelConfig = modelConfigsAdapterSelectors.selectById(modelConfigs, selectedModelKey) as
+ | AnyModelConfigWithExternal
+ | undefined;
if (!modelConfig) {
return null;
diff --git a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/ModelDeleteButton.tsx b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/ModelDeleteButton.tsx
index 92096e7454..db6ba93cfe 100644
--- a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/ModelDeleteButton.tsx
+++ b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/ModelDeleteButton.tsx
@@ -7,11 +7,11 @@ import { memo, type MouseEvent, useCallback } from 'react';
import { useTranslation } from 'react-i18next';
import { PiTrashSimpleBold } from 'react-icons/pi';
import { useDeleteModelsMutation } from 'services/api/endpoints/models';
-import type { AnyModelConfig } from 'services/api/types';
+import type { AnyModelConfigWithExternal } from 'services/api/types';
type Props = {
showLabel?: boolean;
- modelConfig: AnyModelConfig;
+ modelConfig: AnyModelConfigWithExternal;
};
export const ModelDeleteButton = memo(({ showLabel = true, modelConfig }: Props) => {
diff --git a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/ModelEdit.tsx b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/ModelEdit.tsx
index d845eca3ee..66880e2361 100644
--- a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/ModelEdit.tsx
+++ b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/ModelEdit.tsx
@@ -15,12 +15,18 @@ import { useAppDispatch } from 'app/store/storeHooks';
import { setSelectedModelMode } from 'features/modelManagerV2/store/modelManagerV2Slice';
import { ModelHeader } from 'features/modelManagerV2/subpanels/ModelPanel/ModelHeader';
import { toast } from 'features/toast/toast';
-import { memo, useCallback } from 'react';
-import { type SubmitHandler, useForm } from 'react-hook-form';
+import { memo, useCallback, useMemo } from 'react';
+import { type Control, type SubmitHandler, useForm, useWatch } from 'react-hook-form';
import { useTranslation } from 'react-i18next';
import { PiCheckBold, PiXBold } from 'react-icons/pi';
import { type UpdateModelArg, useUpdateModelMutation } from 'services/api/endpoints/models';
-import type { AnyModelConfig } from 'services/api/types';
+import {
+ type AnyModelConfigWithExternal,
+ type ExternalApiModelDefaultSettings,
+ type ExternalModelCapabilities,
+ isExternalApiModelConfig,
+ type UpdateModelBody,
+} from 'services/api/types';
import BaseModelSelect from './Fields/BaseModelSelect';
import ModelFormatSelect from './Fields/ModelFormatSelect';
@@ -30,7 +36,14 @@ import PredictionTypeSelect from './Fields/PredictionTypeSelect';
import { ModelFooter } from './ModelFooter';
type Props = {
- modelConfig: AnyModelConfig;
+ modelConfig: AnyModelConfigWithExternal;
+};
+
+type ModelEditFormValues = UpdateModelBody & {
+ capabilities?: ExternalModelCapabilities;
+ provider_id?: string;
+ provider_model_id?: string;
+ default_settings?: ExternalApiModelDefaultSettings | null;
};
const stringFieldOptions = {
@@ -41,19 +54,54 @@ export const ModelEdit = memo(({ modelConfig }: Props) => {
const { t } = useTranslation();
const [updateModel, { isLoading: isSubmitting }] = useUpdateModelMutation();
const dispatch = useAppDispatch();
+ const isExternal = useMemo(() => isExternalApiModelConfig(modelConfig), [modelConfig]);
- const form = useForm<UpdateModelArg['body']>({
- defaultValues: modelConfig,
+ const form = useForm<ModelEditFormValues>({
+ defaultValues: modelConfig as unknown as ModelEditFormValues,
mode: 'onChange',
});
- const onSubmit = useCallback<SubmitHandler<UpdateModelArg['body']>>(
+ const externalModes = useWatch({
+ control: form.control,
+ name: 'capabilities.modes',
+ }) as ExternalModelCapabilities['modes'] | undefined;
+
+ const modeSet = useMemo(() => new Set(externalModes ?? []), [externalModes]);
+
+ const toggleMode = useCallback(
+ (mode: ExternalModelCapabilities['modes'][number]) => {
+ const nextModes = modeSet.has(mode)
+ ? externalModes?.filter((value) => value !== mode)
+ : [...(externalModes ?? []), mode];
+ form.setValue('capabilities.modes', nextModes ?? [], { shouldDirty: true, shouldValidate: true });
+ },
+ [externalModes, form, modeSet]
+ );
+
+ const handleToggleTxt2Img = useCallback(() => toggleMode('txt2img'), [toggleMode]);
+ const handleToggleImg2Img = useCallback(() => toggleMode('img2img'), [toggleMode]);
+ const handleToggleInpaint = useCallback(() => toggleMode('inpaint'), [toggleMode]);
+
+ const parseOptionalNumber = useCallback((value: string | null | undefined) => {
+ if (value === null || value === undefined || value === '') {
+ return null;
+ }
+ if (typeof value !== 'string') {
+ return Number.isNaN(Number(value)) ? null : Number(value);
+ }
+ if (value.trim() === '') {
+ return null;
+ }
+ const parsed = Number(value);
+ return Number.isNaN(parsed) ? null : parsed;
+ }, []);
+
+ const onSubmit = useCallback<SubmitHandler<ModelEditFormValues>>(
(values) => {
const responseBody: UpdateModelArg = {
key: modelConfig.key,
- body: values,
+ body: values as UpdateModelBody,
};
-
updateModel(responseBody)
.unwrap()
.then((payload) => {
@@ -133,19 +181,19 @@ export const ModelEdit = memo(({ modelConfig }: Props) => {
<SimpleGrid columns={2} gap={4}>
<FormControl flexDir="column" alignItems="flex-start" gap={1}>
<FormLabel>{t('modelManager.modelType')}</FormLabel>
- <ModelTypeSelect control={form.control} />
+ <ModelTypeSelect control={form.control as unknown as Control<UpdateModelBody>} />
</FormControl>
<FormControl flexDir="column" alignItems="flex-start" gap={1}>
<FormLabel>{t('modelManager.modelFormat')}</FormLabel>
- <ModelFormatSelect control={form.control} />
+ <ModelFormatSelect control={form.control as unknown as Control<UpdateModelBody>} />
</FormControl>
<FormControl flexDir="column" alignItems="flex-start" gap={1}>
<FormLabel>{t('modelManager.baseModel')}</FormLabel>
- <BaseModelSelect control={form.control} />
+ <BaseModelSelect control={form.control as unknown as Control<UpdateModelBody>} />
</FormControl>
<FormControl flexDir="column" alignItems="flex-start" gap={1}>
<FormLabel>{t('modelManager.variant')}</FormLabel>
- <ModelVariantSelect control={form.control} />
+ <ModelVariantSelect control={form.control as unknown as Control<UpdateModelBody>} />
</FormControl>
<FormControl flexDir="column" alignItems="flex-start" gap={1}>
<FormLabel>{t('modelManager.pathToConfig')}</FormLabel>
@@ -153,13 +201,143 @@ export const ModelEdit = memo(({ modelConfig }: Props) => {
</FormControl>
<FormControl flexDir="column" alignItems="flex-start" gap={1}>
<FormLabel>{t('modelManager.predictionType')}</FormLabel>
- <PredictionTypeSelect control={form.control} />
+ <PredictionTypeSelect control={form.control as unknown as Control<UpdateModelBody>} />
</FormControl>
<FormControl flexDir="column" alignItems="flex-start" gap={1}>
<FormLabel>{t('modelManager.upcastAttention')}</FormLabel>
<Checkbox {...form.register('upcast_attention')} />
</FormControl>
</SimpleGrid>
+ {isExternal && (
+ <>
+ <Heading as="h3" fontSize="md" mt="4">
+ {t('modelManager.externalProvider')}
+ </Heading>
+ <SimpleGrid columns={2} gap={4}>
+ <FormControl flexDir="column" alignItems="flex-start" gap={1}>
+ <FormLabel>{t('modelManager.providerId')}</FormLabel>
+ <Input {...form.register('provider_id', stringFieldOptions)} size="md" />
+ </FormControl>
+ <FormControl flexDir="column" alignItems="flex-start" gap={1}>
+ <FormLabel>{t('modelManager.providerModelId')}</FormLabel>
+ <Input {...form.register('provider_model_id', stringFieldOptions)} size="md" />
+ </FormControl>
+ </SimpleGrid>
+ <Heading as="h3" fontSize="md" mt="4">
+ {t('modelManager.externalCapabilities')}
+ </Heading>
+ <SimpleGrid columns={2} gap={4}>
+ <FormControl flexDir="column" alignItems="flex-start" gap={1}>
+ <FormLabel>{t('modelManager.supportedModes')}</FormLabel>
+ <Flex gap={3} wrap="wrap">
+ <Checkbox isChecked={modeSet.has('txt2img')} onChange={handleToggleTxt2Img}>
+ txt2img
+ </Checkbox>
+ <Checkbox isChecked={modeSet.has('img2img')} onChange={handleToggleImg2Img}>
+ img2img
+ </Checkbox>
+ <Checkbox isChecked={modeSet.has('inpaint')} onChange={handleToggleInpaint}>
+ inpaint
+ </Checkbox>
+ </Flex>
+ </FormControl>
+ <FormControl flexDir="column" alignItems="flex-start" gap={1}>
+ <FormLabel>{t('modelManager.supportsReferenceImages')}</FormLabel>
+ <Checkbox {...form.register('capabilities.supports_reference_images')} />
+ </FormControl>
+ <FormControl flexDir="column" alignItems="flex-start" gap={1}>
+ <FormLabel>{t('modelManager.supportsSeed')}</FormLabel>
+ <Checkbox {...form.register('capabilities.supports_seed')} />
+ </FormControl>
+ <FormControl flexDir="column" alignItems="flex-start" gap={1}>
+ <FormLabel>{t('modelManager.maxImagesPerRequest')}</FormLabel>
+ <Input
+ type="number"
+ {...form.register('capabilities.max_images_per_request', {
+ setValueAs: parseOptionalNumber,
+ })}
+ />
+ </FormControl>
+ <FormControl flexDir="column" alignItems="flex-start" gap={1}>
+ <FormLabel>{t('modelManager.maxReferenceImages')}</FormLabel>
+ <Input
+ type="number"
+ {...form.register('capabilities.max_reference_images', {
+ setValueAs: parseOptionalNumber,
+ })}
+ />
+ </FormControl>
+ <FormControl flexDir="column" alignItems="flex-start" gap={1}>
+ <FormLabel>{t('modelManager.maxImageWidth')}</FormLabel>
+ <Input
+ type="number"
+ {...form.register('capabilities.max_image_size.width', {
+ setValueAs: parseOptionalNumber,
+ })}
+ />
+ </FormControl>
+ <FormControl flexDir="column" alignItems="flex-start" gap={1}>
+ <FormLabel>{t('modelManager.maxImageHeight')}</FormLabel>
+ <Input
+ type="number"
+ {...form.register('capabilities.max_image_size.height', {
+ setValueAs: parseOptionalNumber,
+ })}
+ />
+ </FormControl>
+ </SimpleGrid>
+ <Heading as="h3" fontSize="md" mt="4">
+ {t('modelManager.externalDefaults')}
+ </Heading>
+ <SimpleGrid columns={2} gap={4}>
+ <FormControl flexDir="column" alignItems="flex-start" gap={1}>
+ <FormLabel>{t('modelManager.width')}</FormLabel>
+ <Input
+ type="number"
+ {...form.register('default_settings.width', {
+ setValueAs: parseOptionalNumber,
+ })}
+ />
+ </FormControl>
+ <FormControl flexDir="column" alignItems="flex-start" gap={1}>
+ <FormLabel>{t('modelManager.height')}</FormLabel>
+ <Input
+ type="number"
+ {...form.register('default_settings.height', {
+ setValueAs: parseOptionalNumber,
+ })}
+ />
+ </FormControl>
+ <FormControl flexDir="column" alignItems="flex-start" gap={1}>
+ <FormLabel>{t('parameters.steps')}</FormLabel>
+ <Input
+ type="number"
+ {...form.register('default_settings.steps', {
+ setValueAs: parseOptionalNumber,
+ })}
+ />
+ </FormControl>
+ <FormControl flexDir="column" alignItems="flex-start" gap={1}>
+ <FormLabel>{t('parameters.guidance')}</FormLabel>
+ <Input
+ type="number"
+ {...form.register('default_settings.guidance', {
+ setValueAs: parseOptionalNumber,
+ })}
+ />
+ </FormControl>
+ <FormControl flexDir="column" alignItems="flex-start" gap={1}>
+ <FormLabel>{t('modelManager.numImages')}</FormLabel>
+ <Input
+ type="number"
+ {...form.register('default_settings.num_images', {
+ setValueAs: parseOptionalNumber,
+ })}
+ />
+ </FormControl>
+ </SimpleGrid>
+ </>
+ )}
</Flex>
</form>
</Flex>
diff --git a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/ModelFooter.tsx b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/ModelFooter.tsx
index f31609c401..38135972e2 100644
--- a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/ModelFooter.tsx
+++ b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/ModelFooter.tsx
@@ -1,7 +1,7 @@
import { Flex, Heading, type SystemStyleObject } from '@invoke-ai/ui-library';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
-import type { AnyModelConfig } from 'services/api/types';
+import type { AnyModelConfigWithExternal } from 'services/api/types';
import { ModelConvertButton } from './ModelConvertButton';
import { ModelDeleteButton } from './ModelDeleteButton';
@@ -20,7 +20,7 @@ const footerRowSx: SystemStyleObject = {
};
type Props = {
- modelConfig: AnyModelConfig;
+ modelConfig: AnyModelConfigWithExternal;
isEditing: boolean;
};
diff --git a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/ModelHeader.tsx b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/ModelHeader.tsx
index 1c1a05dbd0..2d6827ee6c 100644
--- a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/ModelHeader.tsx
+++ b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/ModelHeader.tsx
@@ -4,10 +4,10 @@ import ModelImageUpload from 'features/modelManagerV2/subpanels/ModelPanel/Field
import type { PropsWithChildren } from 'react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
-import type { AnyModelConfig } from 'services/api/types';
+import type { AnyModelConfigWithExternal } from 'services/api/types';
type Props = PropsWithChildren<{
- modelConfig: AnyModelConfig;
+ modelConfig: AnyModelConfigWithExternal;
}>;
export const ModelHeader = memo(({ modelConfig, children }: Props) => {
diff --git a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/ModelReidentifyButton.tsx b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/ModelReidentifyButton.tsx
index 31334c0510..6136c71f98 100644
--- a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/ModelReidentifyButton.tsx
+++ b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/ModelReidentifyButton.tsx
@@ -4,15 +4,18 @@ import { memo, useCallback } from 'react';
import { useTranslation } from 'react-i18next';
import { PiSparkleFill } from 'react-icons/pi';
import { useReidentifyModelMutation } from 'services/api/endpoints/models';
-import type { AnyModelConfig } from 'services/api/types';
+import { type AnyModelConfigWithExternal, isExternalApiModelConfig } from 'services/api/types';
+
+import { isExternalModel } from './isExternalModel';
interface Props {
- modelConfig: AnyModelConfig;
+ modelConfig: AnyModelConfigWithExternal;
}
export const ModelReidentifyButton = memo(({ modelConfig }: Props) => {
const { t } = useTranslation();
const [reidentifyModel, { isLoading }] = useReidentifyModelMutation();
+ const isExternal = isExternalApiModelConfig(modelConfig) || isExternalModel(modelConfig.path);
const onClick = useCallback(() => {
reidentifyModel({ key: modelConfig.key })
@@ -40,6 +43,10 @@ export const ModelReidentifyButton = memo(({ modelConfig }: Props) => {
});
}, [modelConfig.key, reidentifyModel, t]);
+ if (isExternal) {
+ return null;
+ }
+
return (
<Button
onClick={onClick}
diff --git a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/ModelSettingsExportButton.tsx b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/ModelSettingsExportButton.tsx
index c5f2ae0a0b..66aeda4551 100644
--- a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/ModelSettingsExportButton.tsx
+++ b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/ModelSettingsExportButton.tsx
@@ -3,13 +3,13 @@ import { toast } from 'features/toast/toast';
import { memo, useCallback, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { PiDownloadSimpleBold } from 'react-icons/pi';
-import type { AnyModelConfig } from 'services/api/types';
+import type { AnyModelConfigWithExternal } from 'services/api/types';
type Props = {
- modelConfig: AnyModelConfig;
+ modelConfig: AnyModelConfigWithExternal;
};
-const buildExportData = (modelConfig: AnyModelConfig): Record<string, unknown> => {
+const buildExportData = (modelConfig: AnyModelConfigWithExternal): Record<string, unknown> => {
const data: Record<string, unknown> = {};
if (
diff --git a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/ModelSettingsImportButton.tsx b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/ModelSettingsImportButton.tsx
index 474afcd74e..eeaaabbe73 100644
--- a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/ModelSettingsImportButton.tsx
+++ b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/ModelSettingsImportButton.tsx
@@ -5,7 +5,7 @@ import { memo, useCallback, useRef } from 'react';
import { useTranslation } from 'react-i18next';
import { PiUploadSimpleBold } from 'react-icons/pi';
import { useUpdateModelMutation } from 'services/api/endpoints/models';
-import type { AnyModelConfig } from 'services/api/types';
+import type { AnyModelConfigWithExternal } from 'services/api/types';
const validateImportData = (data: unknown): data is Record<string, unknown> => {
if (typeof data !== 'object' || data === null || Array.isArray(data)) {
@@ -40,7 +40,7 @@ const validateImportData = (data: unknown): data is Record<string, unknown> => {
};
type Props = {
- modelConfig: AnyModelConfig;
+ modelConfig: AnyModelConfigWithExternal;
};
export const ModelSettingsImportButton = memo(({ modelConfig }: Props) => {
diff --git a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/ModelUpdatePathButton.tsx b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/ModelUpdatePathButton.tsx
index fa6c5b02d7..80cf4569d0 100644
--- a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/ModelUpdatePathButton.tsx
+++ b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/ModelUpdatePathButton.tsx
@@ -22,10 +22,10 @@ import { memo, useCallback, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { PiFolderOpenFill } from 'react-icons/pi';
import { useUpdateModelMutation } from 'services/api/endpoints/models';
-import type { AnyModelConfig } from 'services/api/types';
+import type { AnyModelConfigWithExternal } from 'services/api/types';
interface Props {
- modelConfig: AnyModelConfig;
+ modelConfig: AnyModelConfigWithExternal;
}
export const ModelUpdatePathButton = memo(({ modelConfig }: Props) => {
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 f29846e6f8..d29d330fac 100644
--- a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/ModelView.tsx
+++ b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/ModelView.tsx
@@ -12,14 +12,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,
- CLIPEmbedModelConfig,
- CLIPVisionModelConfig,
- LlavaOnevisionModelConfig,
- Qwen3EncoderModelConfig,
- SigLIPModelConfig,
- T5EncoderModelConfig,
+import {
+ type AnyModelConfigWithExternal,
+ type CLIPEmbedModelConfig,
+ type CLIPVisionModelConfig,
+ isExternalApiModelConfig,
+ type LlavaOnevisionModelConfig,
+ type Qwen3EncoderModelConfig,
+ type SigLIPModelConfig,
+ type T5EncoderModelConfig,
} from 'services/api/types';
import { isExternalModel } from './isExternalModel';
@@ -38,7 +39,7 @@ type EncoderModelConfig =
| SigLIPModelConfig
| LlavaOnevisionModelConfig;
-const isEncoderModel = (modelConfig: AnyModelConfig): modelConfig is EncoderModelConfig => {
+const isEncoderModel = (modelConfig: AnyModelConfigWithExternal): modelConfig is EncoderModelConfig => {
return (
modelConfig.type === 'clip_embed' ||
modelConfig.type === 't5_encoder' ||
@@ -50,7 +51,7 @@ const isEncoderModel = (modelConfig: AnyModelConfig): modelConfig is EncoderMode
};
type Props = {
- modelConfig: AnyModelConfig;
+ modelConfig: AnyModelConfigWithExternal;
};
export const ModelView = memo(({ modelConfig }: Props) => {
@@ -104,6 +105,12 @@ export const ModelView = memo(({ modelConfig }: Props) => {
<ModelAttrView label={t('modelManager.modelFormat')} value={modelConfig.format} />
<ModelAttrView label={t('modelManager.path')} value={modelConfig.path} />
<ModelAttrView label={t('modelManager.fileSize')} value={filesize(modelConfig.file_size)} />
+ {isExternalApiModelConfig(modelConfig) && (
+ <>
+ <ModelAttrView label={t('modelManager.providerId')} value={modelConfig.provider_id} />
+ <ModelAttrView label={t('modelManager.providerModelId')} value={modelConfig.provider_model_id} />
+ </>
+ )}
{'variant' in modelConfig && modelConfig.variant && (
<ModelAttrView label={t('modelManager.variant')} value={modelConfig.variant} />
)}
diff --git a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/RelatedModels.tsx b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/RelatedModels.tsx
index 5cb024c8e7..e4b81b0a49 100644
--- a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/RelatedModels.tsx
+++ b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/RelatedModels.tsx
@@ -31,10 +31,10 @@ import {
useRemoveModelRelationshipMutation,
} from 'services/api/endpoints/modelRelationships';
import { useGetModelConfigsQuery } from 'services/api/endpoints/models';
-import type { AnyModelConfig } from 'services/api/types';
+import type { AnyModelConfig, AnyModelConfigWithExternal } from 'services/api/types';
type Props = {
- modelConfig: AnyModelConfig;
+ modelConfig: AnyModelConfigWithExternal;
};
type ModelGroup = {
@@ -52,7 +52,10 @@ type ModelGroup = {
//
// TODO: In the future, refine this logic to more strictly validate
// relationships based on model types or actual usage patterns.
-const isBaseCompatible = (a: AnyModelConfig, b: AnyModelConfig): boolean => {
+const isBaseCompatible = (a: AnyModelConfigWithExternal, b: AnyModelConfig): boolean => {
+ if (a.base === 'external') {
+ return false;
+ }
if (a.base === 'any' || b.base === 'any') {
return true;
}
diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/ModelIdentifierFieldInputComponent.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/ModelIdentifierFieldInputComponent.tsx
index ca215d0725..0b1d2fa88c 100644
--- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/ModelIdentifierFieldInputComponent.tsx
+++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/ModelIdentifierFieldInputComponent.tsx
@@ -36,7 +36,7 @@ const ModelIdentifierFieldInputComponent = (props: Props) => {
return EMPTY_ARRAY;
}
- if (!fieldTemplate.ui_model_base && !fieldTemplate.ui_model_type) {
+ if (!fieldTemplate.ui_model_base && !fieldTemplate.ui_model_type && !fieldTemplate.ui_model_provider_id) {
return modelConfigsAdapterSelectors.selectAll(data);
}
@@ -58,6 +58,12 @@ const ModelIdentifierFieldInputComponent = (props: Props) => {
if (fieldTemplate.ui_model_format && !fieldTemplate.ui_model_format.includes(config.format)) {
return false;
}
+ if (
+ fieldTemplate.ui_model_provider_id &&
+ (!('provider_id' in config) || !fieldTemplate.ui_model_provider_id.includes(config.provider_id as string))
+ ) {
+ return false;
+ }
return true;
});
}, [data, fieldTemplate]);
diff --git a/invokeai/frontend/web/src/features/nodes/types/common.ts b/invokeai/frontend/web/src/features/nodes/types/common.ts
index 7c1ac67f68..75c3415cef 100644
--- a/invokeai/frontend/web/src/features/nodes/types/common.ts
+++ b/invokeai/frontend/web/src/features/nodes/types/common.ts
@@ -97,6 +97,7 @@ export const zBaseModelType = z.enum([
'cogview4',
'qwen-image',
'z-image',
+ 'external',
'anima',
'unknown',
]);
@@ -133,6 +134,7 @@ export const zModelType = z.enum([
'clip_embed',
'siglip',
'flux_redux',
+ 'external_image_generator',
'unknown',
]);
export type ModelType = z.infer<typeof zModelType>;
@@ -184,6 +186,7 @@ export const zModelFormat = z.enum([
'bnb_quantized_int8b',
'bnb_quantized_nf4b',
'gguf_quantized',
+ 'external_api',
'unknown',
]);
export type ModelFormat = z.infer<typeof zModelFormat>;
@@ -197,6 +200,17 @@ export const zModelIdentifierField = z.object({
submodel_type: zSubModelType.nullish(),
});
export type ModelIdentifierField = z.infer<typeof zModelIdentifierField>;
+
+// Frontend-only identifier for external API models (not part of the backend schema)
+export const zExternalModelIdentifierField = z.object({
+ key: z.string().min(1),
+ hash: z.string().min(1),
+ name: z.string().min(1),
+ base: z.literal('external'),
+ type: z.literal('external_image_generator'),
+ submodel_type: zSubModelType.nullish(),
+});
+
// #endregion
// #region Control Adapters
diff --git a/invokeai/frontend/web/src/features/nodes/types/field.ts b/invokeai/frontend/web/src/features/nodes/types/field.ts
index 98b20912ab..ffd87ae398 100644
--- a/invokeai/frontend/web/src/features/nodes/types/field.ts
+++ b/invokeai/frontend/web/src/features/nodes/types/field.ts
@@ -75,6 +75,7 @@ const zFieldInputTemplateBase = zFieldTemplateBase.extend({
ui_model_type: z.array(zModelType).nullish(),
ui_model_variant: z.array(zAnyModelVariant).nullish(),
ui_model_format: z.array(zModelFormat).nullish(),
+ ui_model_provider_id: z.array(z.string()).nullish(),
});
const zFieldOutputTemplateBase = zFieldTemplateBase.extend({
fieldKind: z.literal('output'),
diff --git a/invokeai/frontend/web/src/features/nodes/util/graph/generation/buildExternalGraph.test.ts b/invokeai/frontend/web/src/features/nodes/util/graph/generation/buildExternalGraph.test.ts
new file mode 100644
index 0000000000..f1fa54b4e0
--- /dev/null
+++ b/invokeai/frontend/web/src/features/nodes/util/graph/generation/buildExternalGraph.test.ts
@@ -0,0 +1,201 @@
+import type { RootState } from 'app/store/store';
+import type { ParamsState, RefImagesState } from 'features/controlLayers/store/types';
+import { imageDTOToCroppableImage, initialIPAdapter } from 'features/controlLayers/store/util';
+import type {
+ ExternalApiModelConfig,
+ ExternalApiModelDefaultSettings,
+ ExternalImageSize,
+ ExternalModelCapabilities,
+ ExternalModelPanelSchema,
+ ImageDTO,
+} from 'services/api/types';
+import { beforeEach, describe, expect, it, vi } from 'vitest';
+
+import { buildExternalGraph } from './buildExternalGraph';
+
+const createExternalModel = (overrides: Partial<ExternalApiModelConfig> = {}): ExternalApiModelConfig => {
+ const maxImageSize: ExternalImageSize = { width: 1024, height: 1024 };
+ const defaultSettings: ExternalApiModelDefaultSettings = { width: 1024, height: 1024 };
+ const capabilities: ExternalModelCapabilities = {
+ modes: ['txt2img'],
+ supports_reference_images: true,
+ supports_seed: true,
+ max_image_size: maxImageSize,
+ };
+
+ return {
+ key: 'external-test',
+ hash: 'external:openai:gpt-image-1',
+ path: 'external://openai/gpt-image-1',
+ file_size: 0,
+ name: 'External Test',
+ description: null,
+ source: 'external://openai/gpt-image-1',
+ source_type: 'url',
+ source_api_response: null,
+ cover_image: null,
+ base: 'external',
+ type: 'external_image_generator',
+ format: 'external_api',
+ provider_id: 'openai',
+ provider_model_id: 'gpt-image-1',
+ capabilities,
+ default_settings: defaultSettings,
+ panel_schema: undefined,
+ tags: ['external'],
+ is_default: false,
+ ...overrides,
+ };
+};
+
+let mockModelConfig: ExternalApiModelConfig | null = null;
+let mockParams: ParamsState;
+let mockRefImages: RefImagesState;
+let mockSizes: { scaledSize: { width: number; height: number } };
+
+const mockOutputFields = {
+ id: 'external_output',
+ use_cache: false,
+ is_intermediate: false,
+ board: undefined,
+};
+
+vi.mock('features/controlLayers/store/paramsSlice', () => ({
+ selectModelConfig: () => mockModelConfig,
+ selectParamsSlice: () => mockParams,
+}));
+
+vi.mock('features/controlLayers/store/refImagesSlice', () => ({
+ selectRefImagesSlice: () => mockRefImages,
+}));
+
+vi.mock('features/nodes/util/graph/graphBuilderUtils', () => ({
+ getOriginalAndScaledSizesForTextToImage: () => mockSizes,
+ getOriginalAndScaledSizesForOtherModes: () => ({
+ scaledSize: { width: 512, height: 512 },
+ rect: { x: 0, y: 0, width: 512, height: 512 },
+ }),
+ selectCanvasOutputFields: () => mockOutputFields,
+}));
+
+beforeEach(() => {
+ mockParams = {
+ steps: 20,
+ guidance: 4.5,
+ dimensions: { width: 768, height: 512, aspectRatio: { id: '3:2', value: 1.5, isLocked: true } },
+ } as ParamsState;
+ mockSizes = { scaledSize: { width: 768, height: 512 } };
+
+ const imageDTO = { image_name: 'ref.png', width: 64, height: 64 } as ImageDTO;
+ mockRefImages = {
+ selectedEntityId: null,
+ isPanelOpen: false,
+ entities: [
+ {
+ id: 'ref-image-1',
+ isEnabled: true,
+ config: {
+ ...initialIPAdapter,
+ weight: 0.5,
+ image: imageDTOToCroppableImage(imageDTO),
+ },
+ },
+ ],
+ };
+});
+
+describe('buildExternalGraph', () => {
+ it('builds txt2img graph with reference images and seed', async () => {
+ const modelConfig = createExternalModel();
+ mockModelConfig = modelConfig;
+
+ const { g } = await buildExternalGraph({
+ generationMode: 'txt2img',
+ state: {} as RootState,
+ manager: null,
+ });
+ const graph = g.getGraph();
+ const externalNode = Object.values(graph.nodes).find((node) => node.type === 'openai_image_generation') as
+ | Record<string, unknown>
+ | undefined;
+
+ expect(externalNode).toBeDefined();
+ expect(externalNode?.type).toBe('openai_image_generation');
+ expect(externalNode?.mode).toBe('txt2img');
+ expect(externalNode?.width).toBe(768);
+ expect(externalNode?.height).toBe(512);
+ expect((externalNode?.reference_images as Array<{ image_name: string }> | undefined)?.[0]).toEqual({
+ image_name: 'ref.png',
+ });
+
+ const seedEdge = graph.edges.find((edge) => edge.destination.field === 'seed');
+ expect(seedEdge).toBeDefined();
+ });
+
+ it('prefers panel schema over capabilities when building node inputs', async () => {
+ const panelSchema: ExternalModelPanelSchema = {
+ prompts: [{ name: 'reference_images' }],
+ image: [{ name: 'dimensions' }],
+ generation: [],
+ };
+ mockModelConfig = createExternalModel({
+ panel_schema: panelSchema,
+ });
+
+ const { g } = await buildExternalGraph({
+ generationMode: 'txt2img',
+ state: {} as RootState,
+ manager: null,
+ });
+ const graph = g.getGraph();
+ const externalNode = Object.values(graph.nodes).find((node) => node.type === 'openai_image_generation') as
+ | Record<string, unknown>
+ | undefined;
+
+ expect((externalNode?.reference_images as Array<{ image_name: string }> | undefined)?.[0]).toEqual({
+ image_name: 'ref.png',
+ });
+
+ const seedEdge = graph.edges.find((edge) => edge.destination.field === 'seed');
+ expect(seedEdge).toBeUndefined();
+ });
+
+ it('uses provider-specific node types', async () => {
+ mockModelConfig = createExternalModel({
+ provider_id: 'gemini',
+ provider_model_id: 'gemini-2.5-flash-image',
+ path: 'external://gemini/gemini-2.5-flash-image',
+ source: 'external://gemini/gemini-2.5-flash-image',
+ hash: 'external:gemini:gemini-2.5-flash-image',
+ });
+
+ const { g } = await buildExternalGraph({
+ generationMode: 'txt2img',
+ state: {} as RootState,
+ manager: null,
+ });
+
+ const graph = g.getGraph();
+ const externalNode = Object.values(graph.nodes).find((node) => node.type === 'gemini_image_generation');
+
+ expect(externalNode).toBeDefined();
+ expect(externalNode?.type).toBe('gemini_image_generation');
+ });
+
+ it('throws when mode is unsupported', async () => {
+ const modelConfig = createExternalModel({
+ capabilities: {
+ modes: ['img2img'],
+ },
+ });
+ mockModelConfig = modelConfig;
+
+ await expect(
+ buildExternalGraph({
+ generationMode: 'txt2img',
+ state: {} as RootState,
+ manager: null,
+ })
+ ).rejects.toThrow('does not support txt2img');
+ });
+});
diff --git a/invokeai/frontend/web/src/features/nodes/util/graph/generation/buildExternalGraph.ts b/invokeai/frontend/web/src/features/nodes/util/graph/generation/buildExternalGraph.ts
new file mode 100644
index 0000000000..7397e650a3
--- /dev/null
+++ b/invokeai/frontend/web/src/features/nodes/util/graph/generation/buildExternalGraph.ts
@@ -0,0 +1,165 @@
+import { getPrefixedId } from 'features/controlLayers/konva/util';
+import { selectCanvasSettingsSlice } from 'features/controlLayers/store/canvasSettingsSlice';
+import { selectModelConfig, selectParamsSlice } from 'features/controlLayers/store/paramsSlice';
+import { selectRefImagesSlice } from 'features/controlLayers/store/refImagesSlice';
+import { type ModelIdentifierField, zImageField, zModelIdentifierField } from 'features/nodes/types/common';
+import { Graph } from 'features/nodes/util/graph/generation/Graph';
+import {
+ getOriginalAndScaledSizesForOtherModes,
+ selectCanvasOutputFields,
+} from 'features/nodes/util/graph/graphBuilderUtils';
+import {
+ type GraphBuilderArg,
+ type GraphBuilderReturn,
+ UnsupportedGenerationModeError,
+} from 'features/nodes/util/graph/types';
+import { hasExternalPanelControl } from 'features/parameters/util/externalPanelSchema';
+import {
+ type AnyInvocation,
+ type AnyModelConfigWithExternal,
+ type Invocation,
+ isExternalApiModelConfig,
+} from 'services/api/types';
+import { assert } from 'tsafe';
+
+const EXTERNAL_PROVIDER_NODE_TYPES = {
+ gemini: 'gemini_image_generation',
+ openai: 'openai_image_generation',
+} as const;
+
+export const buildExternalGraph = async (arg: GraphBuilderArg): Promise<GraphBuilderReturn> => {
+ const { generationMode, state, manager } = arg;
+
+ const modelConfig = selectModelConfig(state) as AnyModelConfigWithExternal | null;
+ assert(modelConfig, 'No model selected');
+ assert(isExternalApiModelConfig(modelConfig), 'Selected model is not an external API model');
+ const model = modelConfig;
+
+ if (generationMode === 'outpaint') {
+ throw new UnsupportedGenerationModeError('Outpainting is not supported for external API models.');
+ }
+ const requestedMode = generationMode;
+ if (!model.capabilities.modes.includes(requestedMode)) {
+ throw new UnsupportedGenerationModeError(`${model.name} does not support ${requestedMode} mode`);
+ }
+
+ const params = selectParamsSlice(state);
+ const refImages = selectRefImagesSlice(state);
+
+ const g = new Graph(getPrefixedId('external_graph'));
+ const supportsSeed = hasExternalPanelControl(model, 'image', 'seed');
+ const supportsReferenceImages = hasExternalPanelControl(model, 'prompts', 'reference_images');
+
+ const seed = supportsSeed
+ ? g.addNode({
+ id: getPrefixedId('seed'),
+ type: 'integer',
+ })
+ : null;
+
+ const positivePrompt = g.addNode({
+ id: getPrefixedId('positive_prompt'),
+ type: 'string',
+ });
+
+ const externalNodeType = EXTERNAL_PROVIDER_NODE_TYPES[model.provider_id as keyof typeof EXTERNAL_PROVIDER_NODE_TYPES];
+ assert(externalNodeType, `No invocation node registered for external provider '${model.provider_id}'`);
+ const externalNode: Record<string, unknown> = {
+ id: getPrefixedId(externalNodeType),
+ type: externalNodeType,
+ model: model as unknown as ModelIdentifierField,
+ mode: requestedMode,
+ image_size: params.imageSize ?? null,
+ num_images: 1,
+ };
+
+ // Provider-specific options
+ if (model.provider_id === 'openai') {
+ externalNode.quality = params.openaiQuality;
+ externalNode.background = params.openaiBackground;
+ if (params.openaiInputFidelity) {
+ externalNode.input_fidelity = params.openaiInputFidelity;
+ }
+ } else if (model.provider_id === 'gemini') {
+ if (params.geminiTemperature !== null) {
+ externalNode.temperature = params.geminiTemperature;
+ }
+ }
+ const externalInvocation = g.addNode(externalNode as AnyInvocation);
+
+ if (seed) {
+ g.addEdgeFromObj({
+ source: { node_id: seed.id, field: 'value' },
+ destination: { node_id: externalNode.id as string, field: 'seed' },
+ });
+ }
+ g.addEdgeFromObj({
+ source: { node_id: positivePrompt.id, field: 'value' },
+ destination: { node_id: externalNode.id as string, field: 'prompt' },
+ });
+
+ if (supportsReferenceImages) {
+ const referenceImages = refImages.entities
+ .filter((entity) => entity.isEnabled)
+ .map((entity) => entity.config)
+ .filter((config) => config.image)
+ .map((config) => zImageField.parse(config.image?.crop?.image ?? config.image?.original.image));
+
+ if (referenceImages.length > 0) {
+ externalNode.reference_images = referenceImages;
+ }
+ }
+
+ // External models require specific dimensions matching their supported presets.
+ // Always use params dimensions (from selected preset) for the API width/height.
+ externalNode.width = params.dimensions.width;
+ externalNode.height = params.dimensions.height;
+
+ if (generationMode !== 'txt2img') {
+ assert(manager, 'Canvas manager is required for img2img/inpaint');
+ const canvasSettings = selectCanvasSettingsSlice(state);
+ const { rect } = getOriginalAndScaledSizesForOtherModes(state);
+
+ const rasterAdapters = manager.compositor.getVisibleAdaptersOfType('raster_layer');
+ const initImage = await manager.compositor.getCompositeImageDTO(rasterAdapters, rect, {
+ is_intermediate: true,
+ silent: true,
+ });
+ externalNode.init_image = { image_name: initImage.image_name };
+
+ if (generationMode === 'inpaint') {
+ const inpaintMaskAdapters = manager.compositor.getVisibleAdaptersOfType('inpaint_mask');
+ const maskImage = await manager.compositor.getGrayscaleMaskCompositeImageDTO(
+ inpaintMaskAdapters,
+ rect,
+ 'denoiseLimit',
+ canvasSettings.preserveMask,
+ {
+ is_intermediate: true,
+ silent: true,
+ }
+ );
+ externalNode.mask_image = { image_name: maskImage.image_name };
+ }
+ }
+
+ g.updateNode(externalNode as AnyInvocation, selectCanvasOutputFields(state));
+
+ g.upsertMetadata({
+ model: zModelIdentifierField.parse(model),
+ width: externalNode.width as number,
+ height: externalNode.height as number,
+ });
+ g.addEdgeToMetadata(positivePrompt as Invocation<'string'>, 'value', 'positive_prompt');
+ if (seed) {
+ g.addEdgeToMetadata(seed, 'value', 'seed');
+ }
+
+ g.setMetadataReceivingNode(externalInvocation);
+
+ return {
+ g,
+ seed: seed ?? undefined,
+ positivePrompt: positivePrompt as Invocation<'string'>,
+ };
+};
diff --git a/invokeai/frontend/web/src/features/nodes/util/graph/generation/buildZImageGraph.ts b/invokeai/frontend/web/src/features/nodes/util/graph/generation/buildZImageGraph.ts
index 54a241c196..8d83378c8d 100644
--- a/invokeai/frontend/web/src/features/nodes/util/graph/generation/buildZImageGraph.ts
+++ b/invokeai/frontend/web/src/features/nodes/util/graph/generation/buildZImageGraph.ts
@@ -13,6 +13,7 @@ import {
} from 'features/controlLayers/store/paramsSlice';
import { selectCanvasMetadata, selectCanvasSlice } from 'features/controlLayers/store/selectors';
import { fetchModelConfigWithTypeGuard } from 'features/metadata/util/modelFetchingHelpers';
+import type { ModelIdentifierField } from 'features/nodes/types/common';
import { addZImageControl } from 'features/nodes/util/graph/generation/addControlAdapters';
import { addImageToImage } from 'features/nodes/util/graph/generation/addImageToImage';
import { addInpaint } from 'features/nodes/util/graph/generation/addInpaint';
@@ -77,7 +78,7 @@ export const buildZImageGraph = async (arg: GraphBuilderArg): Promise<GraphBuild
model,
vae_model: zImageVaeModel ?? undefined,
qwen3_encoder_model: zImageQwen3EncoderModel ?? undefined,
- qwen3_source_model: zImageQwen3SourceModel ?? undefined,
+ qwen3_source_model: (zImageQwen3SourceModel as ModelIdentifierField | null) ?? undefined,
});
const positivePrompt = g.addNode({
diff --git a/invokeai/frontend/web/src/features/nodes/util/schema/buildFieldInputTemplate.ts b/invokeai/frontend/web/src/features/nodes/util/schema/buildFieldInputTemplate.ts
index 27a0b21a7c..adaa3f413c 100644
--- a/invokeai/frontend/web/src/features/nodes/util/schema/buildFieldInputTemplate.ts
+++ b/invokeai/frontend/web/src/features/nodes/util/schema/buildFieldInputTemplate.ts
@@ -499,6 +499,7 @@ export const buildFieldInputTemplate = (
ui_model_type,
ui_model_variant,
ui_model_format,
+ ui_model_provider_id,
} = fieldSchema;
// This is the base field template that is common to all fields. The builder function will add all other
@@ -519,6 +520,7 @@ export const buildFieldInputTemplate = (
ui_model_type,
ui_model_variant,
ui_model_format,
+ ui_model_provider_id,
};
if (isStatefulFieldType(fieldType)) {
diff --git a/invokeai/frontend/web/src/features/parameters/components/Advanced/ParamClipSkip.tsx b/invokeai/frontend/web/src/features/parameters/components/Advanced/ParamClipSkip.tsx
index 10cc8b0d98..a35d34e80c 100644
--- a/invokeai/frontend/web/src/features/parameters/components/Advanced/ParamClipSkip.tsx
+++ b/invokeai/frontend/web/src/features/parameters/components/Advanced/ParamClipSkip.tsx
@@ -2,6 +2,7 @@ import { CompositeNumberInput, CompositeSlider, FormControl, FormLabel } from '@
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
import { InformationalPopover } from 'common/components/InformationalPopover/InformationalPopover';
import { selectCLIPSkip, selectModel, setClipSkip } from 'features/controlLayers/store/paramsSlice';
+import type { BaseModelType } from 'features/nodes/types/common';
import { CLIP_SKIP_MAP } from 'features/parameters/types/constants';
import { memo, useCallback, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
@@ -32,14 +33,14 @@ const ParamClipSkip = () => {
if (!model) {
return CLIP_SKIP_MAP['sd-1']?.maxClip;
}
- return CLIP_SKIP_MAP[model.base]?.maxClip;
+ return CLIP_SKIP_MAP[model.base as BaseModelType]?.maxClip;
}, [model]);
const sliderMarks = useMemo(() => {
if (!model) {
return CLIP_SKIP_MAP['sd-1']?.markers;
}
- return CLIP_SKIP_MAP[model.base]?.markers;
+ return CLIP_SKIP_MAP[model.base as BaseModelType]?.markers;
}, [model]);
if (model?.base === 'sdxl') {
diff --git a/invokeai/frontend/web/src/features/parameters/components/Advanced/ParamZImageQwen3VaeModelSelect.tsx b/invokeai/frontend/web/src/features/parameters/components/Advanced/ParamZImageQwen3VaeModelSelect.tsx
index fff7698979..9159a1ede0 100644
--- a/invokeai/frontend/web/src/features/parameters/components/Advanced/ParamZImageQwen3VaeModelSelect.tsx
+++ b/invokeai/frontend/web/src/features/parameters/components/Advanced/ParamZImageQwen3VaeModelSelect.tsx
@@ -9,7 +9,7 @@ import {
zImageQwen3SourceModelSelected,
zImageVaeModelSelected,
} from 'features/controlLayers/store/paramsSlice';
-import { zModelIdentifierField } from 'features/nodes/types/common';
+import { type ModelIdentifierField, zModelIdentifierField } from 'features/nodes/types/common';
import { memo, useCallback } from 'react';
import { useTranslation } from 'react-i18next';
import { useFlux1VAEModels, useQwen3EncoderModels, useZImageDiffusersModels } from 'services/api/hooks/modelsByType';
@@ -136,7 +136,7 @@ const ParamZImageQwen3SourceModelSelect = memo(() => {
const { options, value, onChange, noOptionsMessage } = useModelCombobox({
modelConfigs,
onChange: _onChange,
- selectedModel: zImageQwen3SourceModel,
+ selectedModel: zImageQwen3SourceModel as ModelIdentifierField | null,
isLoading,
});
diff --git a/invokeai/frontend/web/src/features/parameters/components/Bbox/BboxAspectRatioSelect.test.tsx b/invokeai/frontend/web/src/features/parameters/components/Bbox/BboxAspectRatioSelect.test.tsx
new file mode 100644
index 0000000000..8fb4e81b59
--- /dev/null
+++ b/invokeai/frontend/web/src/features/parameters/components/Bbox/BboxAspectRatioSelect.test.tsx
@@ -0,0 +1,42 @@
+import type { ExternalApiModelConfig } from 'services/api/types';
+import { describe, expect, test } from 'vitest';
+
+const createExternalModel = (overrides: Partial<ExternalApiModelConfig> = {}): ExternalApiModelConfig => ({
+ key: 'external-test',
+ name: 'External Test',
+ base: 'external',
+ type: 'external_image_generator',
+ format: 'external_api',
+ provider_id: 'gemini',
+ provider_model_id: 'gemini-2.5-flash-image',
+ description: 'Test model',
+ source: 'external://gemini/gemini-2.5-flash-image',
+ source_type: 'url',
+ source_api_response: null,
+ path: '',
+ file_size: 0,
+ hash: 'external:gemini:gemini-2.5-flash-image',
+ cover_image: null,
+ is_default: false,
+ tags: ['external'],
+ capabilities: {
+ modes: ['txt2img'],
+ supports_reference_images: false,
+ supports_seed: true,
+ max_images_per_request: 1,
+ max_image_size: null,
+ allowed_aspect_ratios: ['1:1', '16:9'],
+ max_reference_images: null,
+ mask_format: 'none',
+ input_image_required_for: null,
+ },
+ default_settings: null,
+ ...overrides,
+});
+
+describe('external model aspect ratios (bbox)', () => {
+ test('uses allowed aspect ratios for external models', () => {
+ const model = createExternalModel();
+ expect(model.capabilities.allowed_aspect_ratios).toEqual(['1:1', '16:9']);
+ });
+});
diff --git a/invokeai/frontend/web/src/features/parameters/components/Bbox/BboxAspectRatioSelect.tsx b/invokeai/frontend/web/src/features/parameters/components/Bbox/BboxAspectRatioSelect.tsx
index a237896c67..e9ba385c2b 100644
--- a/invokeai/frontend/web/src/features/parameters/components/Bbox/BboxAspectRatioSelect.tsx
+++ b/invokeai/frontend/web/src/features/parameters/components/Bbox/BboxAspectRatioSelect.tsx
@@ -3,10 +3,16 @@ import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
import { InformationalPopover } from 'common/components/InformationalPopover/InformationalPopover';
import { bboxAspectRatioIdChanged } from 'features/controlLayers/store/canvasSlice';
import { useCanvasIsStaging } from 'features/controlLayers/store/canvasStagingAreaSlice';
+import {
+ aspectRatioIdChanged,
+ selectAllowedAspectRatioIDs,
+ selectAspectRatioSizes,
+ selectHasFixedDimensionSizes,
+} from 'features/controlLayers/store/paramsSlice';
import { selectAspectRatioID } from 'features/controlLayers/store/selectors';
import { isAspectRatioID, zAspectRatioID } from 'features/controlLayers/store/types';
import type { ChangeEventHandler } from 'react';
-import { memo, useCallback } from 'react';
+import { memo, useCallback, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { PiCaretDownBold } from 'react-icons/pi';
@@ -15,24 +21,33 @@ export const BboxAspectRatioSelect = memo(() => {
const dispatch = useAppDispatch();
const id = useAppSelector(selectAspectRatioID);
const isStaging = useCanvasIsStaging();
+ const allowedAspectRatios = useAppSelector(selectAllowedAspectRatioIDs);
+ const aspectRatioSizes = useAppSelector(selectAspectRatioSizes);
+ const hasFixedSizes = useAppSelector(selectHasFixedDimensionSizes);
+ const options = useMemo(() => allowedAspectRatios ?? zAspectRatioID.options, [allowedAspectRatios]);
const onChange = useCallback<ChangeEventHandler<HTMLSelectElement>>(
(e) => {
if (!isAspectRatioID(e.target.value)) {
return;
}
- dispatch(bboxAspectRatioIdChanged({ id: e.target.value }));
+ const fixedSize = aspectRatioSizes?.[e.target.value] ?? undefined;
+ dispatch(bboxAspectRatioIdChanged({ id: e.target.value, fixedSize }));
+ // For external models with fixed sizes, also sync to params so buildExternalGraph uses correct dimensions
+ if (fixedSize) {
+ dispatch(aspectRatioIdChanged({ id: e.target.value, fixedSize }));
+ }
},
- [dispatch]
+ [dispatch, aspectRatioSizes]
);
return (
- <FormControl isDisabled={isStaging}>
+ <FormControl isDisabled={isStaging || hasFixedSizes}>
<InformationalPopover feature="paramAspect">
<FormLabel>{t('parameters.aspect')}</FormLabel>
</InformationalPopover>
<Select size="sm" value={id} onChange={onChange} cursor="pointer" iconSize="0.75rem" icon={<PiCaretDownBold />}>
- {zAspectRatioID.options.map((ratio) => (
+ {options.map((ratio) => (
<option key={ratio} value={ratio}>
{ratio}
</option>
diff --git a/invokeai/frontend/web/src/features/parameters/components/Bbox/BboxSwapDimensionsButton.tsx b/invokeai/frontend/web/src/features/parameters/components/Bbox/BboxSwapDimensionsButton.tsx
index 54614419a5..372f8187ea 100644
--- a/invokeai/frontend/web/src/features/parameters/components/Bbox/BboxSwapDimensionsButton.tsx
+++ b/invokeai/frontend/web/src/features/parameters/components/Bbox/BboxSwapDimensionsButton.tsx
@@ -1,7 +1,8 @@
import { IconButton } from '@invoke-ai/ui-library';
-import { useAppDispatch } from 'app/store/storeHooks';
+import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
import { bboxDimensionsSwapped } from 'features/controlLayers/store/canvasSlice';
import { useCanvasIsStaging } from 'features/controlLayers/store/canvasStagingAreaSlice';
+import { selectHasFixedDimensionSizes } from 'features/controlLayers/store/paramsSlice';
import { memo, useCallback } from 'react';
import { useTranslation } from 'react-i18next';
import { PiArrowsDownUpBold } from 'react-icons/pi';
@@ -10,6 +11,7 @@ export const BboxSwapDimensionsButton = memo(() => {
const { t } = useTranslation();
const dispatch = useAppDispatch();
const isStaging = useCanvasIsStaging();
+ const hasFixedSizes = useAppSelector(selectHasFixedDimensionSizes);
const onClick = useCallback(() => {
dispatch(bboxDimensionsSwapped());
}, [dispatch]);
@@ -21,7 +23,7 @@ export const BboxSwapDimensionsButton = memo(() => {
variant="ghost"
size="sm"
icon={<PiArrowsDownUpBold />}
- isDisabled={isStaging}
+ isDisabled={isStaging || hasFixedSizes}
/>
);
});
diff --git a/invokeai/frontend/web/src/features/parameters/components/Bbox/use-is-bbox-size-locked.ts b/invokeai/frontend/web/src/features/parameters/components/Bbox/use-is-bbox-size-locked.ts
index eaf1381108..18f453708e 100644
--- a/invokeai/frontend/web/src/features/parameters/components/Bbox/use-is-bbox-size-locked.ts
+++ b/invokeai/frontend/web/src/features/parameters/components/Bbox/use-is-bbox-size-locked.ts
@@ -1,6 +1,9 @@
+import { useAppSelector } from 'app/store/storeHooks';
import { useCanvasIsStaging } from 'features/controlLayers/store/canvasStagingAreaSlice';
+import { selectHasFixedDimensionSizes } from 'features/controlLayers/store/paramsSlice';
export const useIsBboxSizeLocked = () => {
const isStaging = useCanvasIsStaging();
- return isStaging;
+ const hasFixedSizes = useAppSelector(selectHasFixedDimensionSizes);
+ return isStaging || hasFixedSizes;
};
diff --git a/invokeai/frontend/web/src/features/parameters/components/Dimensions/DimensionsAspectRatioSelect.test.tsx b/invokeai/frontend/web/src/features/parameters/components/Dimensions/DimensionsAspectRatioSelect.test.tsx
new file mode 100644
index 0000000000..0651c47863
--- /dev/null
+++ b/invokeai/frontend/web/src/features/parameters/components/Dimensions/DimensionsAspectRatioSelect.test.tsx
@@ -0,0 +1,42 @@
+import type { ExternalApiModelConfig } from 'services/api/types';
+import { describe, expect, test } from 'vitest';
+
+const createExternalModel = (overrides: Partial<ExternalApiModelConfig> = {}): ExternalApiModelConfig => ({
+ key: 'external-test',
+ name: 'External Test',
+ base: 'external',
+ type: 'external_image_generator',
+ format: 'external_api',
+ provider_id: 'gemini',
+ provider_model_id: 'gemini-2.5-flash-image',
+ description: 'Test model',
+ source: 'external://gemini/gemini-2.5-flash-image',
+ source_type: 'url',
+ source_api_response: null,
+ path: '',
+ file_size: 0,
+ hash: 'external:gemini:gemini-2.5-flash-image',
+ cover_image: null,
+ is_default: false,
+ tags: ['external'],
+ capabilities: {
+ modes: ['txt2img'],
+ supports_reference_images: false,
+ supports_seed: true,
+ max_images_per_request: 1,
+ max_image_size: null,
+ allowed_aspect_ratios: ['1:1', '16:9'],
+ max_reference_images: null,
+ mask_format: 'none',
+ input_image_required_for: null,
+ },
+ default_settings: null,
+ ...overrides,
+});
+
+describe('external model aspect ratios', () => {
+ test('uses allowed aspect ratios for external models', () => {
+ const model = createExternalModel();
+ expect(model.capabilities.allowed_aspect_ratios).toEqual(['1:1', '16:9']);
+ });
+});
diff --git a/invokeai/frontend/web/src/features/parameters/components/Dimensions/DimensionsAspectRatioSelect.tsx b/invokeai/frontend/web/src/features/parameters/components/Dimensions/DimensionsAspectRatioSelect.tsx
index 4d3edc6e4b..5beb1231b0 100644
--- a/invokeai/frontend/web/src/features/parameters/components/Dimensions/DimensionsAspectRatioSelect.tsx
+++ b/invokeai/frontend/web/src/features/parameters/components/Dimensions/DimensionsAspectRatioSelect.tsx
@@ -1,7 +1,12 @@
import { FormControl, FormLabel, Select } from '@invoke-ai/ui-library';
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
import { InformationalPopover } from 'common/components/InformationalPopover/InformationalPopover';
-import { aspectRatioIdChanged, selectAspectRatioID } from 'features/controlLayers/store/paramsSlice';
+import {
+ aspectRatioIdChanged,
+ selectAllowedAspectRatioIDs,
+ selectAspectRatioID,
+ selectAspectRatioSizes,
+} from 'features/controlLayers/store/paramsSlice';
import { isAspectRatioID, zAspectRatioID } from 'features/controlLayers/store/types';
import type { ChangeEventHandler } from 'react';
import { memo, useCallback } from 'react';
@@ -12,15 +17,19 @@ export const DimensionsAspectRatioSelect = memo(() => {
const { t } = useTranslation();
const dispatch = useAppDispatch();
const id = useAppSelector(selectAspectRatioID);
+ const allowedAspectRatios = useAppSelector(selectAllowedAspectRatioIDs);
+ const aspectRatioSizes = useAppSelector(selectAspectRatioSizes);
+ const options = allowedAspectRatios ?? zAspectRatioID.options;
const onChange = useCallback<ChangeEventHandler<HTMLSelectElement>>(
(e) => {
if (!isAspectRatioID(e.target.value)) {
return;
}
- dispatch(aspectRatioIdChanged({ id: e.target.value }));
+ const fixedSize = aspectRatioSizes?.[e.target.value] ?? undefined;
+ dispatch(aspectRatioIdChanged({ id: e.target.value, fixedSize }));
},
- [dispatch]
+ [dispatch, aspectRatioSizes]
);
return (
@@ -29,7 +38,7 @@ export const DimensionsAspectRatioSelect = memo(() => {
<FormLabel>{t('parameters.aspect')}</FormLabel>
</InformationalPopover>
<Select size="sm" value={id} onChange={onChange} cursor="pointer" iconSize="0.75rem" icon={<PiCaretDownBold />}>
- {zAspectRatioID.options.map((ratio) => (
+ {options.map((ratio) => (
<option key={ratio} value={ratio}>
{ratio}
</option>
diff --git a/invokeai/frontend/web/src/features/parameters/components/Dimensions/DimensionsHeight.tsx b/invokeai/frontend/web/src/features/parameters/components/Dimensions/DimensionsHeight.tsx
index 924187c1ed..81e8101462 100644
--- a/invokeai/frontend/web/src/features/parameters/components/Dimensions/DimensionsHeight.tsx
+++ b/invokeai/frontend/web/src/features/parameters/components/Dimensions/DimensionsHeight.tsx
@@ -1,7 +1,7 @@
import { CompositeNumberInput, CompositeSlider, FormControl, FormLabel } from '@invoke-ai/ui-library';
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
import { InformationalPopover } from 'common/components/InformationalPopover/InformationalPopover';
-import { heightChanged, selectHeight } from 'features/controlLayers/store/paramsSlice';
+import { heightChanged, selectHasFixedDimensionSizes, selectHeight } from 'features/controlLayers/store/paramsSlice';
import { selectGridSize, selectOptimalDimension } from 'features/controlLayers/store/selectors';
import { memo, useCallback, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
@@ -22,6 +22,7 @@ export const DimensionsHeight = memo(() => {
const optimalDimension = useAppSelector(selectOptimalDimension);
const height = useAppSelector(selectHeight);
const gridSize = useAppSelector(selectGridSize);
+ const hasFixedSizes = useAppSelector(selectHasFixedDimensionSizes);
const onChange = useCallback(
(v: number) => {
@@ -33,7 +34,7 @@ export const DimensionsHeight = memo(() => {
const marks = useMemo(() => [CONSTRAINTS.sliderMin, optimalDimension, CONSTRAINTS.sliderMax], [optimalDimension]);
return (
- <FormControl>
+ <FormControl isDisabled={hasFixedSizes}>
<InformationalPopover feature="paramHeight">
<FormLabel>{t('parameters.height')}</FormLabel>
</InformationalPopover>
diff --git a/invokeai/frontend/web/src/features/parameters/components/Dimensions/DimensionsLockAspectRatioButton.tsx b/invokeai/frontend/web/src/features/parameters/components/Dimensions/DimensionsLockAspectRatioButton.tsx
index 6ab17147a7..e3e2c6d59e 100644
--- a/invokeai/frontend/web/src/features/parameters/components/Dimensions/DimensionsLockAspectRatioButton.tsx
+++ b/invokeai/frontend/web/src/features/parameters/components/Dimensions/DimensionsLockAspectRatioButton.tsx
@@ -1,6 +1,10 @@
import { IconButton } from '@invoke-ai/ui-library';
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
-import { aspectRatioLockToggled, selectAspectRatioIsLocked } from 'features/controlLayers/store/paramsSlice';
+import {
+ aspectRatioLockToggled,
+ selectAspectRatioIsLocked,
+ selectHasFixedDimensionSizes,
+} from 'features/controlLayers/store/paramsSlice';
import { memo, useCallback } from 'react';
import { useTranslation } from 'react-i18next';
import { PiLockSimpleFill, PiLockSimpleOpenBold } from 'react-icons/pi';
@@ -9,6 +13,7 @@ export const DimensionsLockAspectRatioButton = memo(() => {
const { t } = useTranslation();
const dispatch = useAppDispatch();
const isLocked = useAppSelector(selectAspectRatioIsLocked);
+ const hasFixedSizes = useAppSelector(selectHasFixedDimensionSizes);
const onClick = useCallback(() => {
dispatch(aspectRatioLockToggled());
@@ -22,6 +27,7 @@ export const DimensionsLockAspectRatioButton = memo(() => {
variant={isLocked ? 'outline' : 'ghost'}
size="sm"
icon={isLocked ? <PiLockSimpleFill /> : <PiLockSimpleOpenBold />}
+ isDisabled={hasFixedSizes}
/>
);
});
diff --git a/invokeai/frontend/web/src/features/parameters/components/Dimensions/DimensionsSetOptimalSizeButton.tsx b/invokeai/frontend/web/src/features/parameters/components/Dimensions/DimensionsSetOptimalSizeButton.tsx
index c1c43f0cec..90f6262c5a 100644
--- a/invokeai/frontend/web/src/features/parameters/components/Dimensions/DimensionsSetOptimalSizeButton.tsx
+++ b/invokeai/frontend/web/src/features/parameters/components/Dimensions/DimensionsSetOptimalSizeButton.tsx
@@ -1,6 +1,11 @@
import { IconButton } from '@invoke-ai/ui-library';
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
-import { selectHeight, selectWidth, sizeOptimized } from 'features/controlLayers/store/paramsSlice';
+import {
+ selectHasFixedDimensionSizes,
+ selectHeight,
+ selectWidth,
+ sizeOptimized,
+} from 'features/controlLayers/store/paramsSlice';
import { selectOptimalDimension } from 'features/controlLayers/store/selectors';
import { getIsSizeTooLarge, getIsSizeTooSmall } from 'features/parameters/util/optimalDimension';
import { memo, useCallback, useMemo } from 'react';
@@ -13,6 +18,7 @@ export const DimensionsSetOptimalSizeButton = memo(() => {
const width = useAppSelector(selectWidth);
const height = useAppSelector(selectHeight);
const optimalDimension = useAppSelector(selectOptimalDimension);
+ const hasFixedSizes = useAppSelector(selectHasFixedDimensionSizes);
const isSizeTooSmall = useMemo(
() => getIsSizeTooSmall(width, height, optimalDimension),
[height, width, optimalDimension]
@@ -43,6 +49,7 @@ export const DimensionsSetOptimalSizeButton = memo(() => {
size="sm"
icon={<PiSparkleFill />}
colorScheme={isSizeTooSmall || isSizeTooLarge ? 'warning' : 'base'}
+ isDisabled={hasFixedSizes}
/>
);
});
diff --git a/invokeai/frontend/web/src/features/parameters/components/Dimensions/DimensionsSwapButton.tsx b/invokeai/frontend/web/src/features/parameters/components/Dimensions/DimensionsSwapButton.tsx
index 817a81996f..1b5923cddf 100644
--- a/invokeai/frontend/web/src/features/parameters/components/Dimensions/DimensionsSwapButton.tsx
+++ b/invokeai/frontend/web/src/features/parameters/components/Dimensions/DimensionsSwapButton.tsx
@@ -1,6 +1,6 @@
import { IconButton } from '@invoke-ai/ui-library';
-import { useAppDispatch } from 'app/store/storeHooks';
-import { dimensionsSwapped } from 'features/controlLayers/store/paramsSlice';
+import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
+import { dimensionsSwapped, selectHasFixedDimensionSizes } from 'features/controlLayers/store/paramsSlice';
import { memo, useCallback } from 'react';
import { useTranslation } from 'react-i18next';
import { PiArrowsDownUpBold } from 'react-icons/pi';
@@ -8,6 +8,7 @@ import { PiArrowsDownUpBold } from 'react-icons/pi';
export const DimensionsSwapButton = memo(() => {
const { t } = useTranslation();
const dispatch = useAppDispatch();
+ const hasFixedSizes = useAppSelector(selectHasFixedDimensionSizes);
const onClick = useCallback(() => {
dispatch(dimensionsSwapped());
}, [dispatch]);
@@ -19,6 +20,7 @@ export const DimensionsSwapButton = memo(() => {
variant="ghost"
size="sm"
icon={<PiArrowsDownUpBold />}
+ isDisabled={hasFixedSizes}
/>
);
});
diff --git a/invokeai/frontend/web/src/features/parameters/components/Dimensions/DimensionsWidth.tsx b/invokeai/frontend/web/src/features/parameters/components/Dimensions/DimensionsWidth.tsx
index 20a754c5c3..c70a786c89 100644
--- a/invokeai/frontend/web/src/features/parameters/components/Dimensions/DimensionsWidth.tsx
+++ b/invokeai/frontend/web/src/features/parameters/components/Dimensions/DimensionsWidth.tsx
@@ -1,7 +1,7 @@
import { CompositeNumberInput, CompositeSlider, FormControl, FormLabel } from '@invoke-ai/ui-library';
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
import { InformationalPopover } from 'common/components/InformationalPopover/InformationalPopover';
-import { selectWidth, widthChanged } from 'features/controlLayers/store/paramsSlice';
+import { selectHasFixedDimensionSizes, selectWidth, widthChanged } from 'features/controlLayers/store/paramsSlice';
import { selectGridSize, selectOptimalDimension } from 'features/controlLayers/store/selectors';
import { memo, useCallback, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
@@ -22,6 +22,7 @@ export const DimensionsWidth = memo(() => {
const width = useAppSelector(selectWidth);
const optimalDimension = useAppSelector(selectOptimalDimension);
const gridSize = useAppSelector(selectGridSize);
+ const hasFixedSizes = useAppSelector(selectHasFixedDimensionSizes);
const onChange = useCallback(
(v: number) => {
@@ -33,7 +34,7 @@ export const DimensionsWidth = memo(() => {
const marks = useMemo(() => [CONSTRAINTS.sliderMin, optimalDimension, CONSTRAINTS.sliderMax], [optimalDimension]);
return (
- <FormControl>
+ <FormControl isDisabled={hasFixedSizes}>
<InformationalPopover feature="paramWidth">
<FormLabel>{t('parameters.width')}</FormLabel>
</InformationalPopover>
diff --git a/invokeai/frontend/web/src/features/parameters/components/Dimensions/ExternalModelImageSizeSelect.tsx b/invokeai/frontend/web/src/features/parameters/components/Dimensions/ExternalModelImageSizeSelect.tsx
new file mode 100644
index 0000000000..0ad995cf72
--- /dev/null
+++ b/invokeai/frontend/web/src/features/parameters/components/Dimensions/ExternalModelImageSizeSelect.tsx
@@ -0,0 +1,94 @@
+import { FormControl, FormLabel, Select } from '@invoke-ai/ui-library';
+import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
+import {
+ resolutionPresetSelected,
+ selectAspectRatioID,
+ selectImageSize,
+ selectResolutionPresets,
+} from 'features/controlLayers/store/paramsSlice';
+import type { ChangeEventHandler } from 'react';
+import { memo, useCallback, useMemo } from 'react';
+import { useTranslation } from 'react-i18next';
+import { PiCaretDownBold } from 'react-icons/pi';
+
+const makeKey = (aspectRatio: string, imageSize: string) => `${aspectRatio}|${imageSize}`;
+
+export const ExternalModelImageSizeSelect = memo(() => {
+ const { t } = useTranslation();
+ const dispatch = useAppDispatch();
+ const presets = useAppSelector(selectResolutionPresets);
+ const currentAspectRatio = useAppSelector(selectAspectRatioID);
+ const currentImageSize = useAppSelector(selectImageSize);
+
+ const presetMap = useMemo(() => {
+ if (!presets) {
+ return null;
+ }
+ const map = new Map<string, (typeof presets)[number]>();
+ for (const preset of presets) {
+ map.set(makeKey(preset.aspect_ratio, preset.image_size), preset);
+ }
+ return map;
+ }, [presets]);
+
+ const selectedKey = useMemo(() => {
+ if (!presets || presets.length === 0) {
+ return '';
+ }
+ if (currentImageSize && currentAspectRatio) {
+ const key = makeKey(currentAspectRatio, currentImageSize);
+ if (presetMap?.has(key)) {
+ return key;
+ }
+ }
+ // Fallback to first preset
+ return makeKey(presets[0]!.aspect_ratio, presets[0]!.image_size);
+ }, [presets, presetMap, currentAspectRatio, currentImageSize]);
+
+ const onChange = useCallback<ChangeEventHandler<HTMLSelectElement>>(
+ (e) => {
+ const preset = presetMap?.get(e.target.value);
+ if (!preset) {
+ return;
+ }
+ dispatch(
+ resolutionPresetSelected({
+ imageSize: preset.image_size,
+ aspectRatio: preset.aspect_ratio,
+ width: preset.width,
+ height: preset.height,
+ })
+ );
+ },
+ [dispatch, presetMap]
+ );
+
+ if (!presets || presets.length === 0) {
+ return null;
+ }
+
+ return (
+ <FormControl>
+ <FormLabel>{t('parameters.resolution')}</FormLabel>
+ <Select
+ size="sm"
+ value={selectedKey}
+ onChange={onChange}
+ cursor="pointer"
+ iconSize="0.75rem"
+ icon={<PiCaretDownBold />}
+ >
+ {presets.map((preset) => {
+ const key = makeKey(preset.aspect_ratio, preset.image_size);
+ return (
+ <option key={key} value={key}>
+ {preset.label}
+ </option>
+ );
+ })}
+ </Select>
+ </FormControl>
+ );
+});
+
+ExternalModelImageSizeSelect.displayName = 'ExternalModelImageSizeSelect';
diff --git a/invokeai/frontend/web/src/features/parameters/components/Dimensions/ExternalModelResolutionSelect.tsx b/invokeai/frontend/web/src/features/parameters/components/Dimensions/ExternalModelResolutionSelect.tsx
new file mode 100644
index 0000000000..babb4bcdec
--- /dev/null
+++ b/invokeai/frontend/web/src/features/parameters/components/Dimensions/ExternalModelResolutionSelect.tsx
@@ -0,0 +1,68 @@
+import { FormControl, FormLabel, Select } from '@invoke-ai/ui-library';
+import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
+import {
+ aspectRatioIdChanged,
+ selectAspectRatioID,
+ selectAspectRatioSizes,
+} from 'features/controlLayers/store/paramsSlice';
+import { isAspectRatioID } from 'features/controlLayers/store/types';
+import type { ChangeEventHandler } from 'react';
+import { memo, useCallback, useMemo } from 'react';
+import { useTranslation } from 'react-i18next';
+import { PiCaretDownBold } from 'react-icons/pi';
+
+export const ExternalModelResolutionSelect = memo(() => {
+ const { t } = useTranslation();
+ const dispatch = useAppDispatch();
+ const aspectRatioID = useAppSelector(selectAspectRatioID);
+ const aspectRatioSizes = useAppSelector(selectAspectRatioSizes);
+
+ const options = useMemo(() => {
+ if (!aspectRatioSizes) {
+ return [];
+ }
+ return Object.entries(aspectRatioSizes).map(([ratio, size]) => ({
+ ratio,
+ label: `${ratio} (${size.width}×${size.height})`,
+ size,
+ }));
+ }, [aspectRatioSizes]);
+
+ const onChange = useCallback<ChangeEventHandler<HTMLSelectElement>>(
+ (e) => {
+ const ratio = e.target.value;
+ if (!isAspectRatioID(ratio)) {
+ return;
+ }
+ const fixedSize = aspectRatioSizes?.[ratio] ?? undefined;
+ dispatch(aspectRatioIdChanged({ id: ratio, fixedSize }));
+ },
+ [dispatch, aspectRatioSizes]
+ );
+
+ if (!aspectRatioSizes) {
+ return null;
+ }
+
+ return (
+ <FormControl>
+ <FormLabel>{t('parameters.resolution')}</FormLabel>
+ <Select
+ size="sm"
+ value={aspectRatioID}
+ onChange={onChange}
+ cursor="pointer"
+ iconSize="0.75rem"
+ icon={<PiCaretDownBold />}
+ >
+ {options.map(({ ratio, label }) => (
+ <option key={ratio} value={ratio}>
+ {label}
+ </option>
+ ))}
+ </Select>
+ </FormControl>
+ );
+});
+
+ExternalModelResolutionSelect.displayName = 'ExternalModelResolutionSelect';
diff --git a/invokeai/frontend/web/src/features/parameters/components/External/GeminiProviderOptions.tsx b/invokeai/frontend/web/src/features/parameters/components/External/GeminiProviderOptions.tsx
new file mode 100644
index 0000000000..0ed380ff34
--- /dev/null
+++ b/invokeai/frontend/web/src/features/parameters/components/External/GeminiProviderOptions.tsx
@@ -0,0 +1,42 @@
+import { CompositeNumberInput, CompositeSlider, FormControl, FormLabel } from '@invoke-ai/ui-library';
+import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
+import { geminiTemperatureChanged, selectGeminiTemperature } from 'features/controlLayers/store/paramsSlice';
+import { memo, useCallback } from 'react';
+import { useTranslation } from 'react-i18next';
+
+const TEMPERATURE_MARKS = [0, 1, 2];
+
+export const GeminiProviderOptions = memo(() => {
+ const { t } = useTranslation();
+ const dispatch = useAppDispatch();
+ const temperature = useAppSelector(selectGeminiTemperature);
+
+ const onTemperatureChange = useCallback((v: number) => dispatch(geminiTemperatureChanged(v)), [dispatch]);
+
+ return (
+ <FormControl>
+ <FormLabel>{t('parameters.temperature', 'Temperature')}</FormLabel>
+ <CompositeSlider
+ value={temperature ?? 1}
+ defaultValue={1}
+ min={0}
+ max={2}
+ step={0.1}
+ fineStep={0.05}
+ onChange={onTemperatureChange}
+ marks={TEMPERATURE_MARKS}
+ />
+ <CompositeNumberInput
+ value={temperature ?? 1}
+ defaultValue={1}
+ min={0}
+ max={2}
+ step={0.1}
+ fineStep={0.05}
+ onChange={onTemperatureChange}
+ />
+ </FormControl>
+ );
+});
+
+GeminiProviderOptions.displayName = 'GeminiProviderOptions';
diff --git a/invokeai/frontend/web/src/features/parameters/components/External/OpenAIProviderOptions.tsx b/invokeai/frontend/web/src/features/parameters/components/External/OpenAIProviderOptions.tsx
new file mode 100644
index 0000000000..f4eba05d84
--- /dev/null
+++ b/invokeai/frontend/web/src/features/parameters/components/External/OpenAIProviderOptions.tsx
@@ -0,0 +1,84 @@
+import { FormControl, FormLabel, Select } from '@invoke-ai/ui-library';
+import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
+import {
+ openaiBackgroundChanged,
+ openaiInputFidelityChanged,
+ openaiQualityChanged,
+ selectOpenaiBackground,
+ selectOpenaiInputFidelity,
+ selectOpenaiQuality,
+} from 'features/controlLayers/store/paramsSlice';
+import type { ChangeEventHandler } from 'react';
+import { memo, useCallback } from 'react';
+import { useTranslation } from 'react-i18next';
+import { PiCaretDownBold } from 'react-icons/pi';
+
+export const OpenAIProviderOptions = memo(() => {
+ const { t } = useTranslation();
+ const dispatch = useAppDispatch();
+ const quality = useAppSelector(selectOpenaiQuality);
+ const background = useAppSelector(selectOpenaiBackground);
+ const inputFidelity = useAppSelector(selectOpenaiInputFidelity);
+
+ const onQualityChange = useCallback<ChangeEventHandler<HTMLSelectElement>>(
+ (e) => dispatch(openaiQualityChanged(e.target.value as 'auto' | 'high' | 'medium' | 'low')),
+ [dispatch]
+ );
+
+ const onBackgroundChange = useCallback<ChangeEventHandler<HTMLSelectElement>>(
+ (e) => dispatch(openaiBackgroundChanged(e.target.value as 'auto' | 'transparent' | 'opaque')),
+ [dispatch]
+ );
+
+ const onInputFidelityChange = useCallback<ChangeEventHandler<HTMLSelectElement>>(
+ (e) => {
+ const value = e.target.value;
+ dispatch(openaiInputFidelityChanged(value === '' ? null : (value as 'low' | 'high')));
+ },
+ [dispatch]
+ );
+
+ return (
+ <>
+ <FormControl>
+ <FormLabel>{t('parameters.quality', 'Quality')}</FormLabel>
+ <Select size="sm" value={quality} onChange={onQualityChange} icon={<PiCaretDownBold />} iconSize="0.75rem">
+ <option value="auto">Auto</option>
+ <option value="high">High</option>
+ <option value="medium">Medium</option>
+ <option value="low">Low</option>
+ </Select>
+ </FormControl>
+ <FormControl>
+ <FormLabel>{t('parameters.background', 'Background')}</FormLabel>
+ <Select
+ size="sm"
+ value={background}
+ onChange={onBackgroundChange}
+ icon={<PiCaretDownBold />}
+ iconSize="0.75rem"
+ >
+ <option value="auto">Auto</option>
+ <option value="transparent">Transparent</option>
+ <option value="opaque">Opaque</option>
+ </Select>
+ </FormControl>
+ <FormControl>
+ <FormLabel>{t('parameters.inputFidelity', 'Input Fidelity')}</FormLabel>
+ <Select
+ size="sm"
+ value={inputFidelity ?? ''}
+ onChange={onInputFidelityChange}
+ icon={<PiCaretDownBold />}
+ iconSize="0.75rem"
+ >
+ <option value="">Default</option>
+ <option value="low">Low</option>
+ <option value="high">High</option>
+ </Select>
+ </FormControl>
+ </>
+ );
+});
+
+OpenAIProviderOptions.displayName = 'OpenAIProviderOptions';
diff --git a/invokeai/frontend/web/src/features/parameters/components/MainModel/mainModelPickerUtils.test.ts b/invokeai/frontend/web/src/features/parameters/components/MainModel/mainModelPickerUtils.test.ts
new file mode 100644
index 0000000000..7d72b529c2
--- /dev/null
+++ b/invokeai/frontend/web/src/features/parameters/components/MainModel/mainModelPickerUtils.test.ts
@@ -0,0 +1,60 @@
+import type {
+ ExternalApiModelConfig,
+ ExternalApiModelDefaultSettings,
+ ExternalImageSize,
+ ExternalModelCapabilities,
+} from 'services/api/types';
+import { describe, expect, it } from 'vitest';
+
+import { isExternalModelUnsupportedForTab } from './mainModelPickerUtils';
+
+const createExternalConfig = (modes: ExternalModelCapabilities['modes']): ExternalApiModelConfig => {
+ const maxImageSize: ExternalImageSize = { width: 1024, height: 1024 };
+ const defaultSettings: ExternalApiModelDefaultSettings = { width: 1024, height: 1024, steps: 30 };
+
+ return {
+ key: 'external-test',
+ hash: 'external:openai:gpt-image-1',
+ path: 'external://openai/gpt-image-1',
+ file_size: 0,
+ name: 'External Test',
+ description: null,
+ source: 'external://openai/gpt-image-1',
+ source_type: 'url',
+ source_api_response: null,
+ cover_image: null,
+ base: 'external',
+ type: 'external_image_generator',
+ format: 'external_api',
+ provider_id: 'openai',
+ provider_model_id: 'gpt-image-1',
+ capabilities: {
+ modes,
+ supports_reference_images: false,
+ max_image_size: maxImageSize,
+ },
+ default_settings: defaultSettings,
+ tags: ['external'],
+ is_default: false,
+ };
+};
+
+describe('isExternalModelUnsupportedForTab', () => {
+ it('disables external models without txt2img for generate', () => {
+ const model = createExternalConfig(['img2img', 'inpaint']);
+
+ expect(isExternalModelUnsupportedForTab(model, 'generate')).toBe(true);
+ });
+
+ it('allows external models with txt2img for generate', () => {
+ const model = createExternalConfig(['txt2img']);
+
+ expect(isExternalModelUnsupportedForTab(model, 'generate')).toBe(false);
+ });
+
+ it('allows external models on canvas', () => {
+ const model = createExternalConfig(['inpaint']);
+
+ expect(isExternalModelUnsupportedForTab(model, 'canvas')).toBe(false);
+ });
+});
diff --git a/invokeai/frontend/web/src/features/parameters/components/MainModel/mainModelPickerUtils.ts b/invokeai/frontend/web/src/features/parameters/components/MainModel/mainModelPickerUtils.ts
new file mode 100644
index 0000000000..3c1d83f4bc
--- /dev/null
+++ b/invokeai/frontend/web/src/features/parameters/components/MainModel/mainModelPickerUtils.ts
@@ -0,0 +1,14 @@
+import type { TabName } from 'features/ui/store/uiTypes';
+import { type AnyModelConfigWithExternal, isExternalApiModelConfig } from 'services/api/types';
+
+export const isExternalModelUnsupportedForTab = (model: AnyModelConfigWithExternal, tab: TabName): boolean => {
+ if (!isExternalApiModelConfig(model)) {
+ return false;
+ }
+
+ if (tab === 'generate') {
+ return !model.capabilities.modes.includes('txt2img');
+ }
+
+ return false;
+};
diff --git a/invokeai/frontend/web/src/features/parameters/components/ModelPicker.tsx b/invokeai/frontend/web/src/features/parameters/components/ModelPicker.tsx
index 7f92df04b1..6ecbf1c4a6 100644
--- a/invokeai/frontend/web/src/features/parameters/components/ModelPicker.tsx
+++ b/invokeai/frontend/web/src/features/parameters/components/ModelPicker.tsx
@@ -1,5 +1,6 @@
import type { BoxProps, ButtonProps, SystemStyleObject } from '@invoke-ai/ui-library';
import {
+ Badge,
Button,
Flex,
Icon,
@@ -36,7 +37,11 @@ import { Trans, useTranslation } from 'react-i18next';
import { PiCaretDownBold, PiLinkSimple } from 'react-icons/pi';
import { useGetSetupStatusQuery } from 'services/api/endpoints/auth';
import { useGetRelatedModelIdsBatchQuery } from 'services/api/endpoints/modelRelationships';
-import type { AnyModelConfig } from 'services/api/types';
+import {
+ type AnyModelConfigWithExternal,
+ type ExternalApiModelConfig,
+ isExternalApiModelConfig,
+} from 'services/api/types';
const selectSelectedModelKeys = createMemoizedSelector(selectParamsSlice, selectLoRAsSlice, (params, loras) => {
const keys: string[] = [];
@@ -67,7 +72,7 @@ const selectSelectedModelKeys = createMemoizedSelector(selectParamsSlice, select
type WithStarred<T> = T & { starred?: boolean };
// Type for models with starred field
-const getOptionId = <T extends AnyModelConfig>(modelConfig: WithStarred<T>) => modelConfig.key;
+const getOptionId = <T extends AnyModelConfigWithExternal>(modelConfig: WithStarred<T>) => modelConfig.key;
const ModelManagerLink = memo((props: ButtonProps) => {
const onClick = useCallback(() => {
@@ -123,19 +128,17 @@ const NoOptionsFallback = memo(({ noOptionsText }: { noOptionsText?: string }) =
});
NoOptionsFallback.displayName = 'NoOptionsFallback';
-const getGroupIDFromModelConfig = (modelConfig: AnyModelConfig): string => {
- return modelConfig.base;
-};
+const getGroupIDFromModelConfig = (modelConfig: AnyModelConfigWithExternal): string => modelConfig.base;
-const getGroupNameFromModelConfig = (modelConfig: AnyModelConfig): string => {
+const getGroupNameFromModelConfig = (modelConfig: AnyModelConfigWithExternal): string => {
return MODEL_BASE_TO_LONG_NAME[modelConfig.base];
};
-const getGroupShortNameFromModelConfig = (modelConfig: AnyModelConfig): string => {
+const getGroupShortNameFromModelConfig = (modelConfig: AnyModelConfigWithExternal): string => {
return MODEL_BASE_TO_SHORT_NAME[modelConfig.base];
};
-const getGroupColorSchemeFromModelConfig = (modelConfig: AnyModelConfig): string => {
+const getGroupColorSchemeFromModelConfig = (modelConfig: AnyModelConfigWithExternal): string => {
return MODEL_BASE_TO_COLOR[modelConfig.base];
};
@@ -162,7 +165,7 @@ const removeStarred = <T,>(obj: WithStarred<T>): T => {
};
export const ModelPicker = typedMemo(
- <T extends AnyModelConfig = AnyModelConfig>({
+ <T extends AnyModelConfigWithExternal = AnyModelConfigWithExternal>({
pickerId,
modelConfigs,
selectedModelConfig,
@@ -414,8 +417,10 @@ const optionNameSx: SystemStyleObject = {
};
const PickerOptionComponent = typedMemo(
- <T extends AnyModelConfig>({ option, ...rest }: { option: WithStarred<T> } & BoxProps) => {
+ <T extends AnyModelConfigWithExternal>({ option, ...rest }: { option: WithStarred<T> } & BoxProps) => {
const { isCompactView } = usePickerContext<WithStarred<T>>();
+ const externalOption = isExternalApiModelConfig(option) ? (option as ExternalApiModelConfig) : null;
+ const providerLabel = externalOption ? externalOption.provider_id.toUpperCase() : null;
return (
<Flex {...rest} sx={optionSx} data-is-compact={isCompactView}>
@@ -426,6 +431,15 @@ const PickerOptionComponent = typedMemo(
<Text className="picker-option" sx={optionNameSx} data-is-compact={isCompactView}>
{option.name}
</Text>
+ {!isCompactView && externalOption && (
+ <Badge
+ colorScheme={MODEL_BASE_TO_COLOR[externalOption.base as BaseModelType]}
+ variant="subtle"
+ flexShrink={0}
+ >
+ {providerLabel}
+ </Badge>
+ )}
<Spacer />
{option.file_size > 0 && (
<Text
@@ -458,11 +472,13 @@ const BASE_KEYWORDS: { [key in BaseModelType]?: string[] } = {
'sd-3': ['sd3', 'sd3.0', 'sd3.5', 'sd-3'],
};
-const isMatch = <T extends AnyModelConfig>(model: WithStarred<T>, searchTerm: string) => {
+const isMatch = <T extends AnyModelConfigWithExternal>(model: WithStarred<T>, searchTerm: string) => {
const regex = getRegex(searchTerm);
const bases = BASE_KEYWORDS[model.base] ?? [model.base];
+ const externalModel = isExternalApiModelConfig(model) ? (model as ExternalApiModelConfig) : null;
+ const externalSearch = externalModel ? ` ${externalModel.provider_id} ${externalModel.provider_model_id}` : '';
const testString =
- `${model.name} ${bases.join(' ')} ${model.type} ${model.description ?? ''} ${model.format}`.toLowerCase();
+ `${model.name} ${bases.join(' ')} ${model.type} ${model.description ?? ''} ${model.format}${externalSearch}`.toLowerCase();
if (testString.includes(searchTerm) || regex.test(testString)) {
return true;
diff --git a/invokeai/frontend/web/src/features/parameters/components/Seed/ParamSeedNumberInput.tsx b/invokeai/frontend/web/src/features/parameters/components/Seed/ParamSeedNumberInput.tsx
index d7e5ac2ecc..7c5ab19ec0 100644
--- a/invokeai/frontend/web/src/features/parameters/components/Seed/ParamSeedNumberInput.tsx
+++ b/invokeai/frontend/web/src/features/parameters/components/Seed/ParamSeedNumberInput.tsx
@@ -2,13 +2,19 @@ import { CompositeNumberInput, FormControl, FormLabel } from '@invoke-ai/ui-libr
import { NUMPY_RAND_MAX, NUMPY_RAND_MIN } from 'app/constants';
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
import { InformationalPopover } from 'common/components/InformationalPopover/InformationalPopover';
-import { selectSeed, selectShouldRandomizeSeed, setSeed } from 'features/controlLayers/store/paramsSlice';
+import {
+ selectSeed,
+ selectSeedControl,
+ selectShouldRandomizeSeed,
+ setSeed,
+} from 'features/controlLayers/store/paramsSlice';
import { memo, useCallback } from 'react';
import { useTranslation } from 'react-i18next';
export const ParamSeedNumberInput = memo(() => {
const seed = useAppSelector(selectSeed);
const shouldRandomizeSeed = useAppSelector(selectShouldRandomizeSeed);
+ const externalControl = useAppSelector(selectSeedControl);
const { t } = useTranslation();
@@ -22,9 +28,10 @@ export const ParamSeedNumberInput = memo(() => {
<FormLabel>{t('parameters.seed')}</FormLabel>
</InformationalPopover>
<CompositeNumberInput
- step={1}
- min={NUMPY_RAND_MIN}
- max={NUMPY_RAND_MAX}
+ step={externalControl?.coarse_step ?? 1}
+ fineStep={externalControl?.fine_step ?? undefined}
+ min={externalControl?.number_input_min ?? NUMPY_RAND_MIN}
+ max={externalControl?.number_input_max ?? NUMPY_RAND_MAX}
onChange={handleChangeSeed}
value={seed}
flexGrow={1}
diff --git a/invokeai/frontend/web/src/features/parameters/types/parameterSchemas.ts b/invokeai/frontend/web/src/features/parameters/types/parameterSchemas.ts
index 95810c9c6e..eb2f1e6c15 100644
--- a/invokeai/frontend/web/src/features/parameters/types/parameterSchemas.ts
+++ b/invokeai/frontend/web/src/features/parameters/types/parameterSchemas.ts
@@ -3,6 +3,7 @@ import { roundToMultiple } from 'common/util/roundDownToMultiple';
import { buildZodTypeGuard } from 'common/util/zodUtils';
import {
zAnimaSchedulerField,
+ zExternalModelIdentifierField,
zFluxDypeExponentField,
zFluxDypePresetField,
zFluxDypeScaleField,
@@ -121,7 +122,7 @@ export const isParameterHeight = isParameterImageDimension;
// #endregion
// #region Model
-export const zParameterModel = zModelIdentifierField;
+export const zParameterModel = z.union([zModelIdentifierField, zExternalModelIdentifierField]);
export type ParameterModel = z.infer<typeof zParameterModel>;
// #endregion
diff --git a/invokeai/frontend/web/src/features/parameters/util/externalPanelSchema.ts b/invokeai/frontend/web/src/features/parameters/util/externalPanelSchema.ts
new file mode 100644
index 0000000000..c49190b225
--- /dev/null
+++ b/invokeai/frontend/web/src/features/parameters/util/externalPanelSchema.ts
@@ -0,0 +1,33 @@
+import type {
+ ExternalApiModelConfig,
+ ExternalModelCapabilities,
+ ExternalModelPanelControl,
+ ExternalModelPanelSchema,
+ ExternalPanelControlName,
+} from 'services/api/types';
+
+type ExternalPanelName = keyof ExternalModelPanelSchema;
+
+const buildExternalPanelSchemaFromCapabilities = (
+ capabilities: ExternalModelCapabilities
+): ExternalModelPanelSchema => ({
+ prompts: [...(capabilities.supports_reference_images ? [{ name: 'reference_images' as const }] : [])],
+ image: [{ name: 'dimensions' }, ...(capabilities.supports_seed ? [{ name: 'seed' as const }] : [])],
+ generation: [],
+});
+
+const getExternalPanelSchema = (modelConfig: ExternalApiModelConfig): ExternalModelPanelSchema =>
+ modelConfig.panel_schema ?? buildExternalPanelSchemaFromCapabilities(modelConfig.capabilities);
+
+export const getExternalPanelControl = (
+ modelConfig: ExternalApiModelConfig,
+ panel: ExternalPanelName,
+ controlName: ExternalPanelControlName
+): ExternalModelPanelControl | null =>
+ getExternalPanelSchema(modelConfig)[panel].find((control) => control.name === controlName) ?? null;
+
+export const hasExternalPanelControl = (
+ modelConfig: ExternalApiModelConfig,
+ panel: ExternalPanelName,
+ controlName: ExternalPanelControlName
+): boolean => getExternalPanelControl(modelConfig, panel, controlName) !== null;
diff --git a/invokeai/frontend/web/src/features/queue/hooks/useEnqueueCanvas.ts b/invokeai/frontend/web/src/features/queue/hooks/useEnqueueCanvas.ts
index 6e466fc89b..68e1e9a382 100644
--- a/invokeai/frontend/web/src/features/queue/hooks/useEnqueueCanvas.ts
+++ b/invokeai/frontend/web/src/features/queue/hooks/useEnqueueCanvas.ts
@@ -7,9 +7,11 @@ import { withResult, withResultAsync } from 'common/util/result';
import { useCanvasManagerSafe } from 'features/controlLayers/contexts/CanvasManagerProviderGate';
import type { CanvasManager } from 'features/controlLayers/konva/CanvasManager';
import { positivePromptAddedToHistory, selectPositivePrompt } from 'features/controlLayers/store/paramsSlice';
+import type { BaseModelType } from 'features/nodes/types/common';
import { prepareLinearUIBatch } from 'features/nodes/util/graph/buildLinearBatchConfig';
import { buildAnimaGraph } from 'features/nodes/util/graph/generation/buildAnimaGraph';
import { buildCogView4Graph } from 'features/nodes/util/graph/generation/buildCogView4Graph';
+import { buildExternalGraph } from 'features/nodes/util/graph/generation/buildExternalGraph';
import { buildFLUXGraph } from 'features/nodes/util/graph/generation/buildFLUXGraph';
import { buildQwenImageGraph } from 'features/nodes/util/graph/generation/buildQwenImageGraph';
import { buildSD1Graph } from 'features/nodes/util/graph/generation/buildSD1Graph';
@@ -63,6 +65,8 @@ const enqueueCanvas = async (store: AppStore, canvasManager: CanvasManager, prep
return await buildQwenImageGraph(graphBuilderArg);
case 'z-image':
return await buildZImageGraph(graphBuilderArg);
+ case 'external':
+ return await buildExternalGraph(graphBuilderArg);
case 'anima':
return await buildAnimaGraph(graphBuilderArg);
default:
@@ -97,7 +101,7 @@ const enqueueCanvas = async (store: AppStore, canvasManager: CanvasManager, prep
prepareLinearUIBatch({
state,
g,
- base,
+ base: base as BaseModelType,
prepend,
seedNode: seed,
positivePromptNode: positivePrompt,
diff --git a/invokeai/frontend/web/src/features/queue/hooks/useEnqueueGenerate.ts b/invokeai/frontend/web/src/features/queue/hooks/useEnqueueGenerate.ts
index 62c9ca255a..54b37e1b95 100644
--- a/invokeai/frontend/web/src/features/queue/hooks/useEnqueueGenerate.ts
+++ b/invokeai/frontend/web/src/features/queue/hooks/useEnqueueGenerate.ts
@@ -5,9 +5,11 @@ import { useAppStore } from 'app/store/storeHooks';
import { extractMessageFromAssertionError } from 'common/util/extractMessageFromAssertionError';
import { withResult, withResultAsync } from 'common/util/result';
import { positivePromptAddedToHistory, selectPositivePrompt } from 'features/controlLayers/store/paramsSlice';
+import type { BaseModelType } from 'features/nodes/types/common';
import { prepareLinearUIBatch } from 'features/nodes/util/graph/buildLinearBatchConfig';
import { buildAnimaGraph } from 'features/nodes/util/graph/generation/buildAnimaGraph';
import { buildCogView4Graph } from 'features/nodes/util/graph/generation/buildCogView4Graph';
+import { buildExternalGraph } from 'features/nodes/util/graph/generation/buildExternalGraph';
import { buildFLUXGraph } from 'features/nodes/util/graph/generation/buildFLUXGraph';
import { buildQwenImageGraph } from 'features/nodes/util/graph/generation/buildQwenImageGraph';
import { buildSD1Graph } from 'features/nodes/util/graph/generation/buildSD1Graph';
@@ -56,6 +58,8 @@ const enqueueGenerate = async (store: AppStore, prepend: boolean) => {
return await buildQwenImageGraph(graphBuilderArg);
case 'z-image':
return await buildZImageGraph(graphBuilderArg);
+ case 'external':
+ return await buildExternalGraph(graphBuilderArg);
case 'anima':
return await buildAnimaGraph(graphBuilderArg);
default:
@@ -90,7 +94,7 @@ const enqueueGenerate = async (store: AppStore, prepend: boolean) => {
prepareLinearUIBatch({
state,
g,
- base,
+ base: base as BaseModelType,
prepend,
seedNode: seed,
positivePromptNode: positivePrompt,
diff --git a/invokeai/frontend/web/src/features/queue/hooks/useEnqueueUpscaling.ts b/invokeai/frontend/web/src/features/queue/hooks/useEnqueueUpscaling.ts
index 8d27afe20f..318c1fd5ff 100644
--- a/invokeai/frontend/web/src/features/queue/hooks/useEnqueueUpscaling.ts
+++ b/invokeai/frontend/web/src/features/queue/hooks/useEnqueueUpscaling.ts
@@ -2,6 +2,7 @@ import { logger } from 'app/logging/logger';
import type { AppStore } from 'app/store/store';
import { useAppStore } from 'app/store/storeHooks';
import { positivePromptAddedToHistory, selectPositivePrompt } from 'features/controlLayers/store/paramsSlice';
+import type { BaseModelType } from 'features/nodes/types/common';
import { prepareLinearUIBatch } from 'features/nodes/util/graph/buildLinearBatchConfig';
import { buildMultidiffusionUpscaleGraph } from 'features/nodes/util/graph/buildMultidiffusionUpscaleGraph';
import { useCallback } from 'react';
@@ -26,7 +27,7 @@ const enqueueUpscaling = async (store: AppStore, prepend: boolean) => {
const batchConfig = prepareLinearUIBatch({
state,
g,
- base,
+ base: base as BaseModelType,
prepend,
seedNode: seed,
positivePromptNode: positivePrompt,
diff --git a/invokeai/frontend/web/src/features/queue/store/readiness.ts b/invokeai/frontend/web/src/features/queue/store/readiness.ts
index 81a3b41633..67dfe3141c 100644
--- a/invokeai/frontend/web/src/features/queue/store/readiness.ts
+++ b/invokeai/frontend/web/src/features/queue/store/readiness.ts
@@ -39,7 +39,8 @@ import type { TabName } from 'features/ui/store/uiTypes';
import i18n from 'i18next';
import { atom, computed } from 'nanostores';
import { useEffect } from 'react';
-import type { MainModelConfig } from 'services/api/types';
+import type { MainOrExternalModelConfig } from 'services/api/types';
+import { isExternalApiModelConfig } from 'services/api/types';
import { $isConnected } from 'services/events/stores';
/**
@@ -221,7 +222,7 @@ const disconnectedReason = (t: typeof i18n.t) => ({ content: t('parameters.invok
const getReasonsWhyCannotEnqueueGenerateTab = (arg: {
isConnected: boolean;
- model: MainModelConfig | null | undefined;
+ model: MainOrExternalModelConfig | null | undefined;
params: ParamsState;
refImages: RefImagesState;
loras: LoRA[];
@@ -243,7 +244,11 @@ const getReasonsWhyCannotEnqueueGenerateTab = (arg: {
reasons.push({ content: i18n.t('parameters.invoke.noModelSelected') });
}
- if (model?.base === 'flux') {
+ if (!model) {
+ // nothing else to validate
+ } else if (isExternalApiModelConfig(model)) {
+ // external models don't require local sub-models
+ } else if (model.base === 'flux') {
if (!params.t5EncoderModel) {
reasons.push({ content: i18n.t('parameters.invoke.noT5EncoderModelSelected') });
}
@@ -298,7 +303,7 @@ const getReasonsWhyCannotEnqueueGenerateTab = (arg: {
}
}
- if (model && SUPPORTS_REF_IMAGES_BASE_MODELS.includes(model.base)) {
+ if (model && !isExternalApiModelConfig(model) && SUPPORTS_REF_IMAGES_BASE_MODELS.includes(model.base)) {
const enabledRefImages = refImages.entities.filter(({ isEnabled }) => isEnabled);
enabledRefImages.forEach((entity, i) => {
@@ -449,7 +454,7 @@ const getReasonsWhyCannotEnqueueUpscaleTab = (arg: {
const getReasonsWhyCannotEnqueueCanvasTab = (arg: {
isConnected: boolean;
- model: MainModelConfig | null | undefined;
+ model: MainOrExternalModelConfig | null | undefined;
canvas: CanvasState;
params: ParamsState;
refImages: RefImagesState;
@@ -506,7 +511,11 @@ const getReasonsWhyCannotEnqueueCanvasTab = (arg: {
reasons.push({ content: i18n.t('parameters.invoke.noModelSelected') });
}
- if (model?.base === 'flux') {
+ if (!model) {
+ // nothing else to validate
+ } else if (isExternalApiModelConfig(model)) {
+ // external models don't require local sub-models
+ } else if (model.base === 'flux') {
if (!params.t5EncoderModel) {
reasons.push({ content: i18n.t('parameters.invoke.noT5EncoderModelSelected') });
}
@@ -763,7 +772,7 @@ const getReasonsWhyCannotEnqueueCanvasTab = (arg: {
}
});
- if (model && SUPPORTS_REF_IMAGES_BASE_MODELS.includes(model.base)) {
+ if (model && !isExternalApiModelConfig(model) && SUPPORTS_REF_IMAGES_BASE_MODELS.includes(model.base)) {
const enabledRefImages = refImages.entities.filter(({ isEnabled }) => isEnabled);
enabledRefImages.forEach((entity, i) => {
diff --git a/invokeai/frontend/web/src/features/settingsAccordions/components/AdvancedSettingsAccordion/AdvancedSettingsAccordion.tsx b/invokeai/frontend/web/src/features/settingsAccordions/components/AdvancedSettingsAccordion/AdvancedSettingsAccordion.tsx
index efbaf2ae4c..bfb69b945c 100644
--- a/invokeai/frontend/web/src/features/settingsAccordions/components/AdvancedSettingsAccordion/AdvancedSettingsAccordion.tsx
+++ b/invokeai/frontend/web/src/features/settingsAccordions/components/AdvancedSettingsAccordion/AdvancedSettingsAccordion.tsx
@@ -5,6 +5,7 @@ import { createMemoizedSelector } from 'app/store/createMemoizedSelector';
import { useAppSelector } from 'app/store/storeHooks';
import {
selectIsAnima,
+ selectIsExternal,
selectIsFLUX,
selectIsFlux2,
selectIsQwenImage,
@@ -50,6 +51,7 @@ export const AdvancedSettingsAccordion = memo(() => {
const isFlux2 = useAppSelector(selectIsFlux2);
const isSD3 = useAppSelector(selectIsSD3);
const isZImage = useAppSelector(selectIsZImage);
+ const isExternal = useAppSelector(selectIsExternal);
const isQwenImage = useAppSelector(selectIsQwenImage);
const isAnima = useAppSelector(selectIsAnima);
@@ -98,6 +100,10 @@ export const AdvancedSettingsAccordion = memo(() => {
defaultIsOpen: false,
});
+ if (isExternal) {
+ return null;
+ }
+
return (
<StandaloneAccordion label={t('accordions.advanced.title')} badges={badges} isOpen={isOpen} onToggle={onToggle}>
<Flex gap={4} alignItems="center" p={4} flexDir="column" data-testid="advanced-settings-accordion">
diff --git a/invokeai/frontend/web/src/features/settingsAccordions/components/ExternalSettingsAccordion/ExternalSettingsAccordion.tsx b/invokeai/frontend/web/src/features/settingsAccordions/components/ExternalSettingsAccordion/ExternalSettingsAccordion.tsx
new file mode 100644
index 0000000000..2988acbd19
--- /dev/null
+++ b/invokeai/frontend/web/src/features/settingsAccordions/components/ExternalSettingsAccordion/ExternalSettingsAccordion.tsx
@@ -0,0 +1,49 @@
+import type { FormLabelProps } from '@invoke-ai/ui-library';
+import { Flex, FormControlGroup, StandaloneAccordion } from '@invoke-ai/ui-library';
+import { useAppSelector } from 'app/store/storeHooks';
+import { selectExternalProviderId, selectIsExternal } from 'features/controlLayers/store/paramsSlice';
+import { ExternalModelImageSizeSelect } from 'features/parameters/components/Dimensions/ExternalModelImageSizeSelect';
+import { ExternalModelResolutionSelect } from 'features/parameters/components/Dimensions/ExternalModelResolutionSelect';
+import { GeminiProviderOptions } from 'features/parameters/components/External/GeminiProviderOptions';
+import { OpenAIProviderOptions } from 'features/parameters/components/External/OpenAIProviderOptions';
+import { useStandaloneAccordionToggle } from 'features/settingsAccordions/hooks/useStandaloneAccordionToggle';
+import { memo } from 'react';
+import { useTranslation } from 'react-i18next';
+
+const formLabelProps: FormLabelProps = {
+ minW: '4rem',
+};
+
+export const ExternalSettingsAccordion = memo(() => {
+ const { t } = useTranslation();
+ const isExternal = useAppSelector(selectIsExternal);
+ const providerId = useAppSelector(selectExternalProviderId);
+ const { isOpen, onToggle } = useStandaloneAccordionToggle({
+ id: 'external-settings',
+ defaultIsOpen: true,
+ });
+
+ if (!isExternal) {
+ return null;
+ }
+
+ return (
+ <StandaloneAccordion
+ label={t('accordions.advanced.title')}
+ badges={['EXTERNAL']}
+ isOpen={isOpen}
+ onToggle={onToggle}
+ >
+ <Flex gap={4} p={4} flexDir="column" data-testid="external-settings-accordion">
+ <FormControlGroup formLabelProps={formLabelProps}>
+ <ExternalModelResolutionSelect />
+ <ExternalModelImageSizeSelect />
+ {providerId === 'openai' && <OpenAIProviderOptions />}
+ {providerId === 'gemini' && <GeminiProviderOptions />}
+ </FormControlGroup>
+ </Flex>
+ </StandaloneAccordion>
+ );
+});
+
+ExternalSettingsAccordion.displayName = 'ExternalSettingsAccordion';
diff --git a/invokeai/frontend/web/src/features/settingsAccordions/components/GenerationSettingsAccordion/GenerationSettingsAccordion.tsx b/invokeai/frontend/web/src/features/settingsAccordions/components/GenerationSettingsAccordion/GenerationSettingsAccordion.tsx
index 2b21c82308..7e07c9f564 100644
--- a/invokeai/frontend/web/src/features/settingsAccordions/components/GenerationSettingsAccordion/GenerationSettingsAccordion.tsx
+++ b/invokeai/frontend/web/src/features/settingsAccordions/components/GenerationSettingsAccordion/GenerationSettingsAccordion.tsx
@@ -8,11 +8,14 @@ import {
selectFluxDypePreset,
selectIsAnima,
selectIsCogView4,
+ selectIsExternal,
selectIsFLUX,
selectIsFlux2,
selectIsQwenImage,
selectIsSD3,
selectIsZImage,
+ selectModelSupportsGuidance,
+ selectModelSupportsSteps,
} from 'features/controlLayers/store/paramsSlice';
import { LoRAList } from 'features/lora/components/LoRAList';
import LoRASelect from 'features/lora/components/LoRASelect';
@@ -49,9 +52,13 @@ export const GenerationSettingsAccordion = memo(() => {
const isSD3 = useAppSelector(selectIsSD3);
const isCogView4 = useAppSelector(selectIsCogView4);
const isZImage = useAppSelector(selectIsZImage);
+ const isExternal = useAppSelector(selectIsExternal);
const isQwenImage = useAppSelector(selectIsQwenImage);
const isAnima = useAppSelector(selectIsAnima);
const fluxDypePreset = useAppSelector(selectFluxDypePreset);
+ const modelSupportsGuidance = useAppSelector(selectModelSupportsGuidance);
+ const modelSupportsSteps = useAppSelector(selectModelSupportsSteps);
+ const hasExpanderContent = isExternal ? modelSupportsGuidance || modelSupportsSteps : true;
const selectBadges = useMemo(
() =>
@@ -76,37 +83,47 @@ export const GenerationSettingsAccordion = memo(() => {
return (
<StandaloneAccordion
label={t('accordions.generation.title')}
- badges={[...accordionBadges, ...loraTabBadges]}
+ badges={[...accordionBadges, ...(isExternal ? EMPTY_ARRAY : loraTabBadges)]}
isOpen={isOpenAccordion}
onToggle={onToggleAccordion}
>
- <Box px={4} pt={4} data-testid="generation-accordion">
+ <Box px={4} pt={4} pb={hasExpanderContent ? 0 : 4} data-testid="generation-accordion">
<Flex gap={4} flexDir="column" pb={0}>
<MainModelPicker />
- <LoRASelect />
- <LoRAList />
+ {!isExternal && <LoRASelect />}
+ {!isExternal && <LoRAList />}
</Flex>
- <Expander label={t('accordions.advanced.options')} isOpen={isOpenExpander} onToggle={onToggleExpander}>
- <Flex gap={4} flexDir="column" pb={4}>
- <FormControlGroup formLabelProps={formLabelProps}>
- {!isFLUX && !isFlux2 && !isSD3 && !isCogView4 && !isZImage && !isQwenImage && !isAnima && (
- <ParamScheduler />
- )}
- {isFLUX && <ParamFluxScheduler />}
- {isZImage && <ParamZImageScheduler />}
- {isAnima && <ParamAnimaScheduler />}
- <ParamSteps />
- {(isFLUX || isFlux2) && modelConfig && !isFluxFillMainModelModelConfig(modelConfig) && <ParamGuidance />}
- {!isFLUX && !isFlux2 && <ParamCFGScale />}
- {isZImage && <ParamZImageShift />}
- {isQwenImage && <ParamQwenImageShift />}
- {isFLUX && <ParamFluxDypePreset />}
- {isFLUX && fluxDypePreset === 'manual' && <ParamFluxDypeScale />}
- {isFLUX && fluxDypePreset === 'manual' && <ParamFluxDypeExponent />}
- </FormControlGroup>
- {isZImage && <ParamZImageSeedVarianceSettings />}
- </Flex>
- </Expander>
+ {hasExpanderContent && (
+ <Expander label={t('accordions.advanced.options')} isOpen={isOpenExpander} onToggle={onToggleExpander}>
+ <Flex gap={4} flexDir="column" pb={4}>
+ <FormControlGroup formLabelProps={formLabelProps}>
+ {!isExternal &&
+ !isFLUX &&
+ !isFlux2 &&
+ !isSD3 &&
+ !isCogView4 &&
+ !isZImage &&
+ !isQwenImage &&
+ !isAnima && <ParamScheduler />}
+ {!isExternal && isFLUX && <ParamFluxScheduler />}
+ {!isExternal && isZImage && <ParamZImageScheduler />}
+ {!isExternal && isAnima && <ParamAnimaScheduler />}
+ {modelSupportsSteps && <ParamSteps />}
+ {isExternal && modelSupportsGuidance && <ParamGuidance />}
+ {!isExternal && (isFLUX || isFlux2) && modelConfig && !isFluxFillMainModelModelConfig(modelConfig) && (
+ <ParamGuidance />
+ )}
+ {!isExternal && !isFLUX && !isFlux2 && <ParamCFGScale />}
+ {!isExternal && isZImage && <ParamZImageShift />}
+ {!isExternal && isQwenImage && <ParamQwenImageShift />}
+ {!isExternal && isFLUX && <ParamFluxDypePreset />}
+ {!isExternal && isFLUX && fluxDypePreset === 'manual' && <ParamFluxDypeScale />}
+ {!isExternal && isFLUX && fluxDypePreset === 'manual' && <ParamFluxDypeExponent />}
+ </FormControlGroup>
+ {!isExternal && isZImage && <ParamZImageSeedVarianceSettings />}
+ </Flex>
+ </Expander>
+ )}
</Box>
</StandaloneAccordion>
);
diff --git a/invokeai/frontend/web/src/features/settingsAccordions/components/GenerationSettingsAccordion/MainModelPicker.tsx b/invokeai/frontend/web/src/features/settingsAccordions/components/GenerationSettingsAccordion/MainModelPicker.tsx
index 773b67e39b..66f76dcd15 100644
--- a/invokeai/frontend/web/src/features/settingsAccordions/components/GenerationSettingsAccordion/MainModelPicker.tsx
+++ b/invokeai/frontend/web/src/features/settingsAccordions/components/GenerationSettingsAccordion/MainModelPicker.tsx
@@ -1,23 +1,26 @@
import { Flex, FormLabel, Icon } from '@invoke-ai/ui-library';
-import { useAppDispatch } from 'app/store/storeHooks';
+import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
import { InformationalPopover } from 'common/components/InformationalPopover/InformationalPopover';
+import { isExternalModelUnsupportedForTab } from 'features/parameters/components/MainModel/mainModelPickerUtils';
import { UseDefaultSettingsButton } from 'features/parameters/components/MainModel/UseDefaultSettingsButton';
import { ModelPicker } from 'features/parameters/components/ModelPicker';
import { modelSelected } from 'features/parameters/store/actions';
+import { selectActiveTab } from 'features/ui/store/uiSelectors';
import { memo, useCallback, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { MdMoneyOff } from 'react-icons/md';
import { useMainModels } from 'services/api/hooks/modelsByType';
import { useSelectedModelConfig } from 'services/api/hooks/useSelectedModelConfig';
-import { type AnyModelConfig, isNonCommercialMainModelConfig } from 'services/api/types';
+import { type AnyModelConfigWithExternal, isNonCommercialMainModelConfig } from 'services/api/types';
export const MainModelPicker = memo(() => {
const { t } = useTranslation();
const dispatch = useAppDispatch();
+ const activeTab = useAppSelector(selectActiveTab);
const [modelConfigs] = useMainModels();
const selectedModelConfig = useSelectedModelConfig();
const onChange = useCallback(
- (modelConfig: AnyModelConfig) => {
+ (modelConfig: AnyModelConfigWithExternal) => {
dispatch(modelSelected(modelConfig));
},
[dispatch]
@@ -28,6 +31,11 @@ export const MainModelPicker = memo(() => {
[selectedModelConfig]
);
+ const getIsOptionDisabled = useCallback(
+ (modelConfig: AnyModelConfigWithExternal) => isExternalModelUnsupportedForTab(modelConfig, activeTab),
+ [activeTab]
+ );
+
return (
<Flex alignItems="center" gap={2}>
<InformationalPopover feature="paramModel">
@@ -46,6 +54,7 @@ export const MainModelPicker = memo(() => {
selectedModelConfig={selectedModelConfig}
onChange={onChange}
grouped
+ getIsOptionDisabled={getIsOptionDisabled}
/>
<UseDefaultSettingsButton />
</Flex>
diff --git a/invokeai/frontend/web/src/features/settingsAccordions/components/ImageSettingsAccordion/CanvasTabImageSettingsAccordion.tsx b/invokeai/frontend/web/src/features/settingsAccordions/components/ImageSettingsAccordion/CanvasTabImageSettingsAccordion.tsx
index 0fb69173de..bb850a87da 100644
--- a/invokeai/frontend/web/src/features/settingsAccordions/components/ImageSettingsAccordion/CanvasTabImageSettingsAccordion.tsx
+++ b/invokeai/frontend/web/src/features/settingsAccordions/components/ImageSettingsAccordion/CanvasTabImageSettingsAccordion.tsx
@@ -4,7 +4,9 @@ import { EMPTY_ARRAY } from 'app/store/constants';
import { createMemoizedSelector } from 'app/store/createMemoizedSelector';
import { useAppSelector } from 'app/store/storeHooks';
import {
+ selectModelSupportsDimensions,
selectModelSupportsOptimizedDenoising,
+ selectModelSupportsSeed,
selectShouldRandomizeSeed,
} from 'features/controlLayers/store/paramsSlice';
import { selectBbox, selectScaleMethod } from 'features/controlLayers/store/selectors';
@@ -19,30 +21,33 @@ import { useStandaloneAccordionToggle } from 'features/settingsAccordions/hooks/
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
-const selectBadges = createMemoizedSelector([selectBbox, selectShouldRandomizeSeed], (bbox, shouldRandomizeSeed) => {
- const badges: string[] = [];
+const selectBadges = createMemoizedSelector(
+ [selectBbox, selectShouldRandomizeSeed, selectModelSupportsSeed],
+ (bbox, shouldRandomizeSeed, modelSupportsSeed) => {
+ const badges: string[] = [];
- const { aspectRatio, rect } = bbox;
- const { width, height } = rect;
+ const { aspectRatio, rect } = bbox;
+ const { width, height } = rect;
- badges.push(`${width}×${height}`);
+ badges.push(`${width}×${height}`);
- badges.push(aspectRatio.id);
+ badges.push(aspectRatio.id);
- if (aspectRatio.isLocked) {
- badges.push('locked');
- }
+ if (aspectRatio.isLocked) {
+ badges.push('locked');
+ }
- if (!shouldRandomizeSeed) {
- badges.push('Manual Seed');
- }
+ if (modelSupportsSeed && !shouldRandomizeSeed) {
+ badges.push('Manual Seed');
+ }
- if (badges.length === 0) {
- return EMPTY_ARRAY;
- }
+ if (badges.length === 0) {
+ return EMPTY_ARRAY;
+ }
- return badges;
-});
+ return badges;
+ }
+);
const scalingLabelProps: FormLabelProps = {
minW: '4.5rem',
@@ -60,7 +65,9 @@ export const CanvasTabImageSettingsAccordion = memo(() => {
id: 'image-settings-advanced',
defaultIsOpen: false,
});
+ const modelSupportsDimensions = useAppSelector(selectModelSupportsDimensions);
const modelSupportsOptimizedDenoising = useAppSelector(selectModelSupportsOptimizedDenoising);
+ const modelSupportsSeed = useAppSelector(selectModelSupportsSeed);
return (
<StandaloneAccordion
@@ -70,8 +77,8 @@ export const CanvasTabImageSettingsAccordion = memo(() => {
onToggle={onToggleAccordion}
>
<Flex px={4} pt={4} pb={0} w="full" h="full" flexDir="column" data-testid="image-settings-accordion">
- <BboxSettings />
- <ParamSeed pt={3} pb={0} />
+ {modelSupportsDimensions && <BboxSettings />}
+ {modelSupportsSeed && <ParamSeed pt={3} pb={0} />}
<Expander label={t('accordions.advanced.options')} isOpen={isOpenExpander} onToggle={onToggleExpander}>
<Flex gap={4} pb={4} flexDir="column">
{modelSupportsOptimizedDenoising && <ParamOptimizedDenoisingToggle />}
diff --git a/invokeai/frontend/web/src/features/settingsAccordions/components/ImageSettingsAccordion/GenerateTabImageSettingsAccordion.tsx b/invokeai/frontend/web/src/features/settingsAccordions/components/ImageSettingsAccordion/GenerateTabImageSettingsAccordion.tsx
index ad5cd0d219..759e6d9fd4 100644
--- a/invokeai/frontend/web/src/features/settingsAccordions/components/ImageSettingsAccordion/GenerateTabImageSettingsAccordion.tsx
+++ b/invokeai/frontend/web/src/features/settingsAccordions/components/ImageSettingsAccordion/GenerateTabImageSettingsAccordion.tsx
@@ -6,6 +6,8 @@ import {
selectAspectRatioID,
selectAspectRatioIsLocked,
selectHeight,
+ selectModelSupportsDimensions,
+ selectModelSupportsSeed,
selectShouldRandomizeSeed,
selectWidth,
} from 'features/controlLayers/store/paramsSlice';
@@ -16,8 +18,15 @@ import { memo } from 'react';
import { useTranslation } from 'react-i18next';
const selectBadges = createMemoizedSelector(
- [selectWidth, selectHeight, selectAspectRatioID, selectAspectRatioIsLocked, selectShouldRandomizeSeed],
- (width, height, aspectRatioID, aspectRatioIsLocked, shouldRandomizeSeed) => {
+ [
+ selectWidth,
+ selectHeight,
+ selectAspectRatioID,
+ selectAspectRatioIsLocked,
+ selectShouldRandomizeSeed,
+ selectModelSupportsSeed,
+ ],
+ (width, height, aspectRatioID, aspectRatioIsLocked, shouldRandomizeSeed, modelSupportsSeed) => {
const badges: string[] = [];
badges.push(`${width}×${height}`);
@@ -28,7 +37,7 @@ const selectBadges = createMemoizedSelector(
badges.push('locked');
}
- if (!shouldRandomizeSeed) {
+ if (modelSupportsSeed && !shouldRandomizeSeed) {
badges.push('Manual Seed');
}
@@ -43,11 +52,17 @@ const selectBadges = createMemoizedSelector(
export const GenerateTabImageSettingsAccordion = memo(() => {
const { t } = useTranslation();
const badges = useAppSelector(selectBadges);
+ const modelSupportsDimensions = useAppSelector(selectModelSupportsDimensions);
+ const modelSupportsSeed = useAppSelector(selectModelSupportsSeed);
const { isOpen: isOpenAccordion, onToggle: onToggleAccordion } = useStandaloneAccordionToggle({
id: 'image-settings-generate-tab',
defaultIsOpen: true,
});
+ if (!modelSupportsDimensions && !modelSupportsSeed) {
+ return null;
+ }
+
return (
<StandaloneAccordion
label={t('accordions.image.title')}
@@ -56,8 +71,8 @@ export const GenerateTabImageSettingsAccordion = memo(() => {
onToggle={onToggleAccordion}
>
<Flex px={4} pt={4} pb={4} w="full" h="full" flexDir="column" data-testid="image-settings-accordion">
- <Dimensions />
- <ParamSeed py={3} />
+ {modelSupportsDimensions && <Dimensions />}
+ {modelSupportsSeed && <ParamSeed py={3} />}
</Flex>
</StandaloneAccordion>
);
diff --git a/invokeai/frontend/web/src/features/system/components/SettingsModal/ExternalProviderStatusList.tsx b/invokeai/frontend/web/src/features/system/components/SettingsModal/ExternalProviderStatusList.tsx
new file mode 100644
index 0000000000..ea36cf4c65
--- /dev/null
+++ b/invokeai/frontend/web/src/features/system/components/SettingsModal/ExternalProviderStatusList.tsx
@@ -0,0 +1,39 @@
+import { Badge, Flex, FormControl, FormLabel, Text, Tooltip } from '@invoke-ai/ui-library';
+import { memo } from 'react';
+import { useTranslation } from 'react-i18next';
+import { useGetExternalProviderStatusesQuery } from 'services/api/endpoints/appInfo';
+
+import { getExternalProviderStatusBadgeInfo } from './externalProviderStatusUtils';
+
+export const ExternalProviderStatusList = memo(() => {
+ const { t } = useTranslation();
+ const { data } = useGetExternalProviderStatusesQuery();
+
+ if (!data || data.length === 0) {
+ return null;
+ }
+
+ const sortedProviders = [...data].sort((a, b) => a.provider_id.localeCompare(b.provider_id));
+
+ return (
+ <FormControl>
+ <FormLabel>{t('settings.externalProviders')}</FormLabel>
+ <Flex direction="column" gap={2}>
+ {sortedProviders.map((status) => {
+ const badgeInfo = getExternalProviderStatusBadgeInfo(status);
+ const tooltip = badgeInfo.tooltipMessage ?? (badgeInfo.tooltipKey ? t(badgeInfo.tooltipKey) : null);
+ return (
+ <Flex key={status.provider_id} alignItems="center" justifyContent="space-between" gap={3}>
+ <Text fontWeight="semibold">{status.provider_id}</Text>
+ <Tooltip label={tooltip} isDisabled={!tooltip}>
+ <Badge colorScheme={badgeInfo.colorScheme}>{t(badgeInfo.labelKey)}</Badge>
+ </Tooltip>
+ </Flex>
+ );
+ })}
+ </Flex>
+ </FormControl>
+ );
+});
+
+ExternalProviderStatusList.displayName = 'ExternalProviderStatusList';
diff --git a/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsModal.tsx b/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsModal.tsx
index 7bcc103402..1238877f0a 100644
--- a/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsModal.tsx
+++ b/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsModal.tsx
@@ -23,6 +23,7 @@ import ScrollableContent from 'common/components/OverlayScrollbars/ScrollableCon
import { buildUseBoolean } from 'common/hooks/useBoolean';
import { selectCurrentUser } from 'features/auth/store/authSlice';
import { selectShouldUseCPUNoise, shouldUseCpuNoiseChanged } from 'features/controlLayers/store/paramsSlice';
+import { ExternalProviderStatusList } from 'features/system/components/SettingsModal/ExternalProviderStatusList';
import { useRefreshAfterResetModal } from 'features/system/components/SettingsModal/RefreshAfterResetModal';
import { SettingsDeveloperLogIsEnabled } from 'features/system/components/SettingsModal/SettingsDeveloperLogIsEnabled';
import { SettingsDeveloperLogLevel } from 'features/system/components/SettingsModal/SettingsDeveloperLogLevel';
@@ -310,6 +311,10 @@ const SettingsModal = (props: { children: ReactElement }) => {
</FormControl>
</StickyScrollable>
+ <StickyScrollable title={t('settings.models')}>
+ <ExternalProviderStatusList />
+ </StickyScrollable>
+
<StickyScrollable title={t('settings.ui')}>
<FormControl>
<FormLabel>{t('settings.showProgressInViewer')}</FormLabel>
diff --git a/invokeai/frontend/web/src/features/system/components/SettingsModal/externalProviderStatusUtils.test.ts b/invokeai/frontend/web/src/features/system/components/SettingsModal/externalProviderStatusUtils.test.ts
new file mode 100644
index 0000000000..98ae63004c
--- /dev/null
+++ b/invokeai/frontend/web/src/features/system/components/SettingsModal/externalProviderStatusUtils.test.ts
@@ -0,0 +1,38 @@
+import type { ExternalProviderStatus } from 'services/api/types';
+import { describe, expect, it } from 'vitest';
+
+import { getExternalProviderStatusBadgeInfo } from './externalProviderStatusUtils';
+
+const buildStatus = (overrides: Partial<ExternalProviderStatus> = {}): ExternalProviderStatus => ({
+ provider_id: 'openai',
+ configured: false,
+ message: null,
+ ...overrides,
+});
+
+describe('getExternalProviderStatusBadgeInfo', () => {
+ it('marks configured providers as configured', () => {
+ const badgeInfo = getExternalProviderStatusBadgeInfo(buildStatus({ configured: true }));
+
+ expect(badgeInfo.labelKey).toBe('settings.externalProviderConfigured');
+ expect(badgeInfo.tooltipKey).toBeNull();
+ expect(badgeInfo.tooltipMessage).toBeNull();
+ expect(badgeInfo.colorScheme).toBe('green');
+ });
+
+ it('adds hint when provider is not configured', () => {
+ const badgeInfo = getExternalProviderStatusBadgeInfo(buildStatus());
+
+ expect(badgeInfo.labelKey).toBe('settings.externalProviderNotConfigured');
+ expect(badgeInfo.tooltipKey).toBe('settings.externalProviderNotConfiguredHint');
+ expect(badgeInfo.tooltipMessage).toBeNull();
+ expect(badgeInfo.colorScheme).toBe('warning');
+ });
+
+ it('prefers status messages when present', () => {
+ const badgeInfo = getExternalProviderStatusBadgeInfo(buildStatus({ message: 'Missing key' }));
+
+ expect(badgeInfo.tooltipKey).toBeNull();
+ expect(badgeInfo.tooltipMessage).toBe('Missing key');
+ });
+});
diff --git a/invokeai/frontend/web/src/features/system/components/SettingsModal/externalProviderStatusUtils.ts b/invokeai/frontend/web/src/features/system/components/SettingsModal/externalProviderStatusUtils.ts
new file mode 100644
index 0000000000..fb1f764e2a
--- /dev/null
+++ b/invokeai/frontend/web/src/features/system/components/SettingsModal/externalProviderStatusUtils.ts
@@ -0,0 +1,26 @@
+import type { ExternalProviderStatus } from 'services/api/types';
+
+type ExternalProviderStatusBadgeInfo = {
+ labelKey: 'settings.externalProviderConfigured' | 'settings.externalProviderNotConfigured';
+ tooltipKey: 'settings.externalProviderNotConfiguredHint' | null;
+ tooltipMessage: string | null;
+ colorScheme: 'green' | 'warning';
+};
+
+export const getExternalProviderStatusBadgeInfo = (status: ExternalProviderStatus): ExternalProviderStatusBadgeInfo => {
+ if (status.configured) {
+ return {
+ labelKey: 'settings.externalProviderConfigured',
+ tooltipKey: null,
+ tooltipMessage: status.message ?? null,
+ colorScheme: 'green',
+ };
+ }
+
+ return {
+ labelKey: 'settings.externalProviderNotConfigured',
+ tooltipKey: status.message ? null : 'settings.externalProviderNotConfiguredHint',
+ tooltipMessage: status.message ?? null,
+ colorScheme: 'warning',
+ };
+};
diff --git a/invokeai/frontend/web/src/features/ui/components/ParametersPanels/ParametersPanelCanvas.tsx b/invokeai/frontend/web/src/features/ui/components/ParametersPanels/ParametersPanelCanvas.tsx
index ddd75d91cf..dec9a9c6cf 100644
--- a/invokeai/frontend/web/src/features/ui/components/ParametersPanels/ParametersPanelCanvas.tsx
+++ b/invokeai/frontend/web/src/features/ui/components/ParametersPanels/ParametersPanelCanvas.tsx
@@ -2,10 +2,11 @@ import { Box, Flex } from '@invoke-ai/ui-library';
import { useStore } from '@nanostores/react';
import { useAppSelector } from 'app/store/storeHooks';
import { overlayScrollbarsParams } from 'common/components/OverlayScrollbars/constants';
-import { selectIsCogView4, selectIsSDXL } from 'features/controlLayers/store/paramsSlice';
+import { selectIsCogView4, selectIsExternal, selectIsSDXL } from 'features/controlLayers/store/paramsSlice';
import { Prompts } from 'features/parameters/components/Prompts/Prompts';
import { AdvancedSettingsAccordion } from 'features/settingsAccordions/components/AdvancedSettingsAccordion/AdvancedSettingsAccordion';
import { CompositingSettingsAccordion } from 'features/settingsAccordions/components/CompositingSettingsAccordion/CompositingSettingsAccordion';
+import { ExternalSettingsAccordion } from 'features/settingsAccordions/components/ExternalSettingsAccordion/ExternalSettingsAccordion';
import { GenerationSettingsAccordion } from 'features/settingsAccordions/components/GenerationSettingsAccordion/GenerationSettingsAccordion';
import { CanvasTabImageSettingsAccordion } from 'features/settingsAccordions/components/ImageSettingsAccordion/CanvasTabImageSettingsAccordion';
import { RefinerSettingsAccordion } from 'features/settingsAccordions/components/RefinerSettingsAccordion/RefinerSettingsAccordion';
@@ -24,6 +25,7 @@ const overlayScrollbarsStyles: CSSProperties = {
export const ParametersPanelCanvas = memo(() => {
const isSDXL = useAppSelector(selectIsSDXL);
const isCogview4 = useAppSelector(selectIsCogView4);
+ const isExternal = useAppSelector(selectIsExternal);
const isStylePresetsMenuOpen = useStore($isStylePresetsMenuOpen);
return (
@@ -43,9 +45,10 @@ export const ParametersPanelCanvas = memo(() => {
<Prompts />
<CanvasTabImageSettingsAccordion />
<GenerationSettingsAccordion />
- <CompositingSettingsAccordion />
+ {!isExternal && <CompositingSettingsAccordion />}
{isSDXL && <RefinerSettingsAccordion />}
- {!isCogview4 && <AdvancedSettingsAccordion />}
+ {!isCogview4 && !isExternal && <AdvancedSettingsAccordion />}
+ {isExternal && <ExternalSettingsAccordion />}
</Flex>
</OverlayScrollbarsComponent>
</Box>
diff --git a/invokeai/frontend/web/src/features/ui/components/ParametersPanels/ParametersPanelGenerate.tsx b/invokeai/frontend/web/src/features/ui/components/ParametersPanels/ParametersPanelGenerate.tsx
index f955f6793c..06a122cc4e 100644
--- a/invokeai/frontend/web/src/features/ui/components/ParametersPanels/ParametersPanelGenerate.tsx
+++ b/invokeai/frontend/web/src/features/ui/components/ParametersPanels/ParametersPanelGenerate.tsx
@@ -2,9 +2,10 @@ import { Box, Flex } from '@invoke-ai/ui-library';
import { useStore } from '@nanostores/react';
import { useAppSelector } from 'app/store/storeHooks';
import { overlayScrollbarsParams } from 'common/components/OverlayScrollbars/constants';
-import { selectIsCogView4, selectIsSDXL } from 'features/controlLayers/store/paramsSlice';
+import { selectIsCogView4, selectIsExternal, selectIsSDXL } from 'features/controlLayers/store/paramsSlice';
import { Prompts } from 'features/parameters/components/Prompts/Prompts';
import { AdvancedSettingsAccordion } from 'features/settingsAccordions/components/AdvancedSettingsAccordion/AdvancedSettingsAccordion';
+import { ExternalSettingsAccordion } from 'features/settingsAccordions/components/ExternalSettingsAccordion/ExternalSettingsAccordion';
import { GenerationSettingsAccordion } from 'features/settingsAccordions/components/GenerationSettingsAccordion/GenerationSettingsAccordion';
import { GenerateTabImageSettingsAccordion } from 'features/settingsAccordions/components/ImageSettingsAccordion/GenerateTabImageSettingsAccordion';
import { RefinerSettingsAccordion } from 'features/settingsAccordions/components/RefinerSettingsAccordion/RefinerSettingsAccordion';
@@ -23,6 +24,7 @@ const overlayScrollbarsStyles: CSSProperties = {
export const ParametersPanelGenerate = memo(() => {
const isSDXL = useAppSelector(selectIsSDXL);
const isCogview4 = useAppSelector(selectIsCogView4);
+ const isExternal = useAppSelector(selectIsExternal);
const isStylePresetsMenuOpen = useStore($isStylePresetsMenuOpen);
return (
@@ -43,7 +45,8 @@ export const ParametersPanelGenerate = memo(() => {
<GenerateTabImageSettingsAccordion />
<GenerationSettingsAccordion />
{isSDXL && <RefinerSettingsAccordion />}
- {!isCogview4 && <AdvancedSettingsAccordion />}
+ {!isCogview4 && !isExternal && <AdvancedSettingsAccordion />}
+ {isExternal && <ExternalSettingsAccordion />}
</Flex>
</OverlayScrollbarsComponent>
</Box>
diff --git a/invokeai/frontend/web/src/features/ui/layouts/InitialStateMainModelPicker.tsx b/invokeai/frontend/web/src/features/ui/layouts/InitialStateMainModelPicker.tsx
index 0d71b62173..5c5a304a30 100644
--- a/invokeai/frontend/web/src/features/ui/layouts/InitialStateMainModelPicker.tsx
+++ b/invokeai/frontend/web/src/features/ui/layouts/InitialStateMainModelPicker.tsx
@@ -1,22 +1,25 @@
import { Flex, FormControl, FormLabel, Icon } from '@invoke-ai/ui-library';
-import { useAppDispatch } from 'app/store/storeHooks';
+import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
import { InformationalPopover } from 'common/components/InformationalPopover/InformationalPopover';
+import { isExternalModelUnsupportedForTab } from 'features/parameters/components/MainModel/mainModelPickerUtils';
import { ModelPicker } from 'features/parameters/components/ModelPicker';
import { modelSelected } from 'features/parameters/store/actions';
+import { selectActiveTab } from 'features/ui/store/uiSelectors';
import { memo, useCallback, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { MdMoneyOff } from 'react-icons/md';
import { useMainModels } from 'services/api/hooks/modelsByType';
import { useSelectedModelConfig } from 'services/api/hooks/useSelectedModelConfig';
-import { type AnyModelConfig, isNonCommercialMainModelConfig } from 'services/api/types';
+import { type AnyModelConfigWithExternal, isNonCommercialMainModelConfig } from 'services/api/types';
export const InitialStateMainModelPicker = memo(() => {
const { t } = useTranslation();
const dispatch = useAppDispatch();
+ const activeTab = useAppSelector(selectActiveTab);
const [modelConfigs] = useMainModels();
const selectedModelConfig = useSelectedModelConfig();
const onChange = useCallback(
- (modelConfig: AnyModelConfig) => {
+ (modelConfig: AnyModelConfigWithExternal) => {
dispatch(modelSelected(modelConfig));
},
[dispatch]
@@ -27,6 +30,11 @@ export const InitialStateMainModelPicker = memo(() => {
[selectedModelConfig]
);
+ const getIsOptionDisabled = useCallback(
+ (modelConfig: AnyModelConfigWithExternal) => isExternalModelUnsupportedForTab(modelConfig, activeTab),
+ [activeTab]
+ );
+
return (
<FormControl orientation="vertical" alignItems="unset">
<FormLabel display="flex" fontSize="md" gap={2}>
@@ -45,6 +53,7 @@ export const InitialStateMainModelPicker = memo(() => {
selectedModelConfig={selectedModelConfig}
onChange={onChange}
grouped
+ getIsOptionDisabled={getIsOptionDisabled}
/>
</FormControl>
);
diff --git a/invokeai/frontend/web/src/services/api/endpoints/appInfo.ts b/invokeai/frontend/web/src/services/api/endpoints/appInfo.ts
index 1c656d289b..653f458dde 100644
--- a/invokeai/frontend/web/src/services/api/endpoints/appInfo.ts
+++ b/invokeai/frontend/web/src/services/api/endpoints/appInfo.ts
@@ -1,7 +1,12 @@
import type { OpenAPIV3_1 } from 'openapi-types';
import type { stringify } from 'querystring';
import type { paths } from 'services/api/schema';
-import type { AppVersion } from 'services/api/types';
+import type {
+ AppVersion,
+ ExternalProviderConfig,
+ ExternalProviderConfigUpdate,
+ ExternalProviderStatus,
+} from 'services/api/types';
import { api, buildV1Url } from '..';
@@ -72,6 +77,35 @@ export const appInfoApi = api.injectEndpoints({
},
invalidatesTags: ['AppConfig'],
}),
+ getExternalProviderStatuses: build.query<ExternalProviderStatus[], void>({
+ query: () => ({
+ url: buildAppInfoUrl('external_providers/status'),
+ method: 'GET',
+ }),
+ providesTags: ['FetchOnReconnect'],
+ }),
+ getExternalProviderConfigs: build.query<ExternalProviderConfig[], void>({
+ query: () => ({
+ url: buildAppInfoUrl('external_providers/config'),
+ method: 'GET',
+ }),
+ providesTags: ['AppConfig', 'FetchOnReconnect'],
+ }),
+ setExternalProviderConfig: build.mutation<ExternalProviderConfig, SetExternalProviderConfigArg>({
+ query: ({ provider_id, ...body }) => ({
+ url: buildAppInfoUrl(`external_providers/config/${provider_id}`),
+ method: 'POST',
+ body,
+ }),
+ invalidatesTags: ['AppConfig', 'FetchOnReconnect'],
+ }),
+ resetExternalProviderConfig: build.mutation<ExternalProviderConfig, string>({
+ query: (provider_id) => ({
+ url: buildAppInfoUrl(`external_providers/config/${provider_id}`),
+ method: 'DELETE',
+ }),
+ invalidatesTags: ['AppConfig', 'FetchOnReconnect'],
+ }),
getInvocationCacheStatus: build.query<
paths['/api/v1/app/invocation_cache/status']['get']['responses']['200']['content']['application/json'],
void
@@ -115,6 +149,10 @@ export const {
useGetAppDepsQuery,
useGetPatchmatchStatusQuery,
useGetRuntimeConfigQuery,
+ useGetExternalProviderStatusesQuery,
+ useGetExternalProviderConfigsQuery,
+ useSetExternalProviderConfigMutation,
+ useResetExternalProviderConfigMutation,
useUpdateRuntimeConfigMutation,
useClearInvocationCacheMutation,
useDisableInvocationCacheMutation,
@@ -123,3 +161,7 @@ export const {
useGetOpenAPISchemaQuery,
useLazyGetOpenAPISchemaQuery,
} = appInfoApi;
+
+type SetExternalProviderConfigArg = ExternalProviderConfigUpdate & {
+ provider_id: string;
+};
diff --git a/invokeai/frontend/web/src/services/api/hooks/modelsByType.ts b/invokeai/frontend/web/src/services/api/hooks/modelsByType.ts
index 808938d906..55746e5294 100644
--- a/invokeai/frontend/web/src/services/api/hooks/modelsByType.ts
+++ b/invokeai/frontend/web/src/services/api/hooks/modelsByType.ts
@@ -9,13 +9,14 @@ import {
useGetMissingModelsQuery,
useGetModelConfigsQuery,
} from 'services/api/endpoints/models';
-import type { AnyModelConfig } from 'services/api/types';
+import type { AnyModelConfig, AnyModelConfigWithExternal, MainOrExternalModelConfig } from 'services/api/types';
import {
isAnimaQwen3EncoderModelConfig,
isAnimaVAEModelConfig,
isCLIPEmbedModelConfigOrSubmodel,
isControlLayerModelConfig,
isControlNetModelConfig,
+ isExternalApiModelConfig,
isFlux1VAEModelConfig,
isFlux2VAEModelConfig,
isFluxKontextModelConfig,
@@ -23,7 +24,7 @@ import {
isFluxVAEModelConfig,
isIPAdapterModelConfig,
isLoRAModelConfig,
- isNonRefinerMainModelConfig,
+ isMainOrExternalModelConfig,
isQwen3EncoderModelConfig,
isQwenImageDiffusersMainModelConfig,
isRefinerMainModelModelConfig,
@@ -50,16 +51,42 @@ const buildModelsHook =
modelConfigsAdapterSelectors.selectAll(missingModelsData ?? { ids: [], entities: {} }).map((m) => m.key)
);
- return modelConfigsAdapterSelectors
- .selectAll(result.data)
- .filter((config) => typeGuard(config))
+ return (modelConfigsAdapterSelectors.selectAll(result.data) as AnyModelConfigWithExternal[])
+ .filter((config): config is T => {
+ if (isExternalApiModelConfig(config)) {
+ return false;
+ }
+ return typeGuard(config as AnyModelConfig);
+ })
.filter((config) => !missingModelKeys.has(config.key))
.filter(filter);
}, [filter, result.data, missingModelsData]);
return [modelConfigs, result] as const;
};
-export const useMainModels = buildModelsHook(isNonRefinerMainModelConfig);
+
+export const useMainModels = (filter: (config: MainOrExternalModelConfig) => boolean = () => true) => {
+ const result = useGetModelConfigsQuery(undefined);
+ const { data: missingModelsData } = useGetMissingModelsQuery();
+
+ const modelConfigs = useMemo(() => {
+ if (!result.data) {
+ return EMPTY_ARRAY;
+ }
+
+ const missingModelKeys = new Set(
+ modelConfigsAdapterSelectors.selectAll(missingModelsData ?? { ids: [], entities: {} }).map((m) => m.key)
+ );
+
+ return (modelConfigsAdapterSelectors.selectAll(result.data) as AnyModelConfigWithExternal[])
+ .filter((config): config is MainOrExternalModelConfig => isMainOrExternalModelConfig(config))
+ .filter((config) => !missingModelKeys.has(config.key) || isExternalApiModelConfig(config))
+ .filter(filter);
+ }, [filter, result.data, missingModelsData]);
+
+ return [modelConfigs, result] as const;
+};
+
export const useRefinerModels = buildModelsHook(isRefinerMainModelModelConfig);
export const useLoRAModels = buildModelsHook(isLoRAModelConfig);
export const useControlLayerModels = buildModelsHook(isControlLayerModelConfig);
diff --git a/invokeai/frontend/web/src/services/api/schema.ts b/invokeai/frontend/web/src/services/api/schema.ts
index 2e93e98ad5..6c6e259fd1 100644
--- a/invokeai/frontend/web/src/services/api/schema.ts
+++ b/invokeai/frontend/web/src/services/api/schema.ts
@@ -1590,6 +1590,58 @@ export type paths = {
patch: operations["update_runtime_config"];
trace?: never;
};
+ "/api/v1/app/external_providers/status": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ /** Get External Provider Statuses */
+ get: operations["get_external_provider_statuses"];
+ put?: never;
+ post?: never;
+ delete?: never;
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
+ "/api/v1/app/external_providers/config": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ /** Get External Provider Configs */
+ get: operations["get_external_provider_configs"];
+ put?: never;
+ post?: never;
+ delete?: never;
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
+ "/api/v1/app/external_providers/config/{provider_id}": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ get?: never;
+ put?: never;
+ /** Set External Provider Config */
+ post: operations["set_external_provider_config"];
+ /** Reset External Provider Config */
+ delete: operations["reset_external_provider_config"];
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
"/api/v1/app/logging": {
parameters: {
query?: never;
@@ -3192,7 +3244,7 @@ export type components = {
*/
type: "anima_text_encoder";
};
- AnyModelConfig: components["schemas"]["Main_Diffusers_SD1_Config"] | components["schemas"]["Main_Diffusers_SD2_Config"] | components["schemas"]["Main_Diffusers_SDXL_Config"] | components["schemas"]["Main_Diffusers_SDXLRefiner_Config"] | components["schemas"]["Main_Diffusers_SD3_Config"] | components["schemas"]["Main_Diffusers_FLUX_Config"] | components["schemas"]["Main_Diffusers_Flux2_Config"] | components["schemas"]["Main_Diffusers_CogView4_Config"] | components["schemas"]["Main_Diffusers_QwenImage_Config"] | components["schemas"]["Main_Diffusers_ZImage_Config"] | components["schemas"]["Main_Checkpoint_SD1_Config"] | components["schemas"]["Main_Checkpoint_SD2_Config"] | components["schemas"]["Main_Checkpoint_SDXL_Config"] | components["schemas"]["Main_Checkpoint_SDXLRefiner_Config"] | components["schemas"]["Main_Checkpoint_Flux2_Config"] | components["schemas"]["Main_Checkpoint_FLUX_Config"] | components["schemas"]["Main_Checkpoint_ZImage_Config"] | components["schemas"]["Main_Checkpoint_Anima_Config"] | components["schemas"]["Main_BnBNF4_FLUX_Config"] | components["schemas"]["Main_GGUF_Flux2_Config"] | components["schemas"]["Main_GGUF_FLUX_Config"] | components["schemas"]["Main_GGUF_QwenImage_Config"] | components["schemas"]["Main_GGUF_ZImage_Config"] | components["schemas"]["VAE_Checkpoint_SD1_Config"] | components["schemas"]["VAE_Checkpoint_SD2_Config"] | components["schemas"]["VAE_Checkpoint_SDXL_Config"] | components["schemas"]["VAE_Checkpoint_FLUX_Config"] | components["schemas"]["VAE_Checkpoint_Flux2_Config"] | components["schemas"]["VAE_Checkpoint_Anima_Config"] | components["schemas"]["VAE_Diffusers_SD1_Config"] | components["schemas"]["VAE_Diffusers_SDXL_Config"] | components["schemas"]["VAE_Diffusers_Flux2_Config"] | components["schemas"]["ControlNet_Checkpoint_SD1_Config"] | components["schemas"]["ControlNet_Checkpoint_SD2_Config"] | components["schemas"]["ControlNet_Checkpoint_SDXL_Config"] | components["schemas"]["ControlNet_Checkpoint_FLUX_Config"] | components["schemas"]["ControlNet_Checkpoint_ZImage_Config"] | components["schemas"]["ControlNet_Diffusers_SD1_Config"] | components["schemas"]["ControlNet_Diffusers_SD2_Config"] | components["schemas"]["ControlNet_Diffusers_SDXL_Config"] | components["schemas"]["ControlNet_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_SD1_Config"] | components["schemas"]["LoRA_LyCORIS_SD2_Config"] | components["schemas"]["LoRA_LyCORIS_SDXL_Config"] | components["schemas"]["LoRA_LyCORIS_Flux2_Config"] | components["schemas"]["LoRA_LyCORIS_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_ZImage_Config"] | components["schemas"]["LoRA_LyCORIS_QwenImage_Config"] | components["schemas"]["LoRA_LyCORIS_Anima_Config"] | components["schemas"]["LoRA_OMI_SDXL_Config"] | components["schemas"]["LoRA_OMI_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_SD1_Config"] | components["schemas"]["LoRA_Diffusers_SD2_Config"] | components["schemas"]["LoRA_Diffusers_SDXL_Config"] | components["schemas"]["LoRA_Diffusers_Flux2_Config"] | components["schemas"]["LoRA_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_ZImage_Config"] | components["schemas"]["ControlLoRA_LyCORIS_FLUX_Config"] | components["schemas"]["T5Encoder_T5Encoder_Config"] | components["schemas"]["T5Encoder_BnBLLMint8_Config"] | components["schemas"]["Qwen3Encoder_Qwen3Encoder_Config"] | components["schemas"]["Qwen3Encoder_Checkpoint_Config"] | components["schemas"]["Qwen3Encoder_GGUF_Config"] | components["schemas"]["TI_File_SD1_Config"] | components["schemas"]["TI_File_SD2_Config"] | components["schemas"]["TI_File_SDXL_Config"] | components["schemas"]["TI_Folder_SD1_Config"] | components["schemas"]["TI_Folder_SD2_Config"] | components["schemas"]["TI_Folder_SDXL_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD1_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD2_Config"] | components["schemas"]["IPAdapter_InvokeAI_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD1_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD2_Config"] | components["schemas"]["IPAdapter_Checkpoint_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_FLUX_Config"] | components["schemas"]["T2IAdapter_Diffusers_SD1_Config"] | components["schemas"]["T2IAdapter_Diffusers_SDXL_Config"] | components["schemas"]["Spandrel_Checkpoint_Config"] | components["schemas"]["CLIPEmbed_Diffusers_G_Config"] | components["schemas"]["CLIPEmbed_Diffusers_L_Config"] | components["schemas"]["CLIPVision_Diffusers_Config"] | components["schemas"]["SigLIP_Diffusers_Config"] | components["schemas"]["FLUXRedux_Checkpoint_Config"] | components["schemas"]["LlavaOnevision_Diffusers_Config"] | components["schemas"]["Unknown_Config"];
+ AnyModelConfig: components["schemas"]["Main_Diffusers_SD1_Config"] | components["schemas"]["Main_Diffusers_SD2_Config"] | components["schemas"]["Main_Diffusers_SDXL_Config"] | components["schemas"]["Main_Diffusers_SDXLRefiner_Config"] | components["schemas"]["Main_Diffusers_SD3_Config"] | components["schemas"]["Main_Diffusers_FLUX_Config"] | components["schemas"]["Main_Diffusers_Flux2_Config"] | components["schemas"]["Main_Diffusers_CogView4_Config"] | components["schemas"]["Main_Diffusers_QwenImage_Config"] | components["schemas"]["Main_Diffusers_ZImage_Config"] | components["schemas"]["Main_Checkpoint_SD1_Config"] | components["schemas"]["Main_Checkpoint_SD2_Config"] | components["schemas"]["Main_Checkpoint_SDXL_Config"] | components["schemas"]["Main_Checkpoint_SDXLRefiner_Config"] | components["schemas"]["Main_Checkpoint_Flux2_Config"] | components["schemas"]["Main_Checkpoint_FLUX_Config"] | components["schemas"]["Main_Checkpoint_ZImage_Config"] | components["schemas"]["Main_Checkpoint_Anima_Config"] | components["schemas"]["Main_BnBNF4_FLUX_Config"] | components["schemas"]["Main_GGUF_Flux2_Config"] | components["schemas"]["Main_GGUF_FLUX_Config"] | components["schemas"]["Main_GGUF_QwenImage_Config"] | components["schemas"]["Main_GGUF_ZImage_Config"] | components["schemas"]["VAE_Checkpoint_SD1_Config"] | components["schemas"]["VAE_Checkpoint_SD2_Config"] | components["schemas"]["VAE_Checkpoint_SDXL_Config"] | components["schemas"]["VAE_Checkpoint_FLUX_Config"] | components["schemas"]["VAE_Checkpoint_Flux2_Config"] | components["schemas"]["VAE_Checkpoint_Anima_Config"] | components["schemas"]["VAE_Diffusers_SD1_Config"] | components["schemas"]["VAE_Diffusers_SDXL_Config"] | components["schemas"]["VAE_Diffusers_Flux2_Config"] | components["schemas"]["ControlNet_Checkpoint_SD1_Config"] | components["schemas"]["ControlNet_Checkpoint_SD2_Config"] | components["schemas"]["ControlNet_Checkpoint_SDXL_Config"] | components["schemas"]["ControlNet_Checkpoint_FLUX_Config"] | components["schemas"]["ControlNet_Checkpoint_ZImage_Config"] | components["schemas"]["ControlNet_Diffusers_SD1_Config"] | components["schemas"]["ControlNet_Diffusers_SD2_Config"] | components["schemas"]["ControlNet_Diffusers_SDXL_Config"] | components["schemas"]["ControlNet_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_SD1_Config"] | components["schemas"]["LoRA_LyCORIS_SD2_Config"] | components["schemas"]["LoRA_LyCORIS_SDXL_Config"] | components["schemas"]["LoRA_LyCORIS_Flux2_Config"] | components["schemas"]["LoRA_LyCORIS_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_ZImage_Config"] | components["schemas"]["LoRA_LyCORIS_QwenImage_Config"] | components["schemas"]["LoRA_LyCORIS_Anima_Config"] | components["schemas"]["LoRA_OMI_SDXL_Config"] | components["schemas"]["LoRA_OMI_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_SD1_Config"] | components["schemas"]["LoRA_Diffusers_SD2_Config"] | components["schemas"]["LoRA_Diffusers_SDXL_Config"] | components["schemas"]["LoRA_Diffusers_Flux2_Config"] | components["schemas"]["LoRA_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_ZImage_Config"] | components["schemas"]["ControlLoRA_LyCORIS_FLUX_Config"] | components["schemas"]["T5Encoder_T5Encoder_Config"] | components["schemas"]["T5Encoder_BnBLLMint8_Config"] | components["schemas"]["Qwen3Encoder_Qwen3Encoder_Config"] | components["schemas"]["Qwen3Encoder_Checkpoint_Config"] | components["schemas"]["Qwen3Encoder_GGUF_Config"] | components["schemas"]["TI_File_SD1_Config"] | components["schemas"]["TI_File_SD2_Config"] | components["schemas"]["TI_File_SDXL_Config"] | components["schemas"]["TI_Folder_SD1_Config"] | components["schemas"]["TI_Folder_SD2_Config"] | components["schemas"]["TI_Folder_SDXL_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD1_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD2_Config"] | components["schemas"]["IPAdapter_InvokeAI_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD1_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD2_Config"] | components["schemas"]["IPAdapter_Checkpoint_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_FLUX_Config"] | components["schemas"]["T2IAdapter_Diffusers_SD1_Config"] | components["schemas"]["T2IAdapter_Diffusers_SDXL_Config"] | components["schemas"]["Spandrel_Checkpoint_Config"] | components["schemas"]["CLIPEmbed_Diffusers_G_Config"] | components["schemas"]["CLIPEmbed_Diffusers_L_Config"] | components["schemas"]["CLIPVision_Diffusers_Config"] | components["schemas"]["SigLIP_Diffusers_Config"] | components["schemas"]["FLUXRedux_Checkpoint_Config"] | components["schemas"]["LlavaOnevision_Diffusers_Config"] | components["schemas"]["ExternalApiModelConfig"] | components["schemas"]["Unknown_Config"];
/**
* AppVersion
* @description App Version Response
@@ -3344,7 +3396,7 @@ export type components = {
* fallback/null value `BaseModelType.Any` for these models, instead of making the model base optional.
* @enum {string}
*/
- BaseModelType: "any" | "sd-1" | "sd-2" | "sd-3" | "sdxl" | "sdxl-refiner" | "flux" | "flux2" | "cogview4" | "z-image" | "qwen-image" | "anima" | "unknown";
+ BaseModelType: "any" | "sd-1" | "sd-2" | "sd-3" | "sdxl" | "sdxl-refiner" | "flux" | "flux2" | "cogview4" | "z-image" | "external" | "qwen-image" | "anima" | "unknown";
/** Batch */
Batch: {
/**
@@ -8654,6 +8706,279 @@ export type components = {
/** Fieldname */
fieldName: string;
};
+ /** ExternalApiModelConfig */
+ ExternalApiModelConfig: {
+ /**
+ * Key
+ * @description A unique key for this model.
+ */
+ key: string;
+ /**
+ * Hash
+ * @default
+ */
+ hash: string;
+ /**
+ * Path
+ * @default
+ */
+ path: string;
+ /**
+ * File Size
+ * @default 0
+ */
+ file_size: number;
+ /**
+ * Name
+ * @description Name of the model.
+ */
+ name: string;
+ /**
+ * Description
+ * @description Model description
+ */
+ description: string | null;
+ /**
+ * Source
+ * @default
+ */
+ source: string;
+ /** @default external */
+ source_type: components["schemas"]["ModelSourceType"];
+ /**
+ * Source Api Response
+ * @description The original API response from the source, as stringified JSON.
+ */
+ source_api_response: string | null;
+ /**
+ * Cover Image
+ * @description Url for image to preview model
+ */
+ cover_image: string | null;
+ /**
+ * Base
+ * @default external
+ * @constant
+ */
+ base: "external";
+ /**
+ * Type
+ * @default external_image_generator
+ * @constant
+ */
+ type: "external_image_generator";
+ /**
+ * Format
+ * @default external_api
+ * @constant
+ */
+ format: "external_api";
+ /**
+ * Provider Id
+ * @description External provider ID
+ */
+ provider_id: string;
+ /**
+ * Provider Model Id
+ * @description Provider-specific model ID
+ */
+ provider_model_id: string;
+ /** @description Provider capability matrix */
+ capabilities: components["schemas"]["ExternalModelCapabilities"];
+ default_settings: components["schemas"]["ExternalApiModelDefaultSettings"] | null;
+ panel_schema: components["schemas"]["ExternalModelPanelSchema"] | null;
+ /** Tags */
+ tags: string[] | null;
+ /**
+ * Is Default
+ * @default false
+ */
+ is_default: boolean;
+ };
+ /** ExternalApiModelDefaultSettings */
+ ExternalApiModelDefaultSettings: {
+ /** Width */
+ width?: number | null;
+ /** Height */
+ height?: number | null;
+ /** Num Images */
+ num_images?: number | null;
+ };
+ /** ExternalImageSize */
+ ExternalImageSize: {
+ /** Width */
+ width: number;
+ /** Height */
+ height: number;
+ };
+ /** ExternalModelCapabilities */
+ ExternalModelCapabilities: {
+ /** Modes */
+ modes?: ("txt2img" | "img2img" | "inpaint")[];
+ /**
+ * Supports Reference Images
+ * @default false
+ */
+ supports_reference_images?: boolean;
+ /**
+ * Supports Negative Prompt
+ * @default true
+ */
+ supports_negative_prompt?: boolean;
+ /**
+ * Supports Seed
+ * @default false
+ */
+ supports_seed?: boolean;
+ /**
+ * Supports Guidance
+ * @default false
+ */
+ supports_guidance?: boolean;
+ /**
+ * Supports Steps
+ * @default false
+ */
+ supports_steps?: boolean;
+ /** Max Images Per Request */
+ max_images_per_request?: number | null;
+ max_image_size?: components["schemas"]["ExternalImageSize"] | null;
+ /** Allowed Aspect Ratios */
+ allowed_aspect_ratios?: string[] | null;
+ /** Aspect Ratio Sizes */
+ aspect_ratio_sizes?: {
+ [key: string]: components["schemas"]["ExternalImageSize"];
+ } | null;
+ /** Resolution Presets */
+ resolution_presets?: components["schemas"]["ExternalResolutionPreset"][] | null;
+ /** Max Reference Images */
+ max_reference_images?: number | null;
+ /**
+ * Mask Format
+ * @default none
+ * @enum {string}
+ */
+ mask_format?: "alpha" | "binary" | "none";
+ /** Input Image Required For */
+ input_image_required_for?: ("txt2img" | "img2img" | "inpaint")[] | null;
+ };
+ /** ExternalModelPanelControl */
+ ExternalModelPanelControl: {
+ /**
+ * Name
+ * @enum {string}
+ */
+ name: "reference_images" | "dimensions" | "seed";
+ /** Slider Min */
+ slider_min?: number | null;
+ /** Slider Max */
+ slider_max?: number | null;
+ /** Number Input Min */
+ number_input_min?: number | null;
+ /** Number Input Max */
+ number_input_max?: number | null;
+ /** Fine Step */
+ fine_step?: number | null;
+ /** Coarse Step */
+ coarse_step?: number | null;
+ /** Marks */
+ marks?: number[] | null;
+ };
+ /** ExternalModelPanelSchema */
+ ExternalModelPanelSchema: {
+ /** Prompts */
+ prompts?: components["schemas"]["ExternalModelPanelControl"][];
+ /** Image */
+ image?: components["schemas"]["ExternalModelPanelControl"][];
+ /** Generation */
+ generation?: components["schemas"]["ExternalModelPanelControl"][];
+ };
+ /**
+ * ExternalModelSource
+ * @description An external provider model identifier.
+ */
+ ExternalModelSource: {
+ /** Provider Id */
+ provider_id: string;
+ /** Provider Model Id */
+ provider_model_id: string;
+ /**
+ * @description discriminator enum property added by openapi-typescript
+ * @enum {string}
+ */
+ type: "external";
+ };
+ /** ExternalProviderConfigModel */
+ ExternalProviderConfigModel: {
+ /**
+ * Provider Id
+ * @description The external provider identifier
+ */
+ provider_id: string;
+ /**
+ * Api Key Configured
+ * @description Whether an API key is configured
+ */
+ api_key_configured: boolean;
+ /**
+ * Base Url
+ * @description Optional base URL override
+ */
+ base_url?: string | null;
+ };
+ /** ExternalProviderConfigUpdate */
+ ExternalProviderConfigUpdate: {
+ /**
+ * Api Key
+ * @description API key for the external provider
+ */
+ api_key?: string | null;
+ /**
+ * Base Url
+ * @description Optional base URL override for the provider
+ */
+ base_url?: string | null;
+ };
+ /** ExternalProviderStatusModel */
+ ExternalProviderStatusModel: {
+ /**
+ * Provider Id
+ * @description The external provider identifier
+ */
+ provider_id: string;
+ /**
+ * Configured
+ * @description Whether credentials are configured for the provider
+ */
+ configured: boolean;
+ /**
+ * Message
+ * @description Optional provider status detail
+ */
+ message?: string | null;
+ };
+ /** ExternalResolutionPreset */
+ ExternalResolutionPreset: {
+ /**
+ * Label
+ * @description Display label, e.g. '1:1 (1K)'
+ */
+ label: string;
+ /**
+ * Aspect Ratio
+ * @description Aspect ratio string, e.g. '1:1'
+ */
+ aspect_ratio: string;
+ /**
+ * Image Size
+ * @description Image size preset, e.g. '1K'
+ */
+ image_size: string;
+ /** Width */
+ width: number;
+ /** Height */
+ height: number;
+ };
/**
* Apply LoRA Collection - FLUX
* @description Applies a collection of LoRAs to a FLUX transformer.
@@ -11293,6 +11618,115 @@ export type components = {
*/
type: "freeu";
};
+ /**
+ * Gemini Image Generation
+ * @description Generate images using a Gemini-hosted external model.
+ */
+ GeminiImageGenerationInvocation: {
+ /**
+ * @description The board to save the image to
+ * @default null
+ */
+ board?: components["schemas"]["BoardField"] | null;
+ /**
+ * @description Optional metadata to be saved with the image
+ * @default null
+ */
+ metadata?: components["schemas"]["MetadataField"] | null;
+ /**
+ * Id
+ * @description The id of this instance of an invocation. Must be unique among all instances of invocations.
+ */
+ id: string;
+ /**
+ * Is Intermediate
+ * @description Whether or not this is an intermediate invocation.
+ * @default false
+ */
+ is_intermediate?: boolean;
+ /**
+ * Use Cache
+ * @description Whether or not to use the cache
+ * @default true
+ */
+ use_cache?: boolean;
+ /**
+ * @description Main model (UNet, VAE, CLIP) to load
+ * @default null
+ */
+ model?: components["schemas"]["ModelIdentifierField"] | null;
+ /**
+ * Mode
+ * @description Generation mode.
+ * @default txt2img
+ * @enum {string}
+ */
+ mode?: "txt2img" | "img2img" | "inpaint";
+ /**
+ * Prompt
+ * @description Prompt
+ * @default null
+ */
+ prompt?: string | null;
+ /**
+ * Seed
+ * @description Seed for random number generation
+ * @default null
+ */
+ seed?: number | null;
+ /**
+ * Num Images
+ * @description Number of images to generate
+ * @default 1
+ */
+ num_images?: number;
+ /**
+ * Width
+ * @description Width of output (px)
+ * @default 1024
+ */
+ width?: number;
+ /**
+ * Height
+ * @description Height of output (px)
+ * @default 1024
+ */
+ height?: number;
+ /**
+ * Image Size
+ * @description Image size preset (e.g. 1K, 2K, 4K)
+ * @default null
+ */
+ image_size?: string | null;
+ /**
+ * @description Init image for img2img/inpaint
+ * @default null
+ */
+ init_image?: components["schemas"]["ImageField"] | null;
+ /**
+ * @description Mask image for inpaint
+ * @default null
+ */
+ mask_image?: components["schemas"]["ImageField"] | null;
+ /**
+ * Reference Images
+ * @description Reference images
+ * @default []
+ */
+ reference_images?: components["schemas"]["ImageField"][];
+ /**
+ * Temperature
+ * @description Sampling temperature
+ * @default null
+ */
+ temperature?: number | null;
+ /**
+ * type
+ * @default gemini_image_generation
+ * @constant
+ */
+ type: "gemini_image_generation";
+ };
/**
* GeneratePasswordResponse
* @description Response containing a generated password.
@@ -11392,7 +11826,7 @@ export type components = {
* @description The nodes in this graph
*/
nodes?: {
- [key: string]: components["schemas"]["AddInvocation"] | components["schemas"]["AlphaMaskToTensorInvocation"] | components["schemas"]["AnimaDenoiseInvocation"] | components["schemas"]["AnimaImageToLatentsInvocation"] | components["schemas"]["AnimaLatentsToImageInvocation"] | components["schemas"]["AnimaLoRACollectionLoader"] | components["schemas"]["AnimaLoRALoaderInvocation"] | components["schemas"]["AnimaModelLoaderInvocation"] | components["schemas"]["AnimaTextEncoderInvocation"] | components["schemas"]["ApplyMaskTensorToImageInvocation"] | components["schemas"]["ApplyMaskToImageInvocation"] | components["schemas"]["BlankImageInvocation"] | components["schemas"]["BlendLatentsInvocation"] | components["schemas"]["BooleanCollectionInvocation"] | components["schemas"]["BooleanInvocation"] | components["schemas"]["BoundingBoxInvocation"] | components["schemas"]["CLIPSkipInvocation"] | components["schemas"]["CV2InfillInvocation"] | components["schemas"]["CalculateImageTilesEvenSplitInvocation"] | components["schemas"]["CalculateImageTilesInvocation"] | components["schemas"]["CalculateImageTilesMinimumOverlapInvocation"] | components["schemas"]["CannyEdgeDetectionInvocation"] | components["schemas"]["CanvasOutputInvocation"] | components["schemas"]["CanvasPasteBackInvocation"] | components["schemas"]["CanvasV2MaskAndCropInvocation"] | components["schemas"]["CenterPadCropInvocation"] | components["schemas"]["CogView4DenoiseInvocation"] | components["schemas"]["CogView4ImageToLatentsInvocation"] | components["schemas"]["CogView4LatentsToImageInvocation"] | components["schemas"]["CogView4ModelLoaderInvocation"] | components["schemas"]["CogView4TextEncoderInvocation"] | components["schemas"]["CollectInvocation"] | components["schemas"]["ColorCorrectInvocation"] | components["schemas"]["ColorInvocation"] | components["schemas"]["ColorMapInvocation"] | components["schemas"]["CompelInvocation"] | components["schemas"]["ConditioningCollectionInvocation"] | components["schemas"]["ConditioningInvocation"] | components["schemas"]["ContentShuffleInvocation"] | components["schemas"]["ControlNetInvocation"] | components["schemas"]["CoreMetadataInvocation"] | components["schemas"]["CreateDenoiseMaskInvocation"] | components["schemas"]["CreateGradientMaskInvocation"] | components["schemas"]["CropImageToBoundingBoxInvocation"] | components["schemas"]["CropLatentsCoreInvocation"] | components["schemas"]["CvInpaintInvocation"] | components["schemas"]["DWOpenposeDetectionInvocation"] | components["schemas"]["DecodeInvisibleWatermarkInvocation"] | components["schemas"]["DenoiseLatentsInvocation"] | components["schemas"]["DenoiseLatentsMetaInvocation"] | components["schemas"]["DepthAnythingDepthEstimationInvocation"] | components["schemas"]["DivideInvocation"] | components["schemas"]["DynamicPromptInvocation"] | components["schemas"]["ESRGANInvocation"] | components["schemas"]["ExpandMaskWithFadeInvocation"] | components["schemas"]["FLUXLoRACollectionLoader"] | components["schemas"]["FaceIdentifierInvocation"] | components["schemas"]["FaceMaskInvocation"] | components["schemas"]["FaceOffInvocation"] | components["schemas"]["FloatBatchInvocation"] | components["schemas"]["FloatCollectionInvocation"] | components["schemas"]["FloatGenerator"] | components["schemas"]["FloatInvocation"] | components["schemas"]["FloatLinearRangeInvocation"] | components["schemas"]["FloatMathInvocation"] | components["schemas"]["FloatToIntegerInvocation"] | components["schemas"]["Flux2DenoiseInvocation"] | components["schemas"]["Flux2KleinLoRACollectionLoader"] | components["schemas"]["Flux2KleinLoRALoaderInvocation"] | components["schemas"]["Flux2KleinModelLoaderInvocation"] | components["schemas"]["Flux2KleinTextEncoderInvocation"] | components["schemas"]["Flux2VaeDecodeInvocation"] | components["schemas"]["Flux2VaeEncodeInvocation"] | components["schemas"]["FluxControlLoRALoaderInvocation"] | components["schemas"]["FluxControlNetInvocation"] | components["schemas"]["FluxDenoiseInvocation"] | components["schemas"]["FluxDenoiseLatentsMetaInvocation"] | components["schemas"]["FluxFillInvocation"] | components["schemas"]["FluxIPAdapterInvocation"] | components["schemas"]["FluxKontextConcatenateImagesInvocation"] | components["schemas"]["FluxKontextInvocation"] | components["schemas"]["FluxLoRALoaderInvocation"] | components["schemas"]["FluxModelLoaderInvocation"] | components["schemas"]["FluxReduxInvocation"] | components["schemas"]["FluxTextEncoderInvocation"] | components["schemas"]["FluxVaeDecodeInvocation"] | components["schemas"]["FluxVaeEncodeInvocation"] | components["schemas"]["FreeUInvocation"] | components["schemas"]["GetMaskBoundingBoxInvocation"] | components["schemas"]["GroundingDinoInvocation"] | components["schemas"]["HEDEdgeDetectionInvocation"] | components["schemas"]["HeuristicResizeInvocation"] | components["schemas"]["IPAdapterInvocation"] | components["schemas"]["IdealSizeInvocation"] | components["schemas"]["IfInvocation"] | components["schemas"]["ImageBatchInvocation"] | components["schemas"]["ImageBlurInvocation"] | components["schemas"]["ImageChannelInvocation"] | components["schemas"]["ImageChannelMultiplyInvocation"] | components["schemas"]["ImageChannelOffsetInvocation"] | components["schemas"]["ImageCollectionInvocation"] | components["schemas"]["ImageConvertInvocation"] | components["schemas"]["ImageCropInvocation"] | components["schemas"]["ImageGenerator"] | components["schemas"]["ImageHueAdjustmentInvocation"] | components["schemas"]["ImageInverseLerpInvocation"] | components["schemas"]["ImageInvocation"] | components["schemas"]["ImageLerpInvocation"] | components["schemas"]["ImageMaskToTensorInvocation"] | components["schemas"]["ImageMultiplyInvocation"] | components["schemas"]["ImageNSFWBlurInvocation"] | components["schemas"]["ImageNoiseInvocation"] | components["schemas"]["ImagePanelLayoutInvocation"] | components["schemas"]["ImagePasteInvocation"] | components["schemas"]["ImageResizeInvocation"] | components["schemas"]["ImageScaleInvocation"] | components["schemas"]["ImageToLatentsInvocation"] | components["schemas"]["ImageWatermarkInvocation"] | components["schemas"]["InfillColorInvocation"] | components["schemas"]["InfillPatchMatchInvocation"] | components["schemas"]["InfillTileInvocation"] | components["schemas"]["IntegerBatchInvocation"] | components["schemas"]["IntegerCollectionInvocation"] | components["schemas"]["IntegerGenerator"] | components["schemas"]["IntegerInvocation"] | components["schemas"]["IntegerMathInvocation"] | components["schemas"]["InvertTensorMaskInvocation"] | components["schemas"]["InvokeAdjustImageHuePlusInvocation"] | components["schemas"]["InvokeEquivalentAchromaticLightnessInvocation"] | components["schemas"]["InvokeImageBlendInvocation"] | components["schemas"]["InvokeImageCompositorInvocation"] | components["schemas"]["InvokeImageDilateOrErodeInvocation"] | components["schemas"]["InvokeImageEnhanceInvocation"] | components["schemas"]["InvokeImageValueThresholdsInvocation"] | components["schemas"]["IterateInvocation"] | components["schemas"]["LaMaInfillInvocation"] | components["schemas"]["LatentsCollectionInvocation"] | components["schemas"]["LatentsInvocation"] | components["schemas"]["LatentsToImageInvocation"] | components["schemas"]["LineartAnimeEdgeDetectionInvocation"] | components["schemas"]["LineartEdgeDetectionInvocation"] | components["schemas"]["LlavaOnevisionVllmInvocation"] | components["schemas"]["LoRACollectionLoader"] | components["schemas"]["LoRALoaderInvocation"] | components["schemas"]["LoRASelectorInvocation"] | components["schemas"]["MLSDDetectionInvocation"] | components["schemas"]["MainModelLoaderInvocation"] | components["schemas"]["MaskCombineInvocation"] | components["schemas"]["MaskEdgeInvocation"] | components["schemas"]["MaskFromAlphaInvocation"] | components["schemas"]["MaskFromIDInvocation"] | components["schemas"]["MaskTensorToImageInvocation"] | components["schemas"]["MediaPipeFaceDetectionInvocation"] | components["schemas"]["MergeMetadataInvocation"] | components["schemas"]["MergeTilesToImageInvocation"] | components["schemas"]["MetadataFieldExtractorInvocation"] | components["schemas"]["MetadataFromImageInvocation"] | components["schemas"]["MetadataInvocation"] | components["schemas"]["MetadataItemInvocation"] | components["schemas"]["MetadataItemLinkedInvocation"] | components["schemas"]["MetadataToBoolCollectionInvocation"] | components["schemas"]["MetadataToBoolInvocation"] | components["schemas"]["MetadataToControlnetsInvocation"] | components["schemas"]["MetadataToFloatCollectionInvocation"] | components["schemas"]["MetadataToFloatInvocation"] | components["schemas"]["MetadataToIPAdaptersInvocation"] | components["schemas"]["MetadataToIntegerCollectionInvocation"] | components["schemas"]["MetadataToIntegerInvocation"] | components["schemas"]["MetadataToLorasCollectionInvocation"] | components["schemas"]["MetadataToLorasInvocation"] | components["schemas"]["MetadataToModelInvocation"] | components["schemas"]["MetadataToSDXLLorasInvocation"] | components["schemas"]["MetadataToSDXLModelInvocation"] | components["schemas"]["MetadataToSchedulerInvocation"] | components["schemas"]["MetadataToStringCollectionInvocation"] | components["schemas"]["MetadataToStringInvocation"] | components["schemas"]["MetadataToT2IAdaptersInvocation"] | components["schemas"]["MetadataToVAEInvocation"] | components["schemas"]["ModelIdentifierInvocation"] | components["schemas"]["MultiplyInvocation"] | components["schemas"]["NoiseInvocation"] | components["schemas"]["NormalMapInvocation"] | components["schemas"]["PBRMapsInvocation"] | components["schemas"]["PairTileImageInvocation"] | components["schemas"]["PasteImageIntoBoundingBoxInvocation"] | components["schemas"]["PiDiNetEdgeDetectionInvocation"] | components["schemas"]["PromptTemplateInvocation"] | components["schemas"]["PromptsFromFileInvocation"] | components["schemas"]["QwenImageDenoiseInvocation"] | components["schemas"]["QwenImageImageToLatentsInvocation"] | components["schemas"]["QwenImageLatentsToImageInvocation"] | components["schemas"]["QwenImageLoRACollectionLoader"] | components["schemas"]["QwenImageLoRALoaderInvocation"] | components["schemas"]["QwenImageModelLoaderInvocation"] | components["schemas"]["QwenImageTextEncoderInvocation"] | components["schemas"]["RandomFloatInvocation"] | components["schemas"]["RandomIntInvocation"] | components["schemas"]["RandomRangeInvocation"] | components["schemas"]["RangeInvocation"] | components["schemas"]["RangeOfSizeInvocation"] | components["schemas"]["RectangleMaskInvocation"] | components["schemas"]["ResizeLatentsInvocation"] | components["schemas"]["RoundInvocation"] | components["schemas"]["SD3DenoiseInvocation"] | components["schemas"]["SD3ImageToLatentsInvocation"] | components["schemas"]["SD3LatentsToImageInvocation"] | components["schemas"]["SDXLCompelPromptInvocation"] | components["schemas"]["SDXLLoRACollectionLoader"] | components["schemas"]["SDXLLoRALoaderInvocation"] | components["schemas"]["SDXLModelLoaderInvocation"] | components["schemas"]["SDXLRefinerCompelPromptInvocation"] | components["schemas"]["SDXLRefinerModelLoaderInvocation"] | components["schemas"]["SaveImageInvocation"] | components["schemas"]["ScaleLatentsInvocation"] | components["schemas"]["SchedulerInvocation"] | components["schemas"]["Sd3ModelLoaderInvocation"] | components["schemas"]["Sd3TextEncoderInvocation"] | components["schemas"]["SeamlessModeInvocation"] | components["schemas"]["SegmentAnythingInvocation"] | components["schemas"]["ShowImageInvocation"] | components["schemas"]["SpandrelImageToImageAutoscaleInvocation"] | components["schemas"]["SpandrelImageToImageInvocation"] | components["schemas"]["StringBatchInvocation"] | components["schemas"]["StringCollectionInvocation"] | components["schemas"]["StringGenerator"] | components["schemas"]["StringInvocation"] | components["schemas"]["StringJoinInvocation"] | components["schemas"]["StringJoinThreeInvocation"] | components["schemas"]["StringReplaceInvocation"] | components["schemas"]["StringSplitInvocation"] | components["schemas"]["StringSplitNegInvocation"] | components["schemas"]["SubtractInvocation"] | components["schemas"]["T2IAdapterInvocation"] | components["schemas"]["TileToPropertiesInvocation"] | components["schemas"]["TiledMultiDiffusionDenoiseLatents"] | components["schemas"]["UnsharpMaskInvocation"] | components["schemas"]["VAELoaderInvocation"] | components["schemas"]["ZImageControlInvocation"] | components["schemas"]["ZImageDenoiseInvocation"] | components["schemas"]["ZImageDenoiseMetaInvocation"] | components["schemas"]["ZImageImageToLatentsInvocation"] | components["schemas"]["ZImageLatentsToImageInvocation"] | components["schemas"]["ZImageLoRACollectionLoader"] | components["schemas"]["ZImageLoRALoaderInvocation"] | components["schemas"]["ZImageModelLoaderInvocation"] | components["schemas"]["ZImageSeedVarianceEnhancerInvocation"] | components["schemas"]["ZImageTextEncoderInvocation"];
+ [key: string]: components["schemas"]["AddInvocation"] | components["schemas"]["AlphaMaskToTensorInvocation"] | components["schemas"]["AnimaDenoiseInvocation"] | components["schemas"]["AnimaImageToLatentsInvocation"] | components["schemas"]["AnimaLatentsToImageInvocation"] | components["schemas"]["AnimaLoRACollectionLoader"] | components["schemas"]["AnimaLoRALoaderInvocation"] | components["schemas"]["AnimaModelLoaderInvocation"] | components["schemas"]["AnimaTextEncoderInvocation"] | components["schemas"]["ApplyMaskTensorToImageInvocation"] | components["schemas"]["ApplyMaskToImageInvocation"] | components["schemas"]["BlankImageInvocation"] | components["schemas"]["BlendLatentsInvocation"] | components["schemas"]["BooleanCollectionInvocation"] | components["schemas"]["BooleanInvocation"] | components["schemas"]["BoundingBoxInvocation"] | components["schemas"]["CLIPSkipInvocation"] | components["schemas"]["CV2InfillInvocation"] | components["schemas"]["CalculateImageTilesEvenSplitInvocation"] | components["schemas"]["CalculateImageTilesInvocation"] | components["schemas"]["CalculateImageTilesMinimumOverlapInvocation"] | components["schemas"]["CannyEdgeDetectionInvocation"] | components["schemas"]["CanvasOutputInvocation"] | components["schemas"]["CanvasPasteBackInvocation"] | components["schemas"]["CanvasV2MaskAndCropInvocation"] | components["schemas"]["CenterPadCropInvocation"] | components["schemas"]["CogView4DenoiseInvocation"] | components["schemas"]["CogView4ImageToLatentsInvocation"] | components["schemas"]["CogView4LatentsToImageInvocation"] | components["schemas"]["CogView4ModelLoaderInvocation"] | components["schemas"]["CogView4TextEncoderInvocation"] | components["schemas"]["CollectInvocation"] | components["schemas"]["ColorCorrectInvocation"] | components["schemas"]["ColorInvocation"] | components["schemas"]["ColorMapInvocation"] | components["schemas"]["CompelInvocation"] | components["schemas"]["ConditioningCollectionInvocation"] | components["schemas"]["ConditioningInvocation"] | components["schemas"]["ContentShuffleInvocation"] | components["schemas"]["ControlNetInvocation"] | components["schemas"]["CoreMetadataInvocation"] | components["schemas"]["CreateDenoiseMaskInvocation"] | components["schemas"]["CreateGradientMaskInvocation"] | components["schemas"]["CropImageToBoundingBoxInvocation"] | components["schemas"]["CropLatentsCoreInvocation"] | components["schemas"]["CvInpaintInvocation"] | components["schemas"]["DWOpenposeDetectionInvocation"] | components["schemas"]["DecodeInvisibleWatermarkInvocation"] | components["schemas"]["DenoiseLatentsInvocation"] | components["schemas"]["DenoiseLatentsMetaInvocation"] | components["schemas"]["DepthAnythingDepthEstimationInvocation"] | components["schemas"]["DivideInvocation"] | components["schemas"]["DynamicPromptInvocation"] | components["schemas"]["ESRGANInvocation"] | components["schemas"]["ExpandMaskWithFadeInvocation"] | components["schemas"]["FLUXLoRACollectionLoader"] | components["schemas"]["FaceIdentifierInvocation"] | components["schemas"]["FaceMaskInvocation"] | components["schemas"]["FaceOffInvocation"] | components["schemas"]["FloatBatchInvocation"] | components["schemas"]["FloatCollectionInvocation"] | components["schemas"]["FloatGenerator"] | components["schemas"]["FloatInvocation"] | components["schemas"]["FloatLinearRangeInvocation"] | components["schemas"]["FloatMathInvocation"] | components["schemas"]["FloatToIntegerInvocation"] | components["schemas"]["Flux2DenoiseInvocation"] | components["schemas"]["Flux2KleinLoRACollectionLoader"] | components["schemas"]["Flux2KleinLoRALoaderInvocation"] | components["schemas"]["Flux2KleinModelLoaderInvocation"] | components["schemas"]["Flux2KleinTextEncoderInvocation"] | components["schemas"]["Flux2VaeDecodeInvocation"] | components["schemas"]["Flux2VaeEncodeInvocation"] | components["schemas"]["FluxControlLoRALoaderInvocation"] | components["schemas"]["FluxControlNetInvocation"] | components["schemas"]["FluxDenoiseInvocation"] | components["schemas"]["FluxDenoiseLatentsMetaInvocation"] | components["schemas"]["FluxFillInvocation"] | components["schemas"]["FluxIPAdapterInvocation"] | components["schemas"]["FluxKontextConcatenateImagesInvocation"] | components["schemas"]["FluxKontextInvocation"] | components["schemas"]["FluxLoRALoaderInvocation"] | components["schemas"]["FluxModelLoaderInvocation"] | components["schemas"]["FluxReduxInvocation"] | components["schemas"]["FluxTextEncoderInvocation"] | components["schemas"]["FluxVaeDecodeInvocation"] | components["schemas"]["FluxVaeEncodeInvocation"] | components["schemas"]["FreeUInvocation"] | components["schemas"]["GeminiImageGenerationInvocation"] | components["schemas"]["GetMaskBoundingBoxInvocation"] | components["schemas"]["GroundingDinoInvocation"] | components["schemas"]["HEDEdgeDetectionInvocation"] | components["schemas"]["HeuristicResizeInvocation"] | components["schemas"]["IPAdapterInvocation"] | components["schemas"]["IdealSizeInvocation"] | components["schemas"]["IfInvocation"] | components["schemas"]["ImageBatchInvocation"] | components["schemas"]["ImageBlurInvocation"] | components["schemas"]["ImageChannelInvocation"] | components["schemas"]["ImageChannelMultiplyInvocation"] | components["schemas"]["ImageChannelOffsetInvocation"] | components["schemas"]["ImageCollectionInvocation"] | components["schemas"]["ImageConvertInvocation"] | components["schemas"]["ImageCropInvocation"] | components["schemas"]["ImageGenerator"] | components["schemas"]["ImageHueAdjustmentInvocation"] | components["schemas"]["ImageInverseLerpInvocation"] | components["schemas"]["ImageInvocation"] | components["schemas"]["ImageLerpInvocation"] | components["schemas"]["ImageMaskToTensorInvocation"] | components["schemas"]["ImageMultiplyInvocation"] | components["schemas"]["ImageNSFWBlurInvocation"] | components["schemas"]["ImageNoiseInvocation"] | components["schemas"]["ImagePanelLayoutInvocation"] | components["schemas"]["ImagePasteInvocation"] | components["schemas"]["ImageResizeInvocation"] | components["schemas"]["ImageScaleInvocation"] | components["schemas"]["ImageToLatentsInvocation"] | components["schemas"]["ImageWatermarkInvocation"] | components["schemas"]["InfillColorInvocation"] | components["schemas"]["InfillPatchMatchInvocation"] | components["schemas"]["InfillTileInvocation"] | components["schemas"]["IntegerBatchInvocation"] | components["schemas"]["IntegerCollectionInvocation"] | components["schemas"]["IntegerGenerator"] | components["schemas"]["IntegerInvocation"] | components["schemas"]["IntegerMathInvocation"] | components["schemas"]["InvertTensorMaskInvocation"] | components["schemas"]["InvokeAdjustImageHuePlusInvocation"] | components["schemas"]["InvokeEquivalentAchromaticLightnessInvocation"] | components["schemas"]["InvokeImageBlendInvocation"] | components["schemas"]["InvokeImageCompositorInvocation"] | components["schemas"]["InvokeImageDilateOrErodeInvocation"] | components["schemas"]["InvokeImageEnhanceInvocation"] | components["schemas"]["InvokeImageValueThresholdsInvocation"] | components["schemas"]["IterateInvocation"] | components["schemas"]["LaMaInfillInvocation"] | components["schemas"]["LatentsCollectionInvocation"] | components["schemas"]["LatentsInvocation"] | components["schemas"]["LatentsToImageInvocation"] | components["schemas"]["LineartAnimeEdgeDetectionInvocation"] | components["schemas"]["LineartEdgeDetectionInvocation"] | components["schemas"]["LlavaOnevisionVllmInvocation"] | components["schemas"]["LoRACollectionLoader"] | components["schemas"]["LoRALoaderInvocation"] | components["schemas"]["LoRASelectorInvocation"] | components["schemas"]["MLSDDetectionInvocation"] | components["schemas"]["MainModelLoaderInvocation"] | components["schemas"]["MaskCombineInvocation"] | components["schemas"]["MaskEdgeInvocation"] | components["schemas"]["MaskFromAlphaInvocation"] | components["schemas"]["MaskFromIDInvocation"] | components["schemas"]["MaskTensorToImageInvocation"] | components["schemas"]["MediaPipeFaceDetectionInvocation"] | components["schemas"]["MergeMetadataInvocation"] | components["schemas"]["MergeTilesToImageInvocation"] | components["schemas"]["MetadataFieldExtractorInvocation"] | components["schemas"]["MetadataFromImageInvocation"] | components["schemas"]["MetadataInvocation"] | components["schemas"]["MetadataItemInvocation"] | components["schemas"]["MetadataItemLinkedInvocation"] | components["schemas"]["MetadataToBoolCollectionInvocation"] | components["schemas"]["MetadataToBoolInvocation"] | components["schemas"]["MetadataToControlnetsInvocation"] | components["schemas"]["MetadataToFloatCollectionInvocation"] | components["schemas"]["MetadataToFloatInvocation"] | components["schemas"]["MetadataToIPAdaptersInvocation"] | components["schemas"]["MetadataToIntegerCollectionInvocation"] | components["schemas"]["MetadataToIntegerInvocation"] | components["schemas"]["MetadataToLorasCollectionInvocation"] | components["schemas"]["MetadataToLorasInvocation"] | components["schemas"]["MetadataToModelInvocation"] | components["schemas"]["MetadataToSDXLLorasInvocation"] | components["schemas"]["MetadataToSDXLModelInvocation"] | components["schemas"]["MetadataToSchedulerInvocation"] | components["schemas"]["MetadataToStringCollectionInvocation"] | components["schemas"]["MetadataToStringInvocation"] | components["schemas"]["MetadataToT2IAdaptersInvocation"] | components["schemas"]["MetadataToVAEInvocation"] | components["schemas"]["ModelIdentifierInvocation"] | components["schemas"]["MultiplyInvocation"] | components["schemas"]["NoiseInvocation"] | components["schemas"]["NormalMapInvocation"] | components["schemas"]["OpenAIImageGenerationInvocation"] | components["schemas"]["PBRMapsInvocation"] | components["schemas"]["PairTileImageInvocation"] | components["schemas"]["PasteImageIntoBoundingBoxInvocation"] | components["schemas"]["PiDiNetEdgeDetectionInvocation"] | components["schemas"]["PromptTemplateInvocation"] | components["schemas"]["PromptsFromFileInvocation"] | components["schemas"]["QwenImageDenoiseInvocation"] | components["schemas"]["QwenImageImageToLatentsInvocation"] | components["schemas"]["QwenImageLatentsToImageInvocation"] | components["schemas"]["QwenImageLoRACollectionLoader"] | components["schemas"]["QwenImageLoRALoaderInvocation"] | components["schemas"]["QwenImageModelLoaderInvocation"] | components["schemas"]["QwenImageTextEncoderInvocation"] | components["schemas"]["RandomFloatInvocation"] | components["schemas"]["RandomIntInvocation"] | components["schemas"]["RandomRangeInvocation"] | components["schemas"]["RangeInvocation"] | components["schemas"]["RangeOfSizeInvocation"] | components["schemas"]["RectangleMaskInvocation"] | components["schemas"]["ResizeLatentsInvocation"] | components["schemas"]["RoundInvocation"] | components["schemas"]["SD3DenoiseInvocation"] | components["schemas"]["SD3ImageToLatentsInvocation"] | components["schemas"]["SD3LatentsToImageInvocation"] | components["schemas"]["SDXLCompelPromptInvocation"] | components["schemas"]["SDXLLoRACollectionLoader"] | components["schemas"]["SDXLLoRALoaderInvocation"] | components["schemas"]["SDXLModelLoaderInvocation"] | components["schemas"]["SDXLRefinerCompelPromptInvocation"] | components["schemas"]["SDXLRefinerModelLoaderInvocation"] | components["schemas"]["SaveImageInvocation"] | components["schemas"]["ScaleLatentsInvocation"] | components["schemas"]["SchedulerInvocation"] | components["schemas"]["Sd3ModelLoaderInvocation"] | components["schemas"]["Sd3TextEncoderInvocation"] | components["schemas"]["SeamlessModeInvocation"] | components["schemas"]["SegmentAnythingInvocation"] | components["schemas"]["ShowImageInvocation"] | components["schemas"]["SpandrelImageToImageAutoscaleInvocation"] | components["schemas"]["SpandrelImageToImageInvocation"] | components["schemas"]["StringBatchInvocation"] | components["schemas"]["StringCollectionInvocation"] | components["schemas"]["StringGenerator"] | components["schemas"]["StringInvocation"] | components["schemas"]["StringJoinInvocation"] | components["schemas"]["StringJoinThreeInvocation"] | components["schemas"]["StringReplaceInvocation"] | components["schemas"]["StringSplitInvocation"] | components["schemas"]["StringSplitNegInvocation"] | components["schemas"]["SubtractInvocation"] | components["schemas"]["T2IAdapterInvocation"] | components["schemas"]["TileToPropertiesInvocation"] | components["schemas"]["TiledMultiDiffusionDenoiseLatents"] | components["schemas"]["UnsharpMaskInvocation"] | components["schemas"]["VAELoaderInvocation"] | components["schemas"]["ZImageControlInvocation"] | components["schemas"]["ZImageDenoiseInvocation"] | components["schemas"]["ZImageDenoiseMetaInvocation"] | components["schemas"]["ZImageImageToLatentsInvocation"] | components["schemas"]["ZImageLatentsToImageInvocation"] | components["schemas"]["ZImageLoRACollectionLoader"] | components["schemas"]["ZImageLoRALoaderInvocation"] | components["schemas"]["ZImageModelLoaderInvocation"] | components["schemas"]["ZImageSeedVarianceEnhancerInvocation"] | components["schemas"]["ZImageTextEncoderInvocation"];
};
/**
* Edges
@@ -14311,6 +14745,11 @@ export type components = {
* @default null
*/
ui_model_format: components["schemas"]["ModelFormat"][] | null;
+ /**
+ * Ui Model Provider Id
+ * @default null
+ */
+ ui_model_provider_id: string[] | null;
};
/**
* InstallStatus
@@ -14676,7 +15115,7 @@ export type components = {
* Invocation
* @description The ID of the invocation
*/
- invocation: components["schemas"]["AddInvocation"] | components["schemas"]["AlphaMaskToTensorInvocation"] | components["schemas"]["AnimaDenoiseInvocation"] | components["schemas"]["AnimaImageToLatentsInvocation"] | components["schemas"]["AnimaLatentsToImageInvocation"] | components["schemas"]["AnimaLoRACollectionLoader"] | components["schemas"]["AnimaLoRALoaderInvocation"] | components["schemas"]["AnimaModelLoaderInvocation"] | components["schemas"]["AnimaTextEncoderInvocation"] | components["schemas"]["ApplyMaskTensorToImageInvocation"] | components["schemas"]["ApplyMaskToImageInvocation"] | components["schemas"]["BlankImageInvocation"] | components["schemas"]["BlendLatentsInvocation"] | components["schemas"]["BooleanCollectionInvocation"] | components["schemas"]["BooleanInvocation"] | components["schemas"]["BoundingBoxInvocation"] | components["schemas"]["CLIPSkipInvocation"] | components["schemas"]["CV2InfillInvocation"] | components["schemas"]["CalculateImageTilesEvenSplitInvocation"] | components["schemas"]["CalculateImageTilesInvocation"] | components["schemas"]["CalculateImageTilesMinimumOverlapInvocation"] | components["schemas"]["CannyEdgeDetectionInvocation"] | components["schemas"]["CanvasOutputInvocation"] | components["schemas"]["CanvasPasteBackInvocation"] | components["schemas"]["CanvasV2MaskAndCropInvocation"] | components["schemas"]["CenterPadCropInvocation"] | components["schemas"]["CogView4DenoiseInvocation"] | components["schemas"]["CogView4ImageToLatentsInvocation"] | components["schemas"]["CogView4LatentsToImageInvocation"] | components["schemas"]["CogView4ModelLoaderInvocation"] | components["schemas"]["CogView4TextEncoderInvocation"] | components["schemas"]["CollectInvocation"] | components["schemas"]["ColorCorrectInvocation"] | components["schemas"]["ColorInvocation"] | components["schemas"]["ColorMapInvocation"] | components["schemas"]["CompelInvocation"] | components["schemas"]["ConditioningCollectionInvocation"] | components["schemas"]["ConditioningInvocation"] | components["schemas"]["ContentShuffleInvocation"] | components["schemas"]["ControlNetInvocation"] | components["schemas"]["CoreMetadataInvocation"] | components["schemas"]["CreateDenoiseMaskInvocation"] | components["schemas"]["CreateGradientMaskInvocation"] | components["schemas"]["CropImageToBoundingBoxInvocation"] | components["schemas"]["CropLatentsCoreInvocation"] | components["schemas"]["CvInpaintInvocation"] | components["schemas"]["DWOpenposeDetectionInvocation"] | components["schemas"]["DecodeInvisibleWatermarkInvocation"] | components["schemas"]["DenoiseLatentsInvocation"] | components["schemas"]["DenoiseLatentsMetaInvocation"] | components["schemas"]["DepthAnythingDepthEstimationInvocation"] | components["schemas"]["DivideInvocation"] | components["schemas"]["DynamicPromptInvocation"] | components["schemas"]["ESRGANInvocation"] | components["schemas"]["ExpandMaskWithFadeInvocation"] | components["schemas"]["FLUXLoRACollectionLoader"] | components["schemas"]["FaceIdentifierInvocation"] | components["schemas"]["FaceMaskInvocation"] | components["schemas"]["FaceOffInvocation"] | components["schemas"]["FloatBatchInvocation"] | components["schemas"]["FloatCollectionInvocation"] | components["schemas"]["FloatGenerator"] | components["schemas"]["FloatInvocation"] | components["schemas"]["FloatLinearRangeInvocation"] | components["schemas"]["FloatMathInvocation"] | components["schemas"]["FloatToIntegerInvocation"] | components["schemas"]["Flux2DenoiseInvocation"] | components["schemas"]["Flux2KleinLoRACollectionLoader"] | components["schemas"]["Flux2KleinLoRALoaderInvocation"] | components["schemas"]["Flux2KleinModelLoaderInvocation"] | components["schemas"]["Flux2KleinTextEncoderInvocation"] | components["schemas"]["Flux2VaeDecodeInvocation"] | components["schemas"]["Flux2VaeEncodeInvocation"] | components["schemas"]["FluxControlLoRALoaderInvocation"] | components["schemas"]["FluxControlNetInvocation"] | components["schemas"]["FluxDenoiseInvocation"] | components["schemas"]["FluxDenoiseLatentsMetaInvocation"] | components["schemas"]["FluxFillInvocation"] | components["schemas"]["FluxIPAdapterInvocation"] | components["schemas"]["FluxKontextConcatenateImagesInvocation"] | components["schemas"]["FluxKontextInvocation"] | components["schemas"]["FluxLoRALoaderInvocation"] | components["schemas"]["FluxModelLoaderInvocation"] | components["schemas"]["FluxReduxInvocation"] | components["schemas"]["FluxTextEncoderInvocation"] | components["schemas"]["FluxVaeDecodeInvocation"] | components["schemas"]["FluxVaeEncodeInvocation"] | components["schemas"]["FreeUInvocation"] | components["schemas"]["GetMaskBoundingBoxInvocation"] | components["schemas"]["GroundingDinoInvocation"] | components["schemas"]["HEDEdgeDetectionInvocation"] | components["schemas"]["HeuristicResizeInvocation"] | components["schemas"]["IPAdapterInvocation"] | components["schemas"]["IdealSizeInvocation"] | components["schemas"]["IfInvocation"] | components["schemas"]["ImageBatchInvocation"] | components["schemas"]["ImageBlurInvocation"] | components["schemas"]["ImageChannelInvocation"] | components["schemas"]["ImageChannelMultiplyInvocation"] | components["schemas"]["ImageChannelOffsetInvocation"] | components["schemas"]["ImageCollectionInvocation"] | components["schemas"]["ImageConvertInvocation"] | components["schemas"]["ImageCropInvocation"] | components["schemas"]["ImageGenerator"] | components["schemas"]["ImageHueAdjustmentInvocation"] | components["schemas"]["ImageInverseLerpInvocation"] | components["schemas"]["ImageInvocation"] | components["schemas"]["ImageLerpInvocation"] | components["schemas"]["ImageMaskToTensorInvocation"] | components["schemas"]["ImageMultiplyInvocation"] | components["schemas"]["ImageNSFWBlurInvocation"] | components["schemas"]["ImageNoiseInvocation"] | components["schemas"]["ImagePanelLayoutInvocation"] | components["schemas"]["ImagePasteInvocation"] | components["schemas"]["ImageResizeInvocation"] | components["schemas"]["ImageScaleInvocation"] | components["schemas"]["ImageToLatentsInvocation"] | components["schemas"]["ImageWatermarkInvocation"] | components["schemas"]["InfillColorInvocation"] | components["schemas"]["InfillPatchMatchInvocation"] | components["schemas"]["InfillTileInvocation"] | components["schemas"]["IntegerBatchInvocation"] | components["schemas"]["IntegerCollectionInvocation"] | components["schemas"]["IntegerGenerator"] | components["schemas"]["IntegerInvocation"] | components["schemas"]["IntegerMathInvocation"] | components["schemas"]["InvertTensorMaskInvocation"] | components["schemas"]["InvokeAdjustImageHuePlusInvocation"] | components["schemas"]["InvokeEquivalentAchromaticLightnessInvocation"] | components["schemas"]["InvokeImageBlendInvocation"] | components["schemas"]["InvokeImageCompositorInvocation"] | components["schemas"]["InvokeImageDilateOrErodeInvocation"] | components["schemas"]["InvokeImageEnhanceInvocation"] | components["schemas"]["InvokeImageValueThresholdsInvocation"] | components["schemas"]["IterateInvocation"] | components["schemas"]["LaMaInfillInvocation"] | components["schemas"]["LatentsCollectionInvocation"] | components["schemas"]["LatentsInvocation"] | components["schemas"]["LatentsToImageInvocation"] | components["schemas"]["LineartAnimeEdgeDetectionInvocation"] | components["schemas"]["LineartEdgeDetectionInvocation"] | components["schemas"]["LlavaOnevisionVllmInvocation"] | components["schemas"]["LoRACollectionLoader"] | components["schemas"]["LoRALoaderInvocation"] | components["schemas"]["LoRASelectorInvocation"] | components["schemas"]["MLSDDetectionInvocation"] | components["schemas"]["MainModelLoaderInvocation"] | components["schemas"]["MaskCombineInvocation"] | components["schemas"]["MaskEdgeInvocation"] | components["schemas"]["MaskFromAlphaInvocation"] | components["schemas"]["MaskFromIDInvocation"] | components["schemas"]["MaskTensorToImageInvocation"] | components["schemas"]["MediaPipeFaceDetectionInvocation"] | components["schemas"]["MergeMetadataInvocation"] | components["schemas"]["MergeTilesToImageInvocation"] | components["schemas"]["MetadataFieldExtractorInvocation"] | components["schemas"]["MetadataFromImageInvocation"] | components["schemas"]["MetadataInvocation"] | components["schemas"]["MetadataItemInvocation"] | components["schemas"]["MetadataItemLinkedInvocation"] | components["schemas"]["MetadataToBoolCollectionInvocation"] | components["schemas"]["MetadataToBoolInvocation"] | components["schemas"]["MetadataToControlnetsInvocation"] | components["schemas"]["MetadataToFloatCollectionInvocation"] | components["schemas"]["MetadataToFloatInvocation"] | components["schemas"]["MetadataToIPAdaptersInvocation"] | components["schemas"]["MetadataToIntegerCollectionInvocation"] | components["schemas"]["MetadataToIntegerInvocation"] | components["schemas"]["MetadataToLorasCollectionInvocation"] | components["schemas"]["MetadataToLorasInvocation"] | components["schemas"]["MetadataToModelInvocation"] | components["schemas"]["MetadataToSDXLLorasInvocation"] | components["schemas"]["MetadataToSDXLModelInvocation"] | components["schemas"]["MetadataToSchedulerInvocation"] | components["schemas"]["MetadataToStringCollectionInvocation"] | components["schemas"]["MetadataToStringInvocation"] | components["schemas"]["MetadataToT2IAdaptersInvocation"] | components["schemas"]["MetadataToVAEInvocation"] | components["schemas"]["ModelIdentifierInvocation"] | components["schemas"]["MultiplyInvocation"] | components["schemas"]["NoiseInvocation"] | components["schemas"]["NormalMapInvocation"] | components["schemas"]["PBRMapsInvocation"] | components["schemas"]["PairTileImageInvocation"] | components["schemas"]["PasteImageIntoBoundingBoxInvocation"] | components["schemas"]["PiDiNetEdgeDetectionInvocation"] | components["schemas"]["PromptTemplateInvocation"] | components["schemas"]["PromptsFromFileInvocation"] | components["schemas"]["QwenImageDenoiseInvocation"] | components["schemas"]["QwenImageImageToLatentsInvocation"] | components["schemas"]["QwenImageLatentsToImageInvocation"] | components["schemas"]["QwenImageLoRACollectionLoader"] | components["schemas"]["QwenImageLoRALoaderInvocation"] | components["schemas"]["QwenImageModelLoaderInvocation"] | components["schemas"]["QwenImageTextEncoderInvocation"] | components["schemas"]["RandomFloatInvocation"] | components["schemas"]["RandomIntInvocation"] | components["schemas"]["RandomRangeInvocation"] | components["schemas"]["RangeInvocation"] | components["schemas"]["RangeOfSizeInvocation"] | components["schemas"]["RectangleMaskInvocation"] | components["schemas"]["ResizeLatentsInvocation"] | components["schemas"]["RoundInvocation"] | components["schemas"]["SD3DenoiseInvocation"] | components["schemas"]["SD3ImageToLatentsInvocation"] | components["schemas"]["SD3LatentsToImageInvocation"] | components["schemas"]["SDXLCompelPromptInvocation"] | components["schemas"]["SDXLLoRACollectionLoader"] | components["schemas"]["SDXLLoRALoaderInvocation"] | components["schemas"]["SDXLModelLoaderInvocation"] | components["schemas"]["SDXLRefinerCompelPromptInvocation"] | components["schemas"]["SDXLRefinerModelLoaderInvocation"] | components["schemas"]["SaveImageInvocation"] | components["schemas"]["ScaleLatentsInvocation"] | components["schemas"]["SchedulerInvocation"] | components["schemas"]["Sd3ModelLoaderInvocation"] | components["schemas"]["Sd3TextEncoderInvocation"] | components["schemas"]["SeamlessModeInvocation"] | components["schemas"]["SegmentAnythingInvocation"] | components["schemas"]["ShowImageInvocation"] | components["schemas"]["SpandrelImageToImageAutoscaleInvocation"] | components["schemas"]["SpandrelImageToImageInvocation"] | components["schemas"]["StringBatchInvocation"] | components["schemas"]["StringCollectionInvocation"] | components["schemas"]["StringGenerator"] | components["schemas"]["StringInvocation"] | components["schemas"]["StringJoinInvocation"] | components["schemas"]["StringJoinThreeInvocation"] | components["schemas"]["StringReplaceInvocation"] | components["schemas"]["StringSplitInvocation"] | components["schemas"]["StringSplitNegInvocation"] | components["schemas"]["SubtractInvocation"] | components["schemas"]["T2IAdapterInvocation"] | components["schemas"]["TileToPropertiesInvocation"] | components["schemas"]["TiledMultiDiffusionDenoiseLatents"] | components["schemas"]["UnsharpMaskInvocation"] | components["schemas"]["VAELoaderInvocation"] | components["schemas"]["ZImageControlInvocation"] | components["schemas"]["ZImageDenoiseInvocation"] | components["schemas"]["ZImageDenoiseMetaInvocation"] | components["schemas"]["ZImageImageToLatentsInvocation"] | components["schemas"]["ZImageLatentsToImageInvocation"] | components["schemas"]["ZImageLoRACollectionLoader"] | components["schemas"]["ZImageLoRALoaderInvocation"] | components["schemas"]["ZImageModelLoaderInvocation"] | components["schemas"]["ZImageSeedVarianceEnhancerInvocation"] | components["schemas"]["ZImageTextEncoderInvocation"];
+ invocation: components["schemas"]["AddInvocation"] | components["schemas"]["AlphaMaskToTensorInvocation"] | components["schemas"]["AnimaDenoiseInvocation"] | components["schemas"]["AnimaImageToLatentsInvocation"] | components["schemas"]["AnimaLatentsToImageInvocation"] | components["schemas"]["AnimaLoRACollectionLoader"] | components["schemas"]["AnimaLoRALoaderInvocation"] | components["schemas"]["AnimaModelLoaderInvocation"] | components["schemas"]["AnimaTextEncoderInvocation"] | components["schemas"]["ApplyMaskTensorToImageInvocation"] | components["schemas"]["ApplyMaskToImageInvocation"] | components["schemas"]["BlankImageInvocation"] | components["schemas"]["BlendLatentsInvocation"] | components["schemas"]["BooleanCollectionInvocation"] | components["schemas"]["BooleanInvocation"] | components["schemas"]["BoundingBoxInvocation"] | components["schemas"]["CLIPSkipInvocation"] | components["schemas"]["CV2InfillInvocation"] | components["schemas"]["CalculateImageTilesEvenSplitInvocation"] | components["schemas"]["CalculateImageTilesInvocation"] | components["schemas"]["CalculateImageTilesMinimumOverlapInvocation"] | components["schemas"]["CannyEdgeDetectionInvocation"] | components["schemas"]["CanvasOutputInvocation"] | components["schemas"]["CanvasPasteBackInvocation"] | components["schemas"]["CanvasV2MaskAndCropInvocation"] | components["schemas"]["CenterPadCropInvocation"] | components["schemas"]["CogView4DenoiseInvocation"] | components["schemas"]["CogView4ImageToLatentsInvocation"] | components["schemas"]["CogView4LatentsToImageInvocation"] | components["schemas"]["CogView4ModelLoaderInvocation"] | components["schemas"]["CogView4TextEncoderInvocation"] | components["schemas"]["CollectInvocation"] | components["schemas"]["ColorCorrectInvocation"] | components["schemas"]["ColorInvocation"] | components["schemas"]["ColorMapInvocation"] | components["schemas"]["CompelInvocation"] | components["schemas"]["ConditioningCollectionInvocation"] | components["schemas"]["ConditioningInvocation"] | components["schemas"]["ContentShuffleInvocation"] | components["schemas"]["ControlNetInvocation"] | components["schemas"]["CoreMetadataInvocation"] | components["schemas"]["CreateDenoiseMaskInvocation"] | components["schemas"]["CreateGradientMaskInvocation"] | components["schemas"]["CropImageToBoundingBoxInvocation"] | components["schemas"]["CropLatentsCoreInvocation"] | components["schemas"]["CvInpaintInvocation"] | components["schemas"]["DWOpenposeDetectionInvocation"] | components["schemas"]["DecodeInvisibleWatermarkInvocation"] | components["schemas"]["DenoiseLatentsInvocation"] | components["schemas"]["DenoiseLatentsMetaInvocation"] | components["schemas"]["DepthAnythingDepthEstimationInvocation"] | components["schemas"]["DivideInvocation"] | components["schemas"]["DynamicPromptInvocation"] | components["schemas"]["ESRGANInvocation"] | components["schemas"]["ExpandMaskWithFadeInvocation"] | components["schemas"]["FLUXLoRACollectionLoader"] | components["schemas"]["FaceIdentifierInvocation"] | components["schemas"]["FaceMaskInvocation"] | components["schemas"]["FaceOffInvocation"] | components["schemas"]["FloatBatchInvocation"] | components["schemas"]["FloatCollectionInvocation"] | components["schemas"]["FloatGenerator"] | components["schemas"]["FloatInvocation"] | components["schemas"]["FloatLinearRangeInvocation"] | components["schemas"]["FloatMathInvocation"] | components["schemas"]["FloatToIntegerInvocation"] | components["schemas"]["Flux2DenoiseInvocation"] | components["schemas"]["Flux2KleinLoRACollectionLoader"] | components["schemas"]["Flux2KleinLoRALoaderInvocation"] | components["schemas"]["Flux2KleinModelLoaderInvocation"] | components["schemas"]["Flux2KleinTextEncoderInvocation"] | components["schemas"]["Flux2VaeDecodeInvocation"] | components["schemas"]["Flux2VaeEncodeInvocation"] | components["schemas"]["FluxControlLoRALoaderInvocation"] | components["schemas"]["FluxControlNetInvocation"] | components["schemas"]["FluxDenoiseInvocation"] | components["schemas"]["FluxDenoiseLatentsMetaInvocation"] | components["schemas"]["FluxFillInvocation"] | components["schemas"]["FluxIPAdapterInvocation"] | components["schemas"]["FluxKontextConcatenateImagesInvocation"] | components["schemas"]["FluxKontextInvocation"] | components["schemas"]["FluxLoRALoaderInvocation"] | components["schemas"]["FluxModelLoaderInvocation"] | components["schemas"]["FluxReduxInvocation"] | components["schemas"]["FluxTextEncoderInvocation"] | components["schemas"]["FluxVaeDecodeInvocation"] | components["schemas"]["FluxVaeEncodeInvocation"] | components["schemas"]["FreeUInvocation"] | components["schemas"]["GeminiImageGenerationInvocation"] | components["schemas"]["GetMaskBoundingBoxInvocation"] | components["schemas"]["GroundingDinoInvocation"] | components["schemas"]["HEDEdgeDetectionInvocation"] | components["schemas"]["HeuristicResizeInvocation"] | components["schemas"]["IPAdapterInvocation"] | components["schemas"]["IdealSizeInvocation"] | components["schemas"]["IfInvocation"] | components["schemas"]["ImageBatchInvocation"] | components["schemas"]["ImageBlurInvocation"] | components["schemas"]["ImageChannelInvocation"] | components["schemas"]["ImageChannelMultiplyInvocation"] | components["schemas"]["ImageChannelOffsetInvocation"] | components["schemas"]["ImageCollectionInvocation"] | components["schemas"]["ImageConvertInvocation"] | components["schemas"]["ImageCropInvocation"] | components["schemas"]["ImageGenerator"] | components["schemas"]["ImageHueAdjustmentInvocation"] | components["schemas"]["ImageInverseLerpInvocation"] | components["schemas"]["ImageInvocation"] | components["schemas"]["ImageLerpInvocation"] | components["schemas"]["ImageMaskToTensorInvocation"] | components["schemas"]["ImageMultiplyInvocation"] | components["schemas"]["ImageNSFWBlurInvocation"] | components["schemas"]["ImageNoiseInvocation"] | components["schemas"]["ImagePanelLayoutInvocation"] | components["schemas"]["ImagePasteInvocation"] | components["schemas"]["ImageResizeInvocation"] | components["schemas"]["ImageScaleInvocation"] | components["schemas"]["ImageToLatentsInvocation"] | components["schemas"]["ImageWatermarkInvocation"] | components["schemas"]["InfillColorInvocation"] | components["schemas"]["InfillPatchMatchInvocation"] | components["schemas"]["InfillTileInvocation"] | components["schemas"]["IntegerBatchInvocation"] | components["schemas"]["IntegerCollectionInvocation"] | components["schemas"]["IntegerGenerator"] | components["schemas"]["IntegerInvocation"] | components["schemas"]["IntegerMathInvocation"] | components["schemas"]["InvertTensorMaskInvocation"] | components["schemas"]["InvokeAdjustImageHuePlusInvocation"] | components["schemas"]["InvokeEquivalentAchromaticLightnessInvocation"] | components["schemas"]["InvokeImageBlendInvocation"] | components["schemas"]["InvokeImageCompositorInvocation"] | components["schemas"]["InvokeImageDilateOrErodeInvocation"] | components["schemas"]["InvokeImageEnhanceInvocation"] | components["schemas"]["InvokeImageValueThresholdsInvocation"] | components["schemas"]["IterateInvocation"] | components["schemas"]["LaMaInfillInvocation"] | components["schemas"]["LatentsCollectionInvocation"] | components["schemas"]["LatentsInvocation"] | components["schemas"]["LatentsToImageInvocation"] | components["schemas"]["LineartAnimeEdgeDetectionInvocation"] | components["schemas"]["LineartEdgeDetectionInvocation"] | components["schemas"]["LlavaOnevisionVllmInvocation"] | components["schemas"]["LoRACollectionLoader"] | components["schemas"]["LoRALoaderInvocation"] | components["schemas"]["LoRASelectorInvocation"] | components["schemas"]["MLSDDetectionInvocation"] | components["schemas"]["MainModelLoaderInvocation"] | components["schemas"]["MaskCombineInvocation"] | components["schemas"]["MaskEdgeInvocation"] | components["schemas"]["MaskFromAlphaInvocation"] | components["schemas"]["MaskFromIDInvocation"] | components["schemas"]["MaskTensorToImageInvocation"] | components["schemas"]["MediaPipeFaceDetectionInvocation"] | components["schemas"]["MergeMetadataInvocation"] | components["schemas"]["MergeTilesToImageInvocation"] | components["schemas"]["MetadataFieldExtractorInvocation"] | components["schemas"]["MetadataFromImageInvocation"] | components["schemas"]["MetadataInvocation"] | components["schemas"]["MetadataItemInvocation"] | components["schemas"]["MetadataItemLinkedInvocation"] | components["schemas"]["MetadataToBoolCollectionInvocation"] | components["schemas"]["MetadataToBoolInvocation"] | components["schemas"]["MetadataToControlnetsInvocation"] | components["schemas"]["MetadataToFloatCollectionInvocation"] | components["schemas"]["MetadataToFloatInvocation"] | components["schemas"]["MetadataToIPAdaptersInvocation"] | components["schemas"]["MetadataToIntegerCollectionInvocation"] | components["schemas"]["MetadataToIntegerInvocation"] | components["schemas"]["MetadataToLorasCollectionInvocation"] | components["schemas"]["MetadataToLorasInvocation"] | components["schemas"]["MetadataToModelInvocation"] | components["schemas"]["MetadataToSDXLLorasInvocation"] | components["schemas"]["MetadataToSDXLModelInvocation"] | components["schemas"]["MetadataToSchedulerInvocation"] | components["schemas"]["MetadataToStringCollectionInvocation"] | components["schemas"]["MetadataToStringInvocation"] | components["schemas"]["MetadataToT2IAdaptersInvocation"] | components["schemas"]["MetadataToVAEInvocation"] | components["schemas"]["ModelIdentifierInvocation"] | components["schemas"]["MultiplyInvocation"] | components["schemas"]["NoiseInvocation"] | components["schemas"]["NormalMapInvocation"] | components["schemas"]["OpenAIImageGenerationInvocation"] | components["schemas"]["PBRMapsInvocation"] | components["schemas"]["PairTileImageInvocation"] | components["schemas"]["PasteImageIntoBoundingBoxInvocation"] | components["schemas"]["PiDiNetEdgeDetectionInvocation"] | components["schemas"]["PromptTemplateInvocation"] | components["schemas"]["PromptsFromFileInvocation"] | components["schemas"]["QwenImageDenoiseInvocation"] | components["schemas"]["QwenImageImageToLatentsInvocation"] | components["schemas"]["QwenImageLatentsToImageInvocation"] | components["schemas"]["QwenImageLoRACollectionLoader"] | components["schemas"]["QwenImageLoRALoaderInvocation"] | components["schemas"]["QwenImageModelLoaderInvocation"] | components["schemas"]["QwenImageTextEncoderInvocation"] | components["schemas"]["RandomFloatInvocation"] | components["schemas"]["RandomIntInvocation"] | components["schemas"]["RandomRangeInvocation"] | components["schemas"]["RangeInvocation"] | components["schemas"]["RangeOfSizeInvocation"] | components["schemas"]["RectangleMaskInvocation"] | components["schemas"]["ResizeLatentsInvocation"] | components["schemas"]["RoundInvocation"] | components["schemas"]["SD3DenoiseInvocation"] | components["schemas"]["SD3ImageToLatentsInvocation"] | components["schemas"]["SD3LatentsToImageInvocation"] | components["schemas"]["SDXLCompelPromptInvocation"] | components["schemas"]["SDXLLoRACollectionLoader"] | components["schemas"]["SDXLLoRALoaderInvocation"] | components["schemas"]["SDXLModelLoaderInvocation"] | components["schemas"]["SDXLRefinerCompelPromptInvocation"] | components["schemas"]["SDXLRefinerModelLoaderInvocation"] | components["schemas"]["SaveImageInvocation"] | components["schemas"]["ScaleLatentsInvocation"] | components["schemas"]["SchedulerInvocation"] | components["schemas"]["Sd3ModelLoaderInvocation"] | components["schemas"]["Sd3TextEncoderInvocation"] | components["schemas"]["SeamlessModeInvocation"] | components["schemas"]["SegmentAnythingInvocation"] | components["schemas"]["ShowImageInvocation"] | components["schemas"]["SpandrelImageToImageAutoscaleInvocation"] | components["schemas"]["SpandrelImageToImageInvocation"] | components["schemas"]["StringBatchInvocation"] | components["schemas"]["StringCollectionInvocation"] | components["schemas"]["StringGenerator"] | components["schemas"]["StringInvocation"] | components["schemas"]["StringJoinInvocation"] | components["schemas"]["StringJoinThreeInvocation"] | components["schemas"]["StringReplaceInvocation"] | components["schemas"]["StringSplitInvocation"] | components["schemas"]["StringSplitNegInvocation"] | components["schemas"]["SubtractInvocation"] | components["schemas"]["T2IAdapterInvocation"] | components["schemas"]["TileToPropertiesInvocation"] | components["schemas"]["TiledMultiDiffusionDenoiseLatents"] | components["schemas"]["UnsharpMaskInvocation"] | components["schemas"]["VAELoaderInvocation"] | components["schemas"]["ZImageControlInvocation"] | components["schemas"]["ZImageDenoiseInvocation"] | components["schemas"]["ZImageDenoiseMetaInvocation"] | components["schemas"]["ZImageImageToLatentsInvocation"] | components["schemas"]["ZImageLatentsToImageInvocation"] | components["schemas"]["ZImageLoRACollectionLoader"] | components["schemas"]["ZImageLoRALoaderInvocation"] | components["schemas"]["ZImageModelLoaderInvocation"] | components["schemas"]["ZImageSeedVarianceEnhancerInvocation"] | components["schemas"]["ZImageTextEncoderInvocation"];
/**
* Invocation Source Id
* @description The ID of the prepared invocation's source node
@@ -14740,7 +15179,7 @@ export type components = {
* Invocation
* @description The ID of the invocation
*/
- invocation: components["schemas"]["AddInvocation"] | components["schemas"]["AlphaMaskToTensorInvocation"] | components["schemas"]["AnimaDenoiseInvocation"] | components["schemas"]["AnimaImageToLatentsInvocation"] | components["schemas"]["AnimaLatentsToImageInvocation"] | components["schemas"]["AnimaLoRACollectionLoader"] | components["schemas"]["AnimaLoRALoaderInvocation"] | components["schemas"]["AnimaModelLoaderInvocation"] | components["schemas"]["AnimaTextEncoderInvocation"] | components["schemas"]["ApplyMaskTensorToImageInvocation"] | components["schemas"]["ApplyMaskToImageInvocation"] | components["schemas"]["BlankImageInvocation"] | components["schemas"]["BlendLatentsInvocation"] | components["schemas"]["BooleanCollectionInvocation"] | components["schemas"]["BooleanInvocation"] | components["schemas"]["BoundingBoxInvocation"] | components["schemas"]["CLIPSkipInvocation"] | components["schemas"]["CV2InfillInvocation"] | components["schemas"]["CalculateImageTilesEvenSplitInvocation"] | components["schemas"]["CalculateImageTilesInvocation"] | components["schemas"]["CalculateImageTilesMinimumOverlapInvocation"] | components["schemas"]["CannyEdgeDetectionInvocation"] | components["schemas"]["CanvasOutputInvocation"] | components["schemas"]["CanvasPasteBackInvocation"] | components["schemas"]["CanvasV2MaskAndCropInvocation"] | components["schemas"]["CenterPadCropInvocation"] | components["schemas"]["CogView4DenoiseInvocation"] | components["schemas"]["CogView4ImageToLatentsInvocation"] | components["schemas"]["CogView4LatentsToImageInvocation"] | components["schemas"]["CogView4ModelLoaderInvocation"] | components["schemas"]["CogView4TextEncoderInvocation"] | components["schemas"]["CollectInvocation"] | components["schemas"]["ColorCorrectInvocation"] | components["schemas"]["ColorInvocation"] | components["schemas"]["ColorMapInvocation"] | components["schemas"]["CompelInvocation"] | components["schemas"]["ConditioningCollectionInvocation"] | components["schemas"]["ConditioningInvocation"] | components["schemas"]["ContentShuffleInvocation"] | components["schemas"]["ControlNetInvocation"] | components["schemas"]["CoreMetadataInvocation"] | components["schemas"]["CreateDenoiseMaskInvocation"] | components["schemas"]["CreateGradientMaskInvocation"] | components["schemas"]["CropImageToBoundingBoxInvocation"] | components["schemas"]["CropLatentsCoreInvocation"] | components["schemas"]["CvInpaintInvocation"] | components["schemas"]["DWOpenposeDetectionInvocation"] | components["schemas"]["DecodeInvisibleWatermarkInvocation"] | components["schemas"]["DenoiseLatentsInvocation"] | components["schemas"]["DenoiseLatentsMetaInvocation"] | components["schemas"]["DepthAnythingDepthEstimationInvocation"] | components["schemas"]["DivideInvocation"] | components["schemas"]["DynamicPromptInvocation"] | components["schemas"]["ESRGANInvocation"] | components["schemas"]["ExpandMaskWithFadeInvocation"] | components["schemas"]["FLUXLoRACollectionLoader"] | components["schemas"]["FaceIdentifierInvocation"] | components["schemas"]["FaceMaskInvocation"] | components["schemas"]["FaceOffInvocation"] | components["schemas"]["FloatBatchInvocation"] | components["schemas"]["FloatCollectionInvocation"] | components["schemas"]["FloatGenerator"] | components["schemas"]["FloatInvocation"] | components["schemas"]["FloatLinearRangeInvocation"] | components["schemas"]["FloatMathInvocation"] | components["schemas"]["FloatToIntegerInvocation"] | components["schemas"]["Flux2DenoiseInvocation"] | components["schemas"]["Flux2KleinLoRACollectionLoader"] | components["schemas"]["Flux2KleinLoRALoaderInvocation"] | components["schemas"]["Flux2KleinModelLoaderInvocation"] | components["schemas"]["Flux2KleinTextEncoderInvocation"] | components["schemas"]["Flux2VaeDecodeInvocation"] | components["schemas"]["Flux2VaeEncodeInvocation"] | components["schemas"]["FluxControlLoRALoaderInvocation"] | components["schemas"]["FluxControlNetInvocation"] | components["schemas"]["FluxDenoiseInvocation"] | components["schemas"]["FluxDenoiseLatentsMetaInvocation"] | components["schemas"]["FluxFillInvocation"] | components["schemas"]["FluxIPAdapterInvocation"] | components["schemas"]["FluxKontextConcatenateImagesInvocation"] | components["schemas"]["FluxKontextInvocation"] | components["schemas"]["FluxLoRALoaderInvocation"] | components["schemas"]["FluxModelLoaderInvocation"] | components["schemas"]["FluxReduxInvocation"] | components["schemas"]["FluxTextEncoderInvocation"] | components["schemas"]["FluxVaeDecodeInvocation"] | components["schemas"]["FluxVaeEncodeInvocation"] | components["schemas"]["FreeUInvocation"] | components["schemas"]["GetMaskBoundingBoxInvocation"] | components["schemas"]["GroundingDinoInvocation"] | components["schemas"]["HEDEdgeDetectionInvocation"] | components["schemas"]["HeuristicResizeInvocation"] | components["schemas"]["IPAdapterInvocation"] | components["schemas"]["IdealSizeInvocation"] | components["schemas"]["IfInvocation"] | components["schemas"]["ImageBatchInvocation"] | components["schemas"]["ImageBlurInvocation"] | components["schemas"]["ImageChannelInvocation"] | components["schemas"]["ImageChannelMultiplyInvocation"] | components["schemas"]["ImageChannelOffsetInvocation"] | components["schemas"]["ImageCollectionInvocation"] | components["schemas"]["ImageConvertInvocation"] | components["schemas"]["ImageCropInvocation"] | components["schemas"]["ImageGenerator"] | components["schemas"]["ImageHueAdjustmentInvocation"] | components["schemas"]["ImageInverseLerpInvocation"] | components["schemas"]["ImageInvocation"] | components["schemas"]["ImageLerpInvocation"] | components["schemas"]["ImageMaskToTensorInvocation"] | components["schemas"]["ImageMultiplyInvocation"] | components["schemas"]["ImageNSFWBlurInvocation"] | components["schemas"]["ImageNoiseInvocation"] | components["schemas"]["ImagePanelLayoutInvocation"] | components["schemas"]["ImagePasteInvocation"] | components["schemas"]["ImageResizeInvocation"] | components["schemas"]["ImageScaleInvocation"] | components["schemas"]["ImageToLatentsInvocation"] | components["schemas"]["ImageWatermarkInvocation"] | components["schemas"]["InfillColorInvocation"] | components["schemas"]["InfillPatchMatchInvocation"] | components["schemas"]["InfillTileInvocation"] | components["schemas"]["IntegerBatchInvocation"] | components["schemas"]["IntegerCollectionInvocation"] | components["schemas"]["IntegerGenerator"] | components["schemas"]["IntegerInvocation"] | components["schemas"]["IntegerMathInvocation"] | components["schemas"]["InvertTensorMaskInvocation"] | components["schemas"]["InvokeAdjustImageHuePlusInvocation"] | components["schemas"]["InvokeEquivalentAchromaticLightnessInvocation"] | components["schemas"]["InvokeImageBlendInvocation"] | components["schemas"]["InvokeImageCompositorInvocation"] | components["schemas"]["InvokeImageDilateOrErodeInvocation"] | components["schemas"]["InvokeImageEnhanceInvocation"] | components["schemas"]["InvokeImageValueThresholdsInvocation"] | components["schemas"]["IterateInvocation"] | components["schemas"]["LaMaInfillInvocation"] | components["schemas"]["LatentsCollectionInvocation"] | components["schemas"]["LatentsInvocation"] | components["schemas"]["LatentsToImageInvocation"] | components["schemas"]["LineartAnimeEdgeDetectionInvocation"] | components["schemas"]["LineartEdgeDetectionInvocation"] | components["schemas"]["LlavaOnevisionVllmInvocation"] | components["schemas"]["LoRACollectionLoader"] | components["schemas"]["LoRALoaderInvocation"] | components["schemas"]["LoRASelectorInvocation"] | components["schemas"]["MLSDDetectionInvocation"] | components["schemas"]["MainModelLoaderInvocation"] | components["schemas"]["MaskCombineInvocation"] | components["schemas"]["MaskEdgeInvocation"] | components["schemas"]["MaskFromAlphaInvocation"] | components["schemas"]["MaskFromIDInvocation"] | components["schemas"]["MaskTensorToImageInvocation"] | components["schemas"]["MediaPipeFaceDetectionInvocation"] | components["schemas"]["MergeMetadataInvocation"] | components["schemas"]["MergeTilesToImageInvocation"] | components["schemas"]["MetadataFieldExtractorInvocation"] | components["schemas"]["MetadataFromImageInvocation"] | components["schemas"]["MetadataInvocation"] | components["schemas"]["MetadataItemInvocation"] | components["schemas"]["MetadataItemLinkedInvocation"] | components["schemas"]["MetadataToBoolCollectionInvocation"] | components["schemas"]["MetadataToBoolInvocation"] | components["schemas"]["MetadataToControlnetsInvocation"] | components["schemas"]["MetadataToFloatCollectionInvocation"] | components["schemas"]["MetadataToFloatInvocation"] | components["schemas"]["MetadataToIPAdaptersInvocation"] | components["schemas"]["MetadataToIntegerCollectionInvocation"] | components["schemas"]["MetadataToIntegerInvocation"] | components["schemas"]["MetadataToLorasCollectionInvocation"] | components["schemas"]["MetadataToLorasInvocation"] | components["schemas"]["MetadataToModelInvocation"] | components["schemas"]["MetadataToSDXLLorasInvocation"] | components["schemas"]["MetadataToSDXLModelInvocation"] | components["schemas"]["MetadataToSchedulerInvocation"] | components["schemas"]["MetadataToStringCollectionInvocation"] | components["schemas"]["MetadataToStringInvocation"] | components["schemas"]["MetadataToT2IAdaptersInvocation"] | components["schemas"]["MetadataToVAEInvocation"] | components["schemas"]["ModelIdentifierInvocation"] | components["schemas"]["MultiplyInvocation"] | components["schemas"]["NoiseInvocation"] | components["schemas"]["NormalMapInvocation"] | components["schemas"]["PBRMapsInvocation"] | components["schemas"]["PairTileImageInvocation"] | components["schemas"]["PasteImageIntoBoundingBoxInvocation"] | components["schemas"]["PiDiNetEdgeDetectionInvocation"] | components["schemas"]["PromptTemplateInvocation"] | components["schemas"]["PromptsFromFileInvocation"] | components["schemas"]["QwenImageDenoiseInvocation"] | components["schemas"]["QwenImageImageToLatentsInvocation"] | components["schemas"]["QwenImageLatentsToImageInvocation"] | components["schemas"]["QwenImageLoRACollectionLoader"] | components["schemas"]["QwenImageLoRALoaderInvocation"] | components["schemas"]["QwenImageModelLoaderInvocation"] | components["schemas"]["QwenImageTextEncoderInvocation"] | components["schemas"]["RandomFloatInvocation"] | components["schemas"]["RandomIntInvocation"] | components["schemas"]["RandomRangeInvocation"] | components["schemas"]["RangeInvocation"] | components["schemas"]["RangeOfSizeInvocation"] | components["schemas"]["RectangleMaskInvocation"] | components["schemas"]["ResizeLatentsInvocation"] | components["schemas"]["RoundInvocation"] | components["schemas"]["SD3DenoiseInvocation"] | components["schemas"]["SD3ImageToLatentsInvocation"] | components["schemas"]["SD3LatentsToImageInvocation"] | components["schemas"]["SDXLCompelPromptInvocation"] | components["schemas"]["SDXLLoRACollectionLoader"] | components["schemas"]["SDXLLoRALoaderInvocation"] | components["schemas"]["SDXLModelLoaderInvocation"] | components["schemas"]["SDXLRefinerCompelPromptInvocation"] | components["schemas"]["SDXLRefinerModelLoaderInvocation"] | components["schemas"]["SaveImageInvocation"] | components["schemas"]["ScaleLatentsInvocation"] | components["schemas"]["SchedulerInvocation"] | components["schemas"]["Sd3ModelLoaderInvocation"] | components["schemas"]["Sd3TextEncoderInvocation"] | components["schemas"]["SeamlessModeInvocation"] | components["schemas"]["SegmentAnythingInvocation"] | components["schemas"]["ShowImageInvocation"] | components["schemas"]["SpandrelImageToImageAutoscaleInvocation"] | components["schemas"]["SpandrelImageToImageInvocation"] | components["schemas"]["StringBatchInvocation"] | components["schemas"]["StringCollectionInvocation"] | components["schemas"]["StringGenerator"] | components["schemas"]["StringInvocation"] | components["schemas"]["StringJoinInvocation"] | components["schemas"]["StringJoinThreeInvocation"] | components["schemas"]["StringReplaceInvocation"] | components["schemas"]["StringSplitInvocation"] | components["schemas"]["StringSplitNegInvocation"] | components["schemas"]["SubtractInvocation"] | components["schemas"]["T2IAdapterInvocation"] | components["schemas"]["TileToPropertiesInvocation"] | components["schemas"]["TiledMultiDiffusionDenoiseLatents"] | components["schemas"]["UnsharpMaskInvocation"] | components["schemas"]["VAELoaderInvocation"] | components["schemas"]["ZImageControlInvocation"] | components["schemas"]["ZImageDenoiseInvocation"] | components["schemas"]["ZImageDenoiseMetaInvocation"] | components["schemas"]["ZImageImageToLatentsInvocation"] | components["schemas"]["ZImageLatentsToImageInvocation"] | components["schemas"]["ZImageLoRACollectionLoader"] | components["schemas"]["ZImageLoRALoaderInvocation"] | components["schemas"]["ZImageModelLoaderInvocation"] | components["schemas"]["ZImageSeedVarianceEnhancerInvocation"] | components["schemas"]["ZImageTextEncoderInvocation"];
+ invocation: components["schemas"]["AddInvocation"] | components["schemas"]["AlphaMaskToTensorInvocation"] | components["schemas"]["AnimaDenoiseInvocation"] | components["schemas"]["AnimaImageToLatentsInvocation"] | components["schemas"]["AnimaLatentsToImageInvocation"] | components["schemas"]["AnimaLoRACollectionLoader"] | components["schemas"]["AnimaLoRALoaderInvocation"] | components["schemas"]["AnimaModelLoaderInvocation"] | components["schemas"]["AnimaTextEncoderInvocation"] | components["schemas"]["ApplyMaskTensorToImageInvocation"] | components["schemas"]["ApplyMaskToImageInvocation"] | components["schemas"]["BlankImageInvocation"] | components["schemas"]["BlendLatentsInvocation"] | components["schemas"]["BooleanCollectionInvocation"] | components["schemas"]["BooleanInvocation"] | components["schemas"]["BoundingBoxInvocation"] | components["schemas"]["CLIPSkipInvocation"] | components["schemas"]["CV2InfillInvocation"] | components["schemas"]["CalculateImageTilesEvenSplitInvocation"] | components["schemas"]["CalculateImageTilesInvocation"] | components["schemas"]["CalculateImageTilesMinimumOverlapInvocation"] | components["schemas"]["CannyEdgeDetectionInvocation"] | components["schemas"]["CanvasOutputInvocation"] | components["schemas"]["CanvasPasteBackInvocation"] | components["schemas"]["CanvasV2MaskAndCropInvocation"] | components["schemas"]["CenterPadCropInvocation"] | components["schemas"]["CogView4DenoiseInvocation"] | components["schemas"]["CogView4ImageToLatentsInvocation"] | components["schemas"]["CogView4LatentsToImageInvocation"] | components["schemas"]["CogView4ModelLoaderInvocation"] | components["schemas"]["CogView4TextEncoderInvocation"] | components["schemas"]["CollectInvocation"] | components["schemas"]["ColorCorrectInvocation"] | components["schemas"]["ColorInvocation"] | components["schemas"]["ColorMapInvocation"] | components["schemas"]["CompelInvocation"] | components["schemas"]["ConditioningCollectionInvocation"] | components["schemas"]["ConditioningInvocation"] | components["schemas"]["ContentShuffleInvocation"] | components["schemas"]["ControlNetInvocation"] | components["schemas"]["CoreMetadataInvocation"] | components["schemas"]["CreateDenoiseMaskInvocation"] | components["schemas"]["CreateGradientMaskInvocation"] | components["schemas"]["CropImageToBoundingBoxInvocation"] | components["schemas"]["CropLatentsCoreInvocation"] | components["schemas"]["CvInpaintInvocation"] | components["schemas"]["DWOpenposeDetectionInvocation"] | components["schemas"]["DecodeInvisibleWatermarkInvocation"] | components["schemas"]["DenoiseLatentsInvocation"] | components["schemas"]["DenoiseLatentsMetaInvocation"] | components["schemas"]["DepthAnythingDepthEstimationInvocation"] | components["schemas"]["DivideInvocation"] | components["schemas"]["DynamicPromptInvocation"] | components["schemas"]["ESRGANInvocation"] | components["schemas"]["ExpandMaskWithFadeInvocation"] | components["schemas"]["FLUXLoRACollectionLoader"] | components["schemas"]["FaceIdentifierInvocation"] | components["schemas"]["FaceMaskInvocation"] | components["schemas"]["FaceOffInvocation"] | components["schemas"]["FloatBatchInvocation"] | components["schemas"]["FloatCollectionInvocation"] | components["schemas"]["FloatGenerator"] | components["schemas"]["FloatInvocation"] | components["schemas"]["FloatLinearRangeInvocation"] | components["schemas"]["FloatMathInvocation"] | components["schemas"]["FloatToIntegerInvocation"] | components["schemas"]["Flux2DenoiseInvocation"] | components["schemas"]["Flux2KleinLoRACollectionLoader"] | components["schemas"]["Flux2KleinLoRALoaderInvocation"] | components["schemas"]["Flux2KleinModelLoaderInvocation"] | components["schemas"]["Flux2KleinTextEncoderInvocation"] | components["schemas"]["Flux2VaeDecodeInvocation"] | components["schemas"]["Flux2VaeEncodeInvocation"] | components["schemas"]["FluxControlLoRALoaderInvocation"] | components["schemas"]["FluxControlNetInvocation"] | components["schemas"]["FluxDenoiseInvocation"] | components["schemas"]["FluxDenoiseLatentsMetaInvocation"] | components["schemas"]["FluxFillInvocation"] | components["schemas"]["FluxIPAdapterInvocation"] | components["schemas"]["FluxKontextConcatenateImagesInvocation"] | components["schemas"]["FluxKontextInvocation"] | components["schemas"]["FluxLoRALoaderInvocation"] | components["schemas"]["FluxModelLoaderInvocation"] | components["schemas"]["FluxReduxInvocation"] | components["schemas"]["FluxTextEncoderInvocation"] | components["schemas"]["FluxVaeDecodeInvocation"] | components["schemas"]["FluxVaeEncodeInvocation"] | components["schemas"]["FreeUInvocation"] | components["schemas"]["GeminiImageGenerationInvocation"] | components["schemas"]["GetMaskBoundingBoxInvocation"] | components["schemas"]["GroundingDinoInvocation"] | components["schemas"]["HEDEdgeDetectionInvocation"] | components["schemas"]["HeuristicResizeInvocation"] | components["schemas"]["IPAdapterInvocation"] | components["schemas"]["IdealSizeInvocation"] | components["schemas"]["IfInvocation"] | components["schemas"]["ImageBatchInvocation"] | components["schemas"]["ImageBlurInvocation"] | components["schemas"]["ImageChannelInvocation"] | components["schemas"]["ImageChannelMultiplyInvocation"] | components["schemas"]["ImageChannelOffsetInvocation"] | components["schemas"]["ImageCollectionInvocation"] | components["schemas"]["ImageConvertInvocation"] | components["schemas"]["ImageCropInvocation"] | components["schemas"]["ImageGenerator"] | components["schemas"]["ImageHueAdjustmentInvocation"] | components["schemas"]["ImageInverseLerpInvocation"] | components["schemas"]["ImageInvocation"] | components["schemas"]["ImageLerpInvocation"] | components["schemas"]["ImageMaskToTensorInvocation"] | components["schemas"]["ImageMultiplyInvocation"] | components["schemas"]["ImageNSFWBlurInvocation"] | components["schemas"]["ImageNoiseInvocation"] | components["schemas"]["ImagePanelLayoutInvocation"] | components["schemas"]["ImagePasteInvocation"] | components["schemas"]["ImageResizeInvocation"] | components["schemas"]["ImageScaleInvocation"] | components["schemas"]["ImageToLatentsInvocation"] | components["schemas"]["ImageWatermarkInvocation"] | components["schemas"]["InfillColorInvocation"] | components["schemas"]["InfillPatchMatchInvocation"] | components["schemas"]["InfillTileInvocation"] | components["schemas"]["IntegerBatchInvocation"] | components["schemas"]["IntegerCollectionInvocation"] | components["schemas"]["IntegerGenerator"] | components["schemas"]["IntegerInvocation"] | components["schemas"]["IntegerMathInvocation"] | components["schemas"]["InvertTensorMaskInvocation"] | components["schemas"]["InvokeAdjustImageHuePlusInvocation"] | components["schemas"]["InvokeEquivalentAchromaticLightnessInvocation"] | components["schemas"]["InvokeImageBlendInvocation"] | components["schemas"]["InvokeImageCompositorInvocation"] | components["schemas"]["InvokeImageDilateOrErodeInvocation"] | components["schemas"]["InvokeImageEnhanceInvocation"] | components["schemas"]["InvokeImageValueThresholdsInvocation"] | components["schemas"]["IterateInvocation"] | components["schemas"]["LaMaInfillInvocation"] | components["schemas"]["LatentsCollectionInvocation"] | components["schemas"]["LatentsInvocation"] | components["schemas"]["LatentsToImageInvocation"] | components["schemas"]["LineartAnimeEdgeDetectionInvocation"] | components["schemas"]["LineartEdgeDetectionInvocation"] | components["schemas"]["LlavaOnevisionVllmInvocation"] | components["schemas"]["LoRACollectionLoader"] | components["schemas"]["LoRALoaderInvocation"] | components["schemas"]["LoRASelectorInvocation"] | components["schemas"]["MLSDDetectionInvocation"] | components["schemas"]["MainModelLoaderInvocation"] | components["schemas"]["MaskCombineInvocation"] | components["schemas"]["MaskEdgeInvocation"] | components["schemas"]["MaskFromAlphaInvocation"] | components["schemas"]["MaskFromIDInvocation"] | components["schemas"]["MaskTensorToImageInvocation"] | components["schemas"]["MediaPipeFaceDetectionInvocation"] | components["schemas"]["MergeMetadataInvocation"] | components["schemas"]["MergeTilesToImageInvocation"] | components["schemas"]["MetadataFieldExtractorInvocation"] | components["schemas"]["MetadataFromImageInvocation"] | components["schemas"]["MetadataInvocation"] | components["schemas"]["MetadataItemInvocation"] | components["schemas"]["MetadataItemLinkedInvocation"] | components["schemas"]["MetadataToBoolCollectionInvocation"] | components["schemas"]["MetadataToBoolInvocation"] | components["schemas"]["MetadataToControlnetsInvocation"] | components["schemas"]["MetadataToFloatCollectionInvocation"] | components["schemas"]["MetadataToFloatInvocation"] | components["schemas"]["MetadataToIPAdaptersInvocation"] | components["schemas"]["MetadataToIntegerCollectionInvocation"] | components["schemas"]["MetadataToIntegerInvocation"] | components["schemas"]["MetadataToLorasCollectionInvocation"] | components["schemas"]["MetadataToLorasInvocation"] | components["schemas"]["MetadataToModelInvocation"] | components["schemas"]["MetadataToSDXLLorasInvocation"] | components["schemas"]["MetadataToSDXLModelInvocation"] | components["schemas"]["MetadataToSchedulerInvocation"] | components["schemas"]["MetadataToStringCollectionInvocation"] | components["schemas"]["MetadataToStringInvocation"] | components["schemas"]["MetadataToT2IAdaptersInvocation"] | components["schemas"]["MetadataToVAEInvocation"] | components["schemas"]["ModelIdentifierInvocation"] | components["schemas"]["MultiplyInvocation"] | components["schemas"]["NoiseInvocation"] | components["schemas"]["NormalMapInvocation"] | components["schemas"]["OpenAIImageGenerationInvocation"] | components["schemas"]["PBRMapsInvocation"] | components["schemas"]["PairTileImageInvocation"] | components["schemas"]["PasteImageIntoBoundingBoxInvocation"] | components["schemas"]["PiDiNetEdgeDetectionInvocation"] | components["schemas"]["PromptTemplateInvocation"] | components["schemas"]["PromptsFromFileInvocation"] | components["schemas"]["QwenImageDenoiseInvocation"] | components["schemas"]["QwenImageImageToLatentsInvocation"] | components["schemas"]["QwenImageLatentsToImageInvocation"] | components["schemas"]["QwenImageLoRACollectionLoader"] | components["schemas"]["QwenImageLoRALoaderInvocation"] | components["schemas"]["QwenImageModelLoaderInvocation"] | components["schemas"]["QwenImageTextEncoderInvocation"] | components["schemas"]["RandomFloatInvocation"] | components["schemas"]["RandomIntInvocation"] | components["schemas"]["RandomRangeInvocation"] | components["schemas"]["RangeInvocation"] | components["schemas"]["RangeOfSizeInvocation"] | components["schemas"]["RectangleMaskInvocation"] | components["schemas"]["ResizeLatentsInvocation"] | components["schemas"]["RoundInvocation"] | components["schemas"]["SD3DenoiseInvocation"] | components["schemas"]["SD3ImageToLatentsInvocation"] | components["schemas"]["SD3LatentsToImageInvocation"] | components["schemas"]["SDXLCompelPromptInvocation"] | components["schemas"]["SDXLLoRACollectionLoader"] | components["schemas"]["SDXLLoRALoaderInvocation"] | components["schemas"]["SDXLModelLoaderInvocation"] | components["schemas"]["SDXLRefinerCompelPromptInvocation"] | components["schemas"]["SDXLRefinerModelLoaderInvocation"] | components["schemas"]["SaveImageInvocation"] | components["schemas"]["ScaleLatentsInvocation"] | components["schemas"]["SchedulerInvocation"] | components["schemas"]["Sd3ModelLoaderInvocation"] | components["schemas"]["Sd3TextEncoderInvocation"] | components["schemas"]["SeamlessModeInvocation"] | components["schemas"]["SegmentAnythingInvocation"] | components["schemas"]["ShowImageInvocation"] | components["schemas"]["SpandrelImageToImageAutoscaleInvocation"] | components["schemas"]["SpandrelImageToImageInvocation"] | components["schemas"]["StringBatchInvocation"] | components["schemas"]["StringCollectionInvocation"] | components["schemas"]["StringGenerator"] | components["schemas"]["StringInvocation"] | components["schemas"]["StringJoinInvocation"] | components["schemas"]["StringJoinThreeInvocation"] | components["schemas"]["StringReplaceInvocation"] | components["schemas"]["StringSplitInvocation"] | components["schemas"]["StringSplitNegInvocation"] | components["schemas"]["SubtractInvocation"] | components["schemas"]["T2IAdapterInvocation"] | components["schemas"]["TileToPropertiesInvocation"] | components["schemas"]["TiledMultiDiffusionDenoiseLatents"] | components["schemas"]["UnsharpMaskInvocation"] | components["schemas"]["VAELoaderInvocation"] | components["schemas"]["ZImageControlInvocation"] | components["schemas"]["ZImageDenoiseInvocation"] | components["schemas"]["ZImageDenoiseMetaInvocation"] | components["schemas"]["ZImageImageToLatentsInvocation"] | components["schemas"]["ZImageLatentsToImageInvocation"] | components["schemas"]["ZImageLoRACollectionLoader"] | components["schemas"]["ZImageLoRALoaderInvocation"] | components["schemas"]["ZImageModelLoaderInvocation"] | components["schemas"]["ZImageSeedVarianceEnhancerInvocation"] | components["schemas"]["ZImageTextEncoderInvocation"];
/**
* Invocation Source Id
* @description The ID of the prepared invocation's source node
@@ -14848,6 +15287,7 @@ export type components = {
flux_vae_decode: components["schemas"]["ImageOutput"];
flux_vae_encode: components["schemas"]["LatentsOutput"];
freeu: components["schemas"]["UNetOutput"];
+ gemini_image_generation: components["schemas"]["ImageCollectionOutput"];
get_image_mask_bounding_box: components["schemas"]["BoundingBoxOutput"];
grounding_dino: components["schemas"]["BoundingBoxCollectionOutput"];
hed_edge_detection: components["schemas"]["ImageOutput"];
@@ -14945,6 +15385,7 @@ export type components = {
mul: components["schemas"]["IntegerOutput"];
noise: components["schemas"]["NoiseOutput"];
normal_map: components["schemas"]["ImageOutput"];
+ openai_image_generation: components["schemas"]["ImageCollectionOutput"];
pair_tile_image: components["schemas"]["PairTileImageOutput"];
paste_image_into_bounding_box: components["schemas"]["ImageOutput"];
pbr_maps: components["schemas"]["PBRMapsOutput"];
@@ -15063,7 +15504,7 @@ export type components = {
* Invocation
* @description The ID of the invocation
*/
- invocation: components["schemas"]["AddInvocation"] | components["schemas"]["AlphaMaskToTensorInvocation"] | components["schemas"]["AnimaDenoiseInvocation"] | components["schemas"]["AnimaImageToLatentsInvocation"] | components["schemas"]["AnimaLatentsToImageInvocation"] | components["schemas"]["AnimaLoRACollectionLoader"] | components["schemas"]["AnimaLoRALoaderInvocation"] | components["schemas"]["AnimaModelLoaderInvocation"] | components["schemas"]["AnimaTextEncoderInvocation"] | components["schemas"]["ApplyMaskTensorToImageInvocation"] | components["schemas"]["ApplyMaskToImageInvocation"] | components["schemas"]["BlankImageInvocation"] | components["schemas"]["BlendLatentsInvocation"] | components["schemas"]["BooleanCollectionInvocation"] | components["schemas"]["BooleanInvocation"] | components["schemas"]["BoundingBoxInvocation"] | components["schemas"]["CLIPSkipInvocation"] | components["schemas"]["CV2InfillInvocation"] | components["schemas"]["CalculateImageTilesEvenSplitInvocation"] | components["schemas"]["CalculateImageTilesInvocation"] | components["schemas"]["CalculateImageTilesMinimumOverlapInvocation"] | components["schemas"]["CannyEdgeDetectionInvocation"] | components["schemas"]["CanvasOutputInvocation"] | components["schemas"]["CanvasPasteBackInvocation"] | components["schemas"]["CanvasV2MaskAndCropInvocation"] | components["schemas"]["CenterPadCropInvocation"] | components["schemas"]["CogView4DenoiseInvocation"] | components["schemas"]["CogView4ImageToLatentsInvocation"] | components["schemas"]["CogView4LatentsToImageInvocation"] | components["schemas"]["CogView4ModelLoaderInvocation"] | components["schemas"]["CogView4TextEncoderInvocation"] | components["schemas"]["CollectInvocation"] | components["schemas"]["ColorCorrectInvocation"] | components["schemas"]["ColorInvocation"] | components["schemas"]["ColorMapInvocation"] | components["schemas"]["CompelInvocation"] | components["schemas"]["ConditioningCollectionInvocation"] | components["schemas"]["ConditioningInvocation"] | components["schemas"]["ContentShuffleInvocation"] | components["schemas"]["ControlNetInvocation"] | components["schemas"]["CoreMetadataInvocation"] | components["schemas"]["CreateDenoiseMaskInvocation"] | components["schemas"]["CreateGradientMaskInvocation"] | components["schemas"]["CropImageToBoundingBoxInvocation"] | components["schemas"]["CropLatentsCoreInvocation"] | components["schemas"]["CvInpaintInvocation"] | components["schemas"]["DWOpenposeDetectionInvocation"] | components["schemas"]["DecodeInvisibleWatermarkInvocation"] | components["schemas"]["DenoiseLatentsInvocation"] | components["schemas"]["DenoiseLatentsMetaInvocation"] | components["schemas"]["DepthAnythingDepthEstimationInvocation"] | components["schemas"]["DivideInvocation"] | components["schemas"]["DynamicPromptInvocation"] | components["schemas"]["ESRGANInvocation"] | components["schemas"]["ExpandMaskWithFadeInvocation"] | components["schemas"]["FLUXLoRACollectionLoader"] | components["schemas"]["FaceIdentifierInvocation"] | components["schemas"]["FaceMaskInvocation"] | components["schemas"]["FaceOffInvocation"] | components["schemas"]["FloatBatchInvocation"] | components["schemas"]["FloatCollectionInvocation"] | components["schemas"]["FloatGenerator"] | components["schemas"]["FloatInvocation"] | components["schemas"]["FloatLinearRangeInvocation"] | components["schemas"]["FloatMathInvocation"] | components["schemas"]["FloatToIntegerInvocation"] | components["schemas"]["Flux2DenoiseInvocation"] | components["schemas"]["Flux2KleinLoRACollectionLoader"] | components["schemas"]["Flux2KleinLoRALoaderInvocation"] | components["schemas"]["Flux2KleinModelLoaderInvocation"] | components["schemas"]["Flux2KleinTextEncoderInvocation"] | components["schemas"]["Flux2VaeDecodeInvocation"] | components["schemas"]["Flux2VaeEncodeInvocation"] | components["schemas"]["FluxControlLoRALoaderInvocation"] | components["schemas"]["FluxControlNetInvocation"] | components["schemas"]["FluxDenoiseInvocation"] | components["schemas"]["FluxDenoiseLatentsMetaInvocation"] | components["schemas"]["FluxFillInvocation"] | components["schemas"]["FluxIPAdapterInvocation"] | components["schemas"]["FluxKontextConcatenateImagesInvocation"] | components["schemas"]["FluxKontextInvocation"] | components["schemas"]["FluxLoRALoaderInvocation"] | components["schemas"]["FluxModelLoaderInvocation"] | components["schemas"]["FluxReduxInvocation"] | components["schemas"]["FluxTextEncoderInvocation"] | components["schemas"]["FluxVaeDecodeInvocation"] | components["schemas"]["FluxVaeEncodeInvocation"] | components["schemas"]["FreeUInvocation"] | components["schemas"]["GetMaskBoundingBoxInvocation"] | components["schemas"]["GroundingDinoInvocation"] | components["schemas"]["HEDEdgeDetectionInvocation"] | components["schemas"]["HeuristicResizeInvocation"] | components["schemas"]["IPAdapterInvocation"] | components["schemas"]["IdealSizeInvocation"] | components["schemas"]["IfInvocation"] | components["schemas"]["ImageBatchInvocation"] | components["schemas"]["ImageBlurInvocation"] | components["schemas"]["ImageChannelInvocation"] | components["schemas"]["ImageChannelMultiplyInvocation"] | components["schemas"]["ImageChannelOffsetInvocation"] | components["schemas"]["ImageCollectionInvocation"] | components["schemas"]["ImageConvertInvocation"] | components["schemas"]["ImageCropInvocation"] | components["schemas"]["ImageGenerator"] | components["schemas"]["ImageHueAdjustmentInvocation"] | components["schemas"]["ImageInverseLerpInvocation"] | components["schemas"]["ImageInvocation"] | components["schemas"]["ImageLerpInvocation"] | components["schemas"]["ImageMaskToTensorInvocation"] | components["schemas"]["ImageMultiplyInvocation"] | components["schemas"]["ImageNSFWBlurInvocation"] | components["schemas"]["ImageNoiseInvocation"] | components["schemas"]["ImagePanelLayoutInvocation"] | components["schemas"]["ImagePasteInvocation"] | components["schemas"]["ImageResizeInvocation"] | components["schemas"]["ImageScaleInvocation"] | components["schemas"]["ImageToLatentsInvocation"] | components["schemas"]["ImageWatermarkInvocation"] | components["schemas"]["InfillColorInvocation"] | components["schemas"]["InfillPatchMatchInvocation"] | components["schemas"]["InfillTileInvocation"] | components["schemas"]["IntegerBatchInvocation"] | components["schemas"]["IntegerCollectionInvocation"] | components["schemas"]["IntegerGenerator"] | components["schemas"]["IntegerInvocation"] | components["schemas"]["IntegerMathInvocation"] | components["schemas"]["InvertTensorMaskInvocation"] | components["schemas"]["InvokeAdjustImageHuePlusInvocation"] | components["schemas"]["InvokeEquivalentAchromaticLightnessInvocation"] | components["schemas"]["InvokeImageBlendInvocation"] | components["schemas"]["InvokeImageCompositorInvocation"] | components["schemas"]["InvokeImageDilateOrErodeInvocation"] | components["schemas"]["InvokeImageEnhanceInvocation"] | components["schemas"]["InvokeImageValueThresholdsInvocation"] | components["schemas"]["IterateInvocation"] | components["schemas"]["LaMaInfillInvocation"] | components["schemas"]["LatentsCollectionInvocation"] | components["schemas"]["LatentsInvocation"] | components["schemas"]["LatentsToImageInvocation"] | components["schemas"]["LineartAnimeEdgeDetectionInvocation"] | components["schemas"]["LineartEdgeDetectionInvocation"] | components["schemas"]["LlavaOnevisionVllmInvocation"] | components["schemas"]["LoRACollectionLoader"] | components["schemas"]["LoRALoaderInvocation"] | components["schemas"]["LoRASelectorInvocation"] | components["schemas"]["MLSDDetectionInvocation"] | components["schemas"]["MainModelLoaderInvocation"] | components["schemas"]["MaskCombineInvocation"] | components["schemas"]["MaskEdgeInvocation"] | components["schemas"]["MaskFromAlphaInvocation"] | components["schemas"]["MaskFromIDInvocation"] | components["schemas"]["MaskTensorToImageInvocation"] | components["schemas"]["MediaPipeFaceDetectionInvocation"] | components["schemas"]["MergeMetadataInvocation"] | components["schemas"]["MergeTilesToImageInvocation"] | components["schemas"]["MetadataFieldExtractorInvocation"] | components["schemas"]["MetadataFromImageInvocation"] | components["schemas"]["MetadataInvocation"] | components["schemas"]["MetadataItemInvocation"] | components["schemas"]["MetadataItemLinkedInvocation"] | components["schemas"]["MetadataToBoolCollectionInvocation"] | components["schemas"]["MetadataToBoolInvocation"] | components["schemas"]["MetadataToControlnetsInvocation"] | components["schemas"]["MetadataToFloatCollectionInvocation"] | components["schemas"]["MetadataToFloatInvocation"] | components["schemas"]["MetadataToIPAdaptersInvocation"] | components["schemas"]["MetadataToIntegerCollectionInvocation"] | components["schemas"]["MetadataToIntegerInvocation"] | components["schemas"]["MetadataToLorasCollectionInvocation"] | components["schemas"]["MetadataToLorasInvocation"] | components["schemas"]["MetadataToModelInvocation"] | components["schemas"]["MetadataToSDXLLorasInvocation"] | components["schemas"]["MetadataToSDXLModelInvocation"] | components["schemas"]["MetadataToSchedulerInvocation"] | components["schemas"]["MetadataToStringCollectionInvocation"] | components["schemas"]["MetadataToStringInvocation"] | components["schemas"]["MetadataToT2IAdaptersInvocation"] | components["schemas"]["MetadataToVAEInvocation"] | components["schemas"]["ModelIdentifierInvocation"] | components["schemas"]["MultiplyInvocation"] | components["schemas"]["NoiseInvocation"] | components["schemas"]["NormalMapInvocation"] | components["schemas"]["PBRMapsInvocation"] | components["schemas"]["PairTileImageInvocation"] | components["schemas"]["PasteImageIntoBoundingBoxInvocation"] | components["schemas"]["PiDiNetEdgeDetectionInvocation"] | components["schemas"]["PromptTemplateInvocation"] | components["schemas"]["PromptsFromFileInvocation"] | components["schemas"]["QwenImageDenoiseInvocation"] | components["schemas"]["QwenImageImageToLatentsInvocation"] | components["schemas"]["QwenImageLatentsToImageInvocation"] | components["schemas"]["QwenImageLoRACollectionLoader"] | components["schemas"]["QwenImageLoRALoaderInvocation"] | components["schemas"]["QwenImageModelLoaderInvocation"] | components["schemas"]["QwenImageTextEncoderInvocation"] | components["schemas"]["RandomFloatInvocation"] | components["schemas"]["RandomIntInvocation"] | components["schemas"]["RandomRangeInvocation"] | components["schemas"]["RangeInvocation"] | components["schemas"]["RangeOfSizeInvocation"] | components["schemas"]["RectangleMaskInvocation"] | components["schemas"]["ResizeLatentsInvocation"] | components["schemas"]["RoundInvocation"] | components["schemas"]["SD3DenoiseInvocation"] | components["schemas"]["SD3ImageToLatentsInvocation"] | components["schemas"]["SD3LatentsToImageInvocation"] | components["schemas"]["SDXLCompelPromptInvocation"] | components["schemas"]["SDXLLoRACollectionLoader"] | components["schemas"]["SDXLLoRALoaderInvocation"] | components["schemas"]["SDXLModelLoaderInvocation"] | components["schemas"]["SDXLRefinerCompelPromptInvocation"] | components["schemas"]["SDXLRefinerModelLoaderInvocation"] | components["schemas"]["SaveImageInvocation"] | components["schemas"]["ScaleLatentsInvocation"] | components["schemas"]["SchedulerInvocation"] | components["schemas"]["Sd3ModelLoaderInvocation"] | components["schemas"]["Sd3TextEncoderInvocation"] | components["schemas"]["SeamlessModeInvocation"] | components["schemas"]["SegmentAnythingInvocation"] | components["schemas"]["ShowImageInvocation"] | components["schemas"]["SpandrelImageToImageAutoscaleInvocation"] | components["schemas"]["SpandrelImageToImageInvocation"] | components["schemas"]["StringBatchInvocation"] | components["schemas"]["StringCollectionInvocation"] | components["schemas"]["StringGenerator"] | components["schemas"]["StringInvocation"] | components["schemas"]["StringJoinInvocation"] | components["schemas"]["StringJoinThreeInvocation"] | components["schemas"]["StringReplaceInvocation"] | components["schemas"]["StringSplitInvocation"] | components["schemas"]["StringSplitNegInvocation"] | components["schemas"]["SubtractInvocation"] | components["schemas"]["T2IAdapterInvocation"] | components["schemas"]["TileToPropertiesInvocation"] | components["schemas"]["TiledMultiDiffusionDenoiseLatents"] | components["schemas"]["UnsharpMaskInvocation"] | components["schemas"]["VAELoaderInvocation"] | components["schemas"]["ZImageControlInvocation"] | components["schemas"]["ZImageDenoiseInvocation"] | components["schemas"]["ZImageDenoiseMetaInvocation"] | components["schemas"]["ZImageImageToLatentsInvocation"] | components["schemas"]["ZImageLatentsToImageInvocation"] | components["schemas"]["ZImageLoRACollectionLoader"] | components["schemas"]["ZImageLoRALoaderInvocation"] | components["schemas"]["ZImageModelLoaderInvocation"] | components["schemas"]["ZImageSeedVarianceEnhancerInvocation"] | components["schemas"]["ZImageTextEncoderInvocation"];
+ invocation: components["schemas"]["AddInvocation"] | components["schemas"]["AlphaMaskToTensorInvocation"] | components["schemas"]["AnimaDenoiseInvocation"] | components["schemas"]["AnimaImageToLatentsInvocation"] | components["schemas"]["AnimaLatentsToImageInvocation"] | components["schemas"]["AnimaLoRACollectionLoader"] | components["schemas"]["AnimaLoRALoaderInvocation"] | components["schemas"]["AnimaModelLoaderInvocation"] | components["schemas"]["AnimaTextEncoderInvocation"] | components["schemas"]["ApplyMaskTensorToImageInvocation"] | components["schemas"]["ApplyMaskToImageInvocation"] | components["schemas"]["BlankImageInvocation"] | components["schemas"]["BlendLatentsInvocation"] | components["schemas"]["BooleanCollectionInvocation"] | components["schemas"]["BooleanInvocation"] | components["schemas"]["BoundingBoxInvocation"] | components["schemas"]["CLIPSkipInvocation"] | components["schemas"]["CV2InfillInvocation"] | components["schemas"]["CalculateImageTilesEvenSplitInvocation"] | components["schemas"]["CalculateImageTilesInvocation"] | components["schemas"]["CalculateImageTilesMinimumOverlapInvocation"] | components["schemas"]["CannyEdgeDetectionInvocation"] | components["schemas"]["CanvasOutputInvocation"] | components["schemas"]["CanvasPasteBackInvocation"] | components["schemas"]["CanvasV2MaskAndCropInvocation"] | components["schemas"]["CenterPadCropInvocation"] | components["schemas"]["CogView4DenoiseInvocation"] | components["schemas"]["CogView4ImageToLatentsInvocation"] | components["schemas"]["CogView4LatentsToImageInvocation"] | components["schemas"]["CogView4ModelLoaderInvocation"] | components["schemas"]["CogView4TextEncoderInvocation"] | components["schemas"]["CollectInvocation"] | components["schemas"]["ColorCorrectInvocation"] | components["schemas"]["ColorInvocation"] | components["schemas"]["ColorMapInvocation"] | components["schemas"]["CompelInvocation"] | components["schemas"]["ConditioningCollectionInvocation"] | components["schemas"]["ConditioningInvocation"] | components["schemas"]["ContentShuffleInvocation"] | components["schemas"]["ControlNetInvocation"] | components["schemas"]["CoreMetadataInvocation"] | components["schemas"]["CreateDenoiseMaskInvocation"] | components["schemas"]["CreateGradientMaskInvocation"] | components["schemas"]["CropImageToBoundingBoxInvocation"] | components["schemas"]["CropLatentsCoreInvocation"] | components["schemas"]["CvInpaintInvocation"] | components["schemas"]["DWOpenposeDetectionInvocation"] | components["schemas"]["DecodeInvisibleWatermarkInvocation"] | components["schemas"]["DenoiseLatentsInvocation"] | components["schemas"]["DenoiseLatentsMetaInvocation"] | components["schemas"]["DepthAnythingDepthEstimationInvocation"] | components["schemas"]["DivideInvocation"] | components["schemas"]["DynamicPromptInvocation"] | components["schemas"]["ESRGANInvocation"] | components["schemas"]["ExpandMaskWithFadeInvocation"] | components["schemas"]["FLUXLoRACollectionLoader"] | components["schemas"]["FaceIdentifierInvocation"] | components["schemas"]["FaceMaskInvocation"] | components["schemas"]["FaceOffInvocation"] | components["schemas"]["FloatBatchInvocation"] | components["schemas"]["FloatCollectionInvocation"] | components["schemas"]["FloatGenerator"] | components["schemas"]["FloatInvocation"] | components["schemas"]["FloatLinearRangeInvocation"] | components["schemas"]["FloatMathInvocation"] | components["schemas"]["FloatToIntegerInvocation"] | components["schemas"]["Flux2DenoiseInvocation"] | components["schemas"]["Flux2KleinLoRACollectionLoader"] | components["schemas"]["Flux2KleinLoRALoaderInvocation"] | components["schemas"]["Flux2KleinModelLoaderInvocation"] | components["schemas"]["Flux2KleinTextEncoderInvocation"] | components["schemas"]["Flux2VaeDecodeInvocation"] | components["schemas"]["Flux2VaeEncodeInvocation"] | components["schemas"]["FluxControlLoRALoaderInvocation"] | components["schemas"]["FluxControlNetInvocation"] | components["schemas"]["FluxDenoiseInvocation"] | components["schemas"]["FluxDenoiseLatentsMetaInvocation"] | components["schemas"]["FluxFillInvocation"] | components["schemas"]["FluxIPAdapterInvocation"] | components["schemas"]["FluxKontextConcatenateImagesInvocation"] | components["schemas"]["FluxKontextInvocation"] | components["schemas"]["FluxLoRALoaderInvocation"] | components["schemas"]["FluxModelLoaderInvocation"] | components["schemas"]["FluxReduxInvocation"] | components["schemas"]["FluxTextEncoderInvocation"] | components["schemas"]["FluxVaeDecodeInvocation"] | components["schemas"]["FluxVaeEncodeInvocation"] | components["schemas"]["FreeUInvocation"] | components["schemas"]["GeminiImageGenerationInvocation"] | components["schemas"]["GetMaskBoundingBoxInvocation"] | components["schemas"]["GroundingDinoInvocation"] | components["schemas"]["HEDEdgeDetectionInvocation"] | components["schemas"]["HeuristicResizeInvocation"] | components["schemas"]["IPAdapterInvocation"] | components["schemas"]["IdealSizeInvocation"] | components["schemas"]["IfInvocation"] | components["schemas"]["ImageBatchInvocation"] | components["schemas"]["ImageBlurInvocation"] | components["schemas"]["ImageChannelInvocation"] | components["schemas"]["ImageChannelMultiplyInvocation"] | components["schemas"]["ImageChannelOffsetInvocation"] | components["schemas"]["ImageCollectionInvocation"] | components["schemas"]["ImageConvertInvocation"] | components["schemas"]["ImageCropInvocation"] | components["schemas"]["ImageGenerator"] | components["schemas"]["ImageHueAdjustmentInvocation"] | components["schemas"]["ImageInverseLerpInvocation"] | components["schemas"]["ImageInvocation"] | components["schemas"]["ImageLerpInvocation"] | components["schemas"]["ImageMaskToTensorInvocation"] | components["schemas"]["ImageMultiplyInvocation"] | components["schemas"]["ImageNSFWBlurInvocation"] | components["schemas"]["ImageNoiseInvocation"] | components["schemas"]["ImagePanelLayoutInvocation"] | components["schemas"]["ImagePasteInvocation"] | components["schemas"]["ImageResizeInvocation"] | components["schemas"]["ImageScaleInvocation"] | components["schemas"]["ImageToLatentsInvocation"] | components["schemas"]["ImageWatermarkInvocation"] | components["schemas"]["InfillColorInvocation"] | components["schemas"]["InfillPatchMatchInvocation"] | components["schemas"]["InfillTileInvocation"] | components["schemas"]["IntegerBatchInvocation"] | components["schemas"]["IntegerCollectionInvocation"] | components["schemas"]["IntegerGenerator"] | components["schemas"]["IntegerInvocation"] | components["schemas"]["IntegerMathInvocation"] | components["schemas"]["InvertTensorMaskInvocation"] | components["schemas"]["InvokeAdjustImageHuePlusInvocation"] | components["schemas"]["InvokeEquivalentAchromaticLightnessInvocation"] | components["schemas"]["InvokeImageBlendInvocation"] | components["schemas"]["InvokeImageCompositorInvocation"] | components["schemas"]["InvokeImageDilateOrErodeInvocation"] | components["schemas"]["InvokeImageEnhanceInvocation"] | components["schemas"]["InvokeImageValueThresholdsInvocation"] | components["schemas"]["IterateInvocation"] | components["schemas"]["LaMaInfillInvocation"] | components["schemas"]["LatentsCollectionInvocation"] | components["schemas"]["LatentsInvocation"] | components["schemas"]["LatentsToImageInvocation"] | components["schemas"]["LineartAnimeEdgeDetectionInvocation"] | components["schemas"]["LineartEdgeDetectionInvocation"] | components["schemas"]["LlavaOnevisionVllmInvocation"] | components["schemas"]["LoRACollectionLoader"] | components["schemas"]["LoRALoaderInvocation"] | components["schemas"]["LoRASelectorInvocation"] | components["schemas"]["MLSDDetectionInvocation"] | components["schemas"]["MainModelLoaderInvocation"] | components["schemas"]["MaskCombineInvocation"] | components["schemas"]["MaskEdgeInvocation"] | components["schemas"]["MaskFromAlphaInvocation"] | components["schemas"]["MaskFromIDInvocation"] | components["schemas"]["MaskTensorToImageInvocation"] | components["schemas"]["MediaPipeFaceDetectionInvocation"] | components["schemas"]["MergeMetadataInvocation"] | components["schemas"]["MergeTilesToImageInvocation"] | components["schemas"]["MetadataFieldExtractorInvocation"] | components["schemas"]["MetadataFromImageInvocation"] | components["schemas"]["MetadataInvocation"] | components["schemas"]["MetadataItemInvocation"] | components["schemas"]["MetadataItemLinkedInvocation"] | components["schemas"]["MetadataToBoolCollectionInvocation"] | components["schemas"]["MetadataToBoolInvocation"] | components["schemas"]["MetadataToControlnetsInvocation"] | components["schemas"]["MetadataToFloatCollectionInvocation"] | components["schemas"]["MetadataToFloatInvocation"] | components["schemas"]["MetadataToIPAdaptersInvocation"] | components["schemas"]["MetadataToIntegerCollectionInvocation"] | components["schemas"]["MetadataToIntegerInvocation"] | components["schemas"]["MetadataToLorasCollectionInvocation"] | components["schemas"]["MetadataToLorasInvocation"] | components["schemas"]["MetadataToModelInvocation"] | components["schemas"]["MetadataToSDXLLorasInvocation"] | components["schemas"]["MetadataToSDXLModelInvocation"] | components["schemas"]["MetadataToSchedulerInvocation"] | components["schemas"]["MetadataToStringCollectionInvocation"] | components["schemas"]["MetadataToStringInvocation"] | components["schemas"]["MetadataToT2IAdaptersInvocation"] | components["schemas"]["MetadataToVAEInvocation"] | components["schemas"]["ModelIdentifierInvocation"] | components["schemas"]["MultiplyInvocation"] | components["schemas"]["NoiseInvocation"] | components["schemas"]["NormalMapInvocation"] | components["schemas"]["OpenAIImageGenerationInvocation"] | components["schemas"]["PBRMapsInvocation"] | components["schemas"]["PairTileImageInvocation"] | components["schemas"]["PasteImageIntoBoundingBoxInvocation"] | components["schemas"]["PiDiNetEdgeDetectionInvocation"] | components["schemas"]["PromptTemplateInvocation"] | components["schemas"]["PromptsFromFileInvocation"] | components["schemas"]["QwenImageDenoiseInvocation"] | components["schemas"]["QwenImageImageToLatentsInvocation"] | components["schemas"]["QwenImageLatentsToImageInvocation"] | components["schemas"]["QwenImageLoRACollectionLoader"] | components["schemas"]["QwenImageLoRALoaderInvocation"] | components["schemas"]["QwenImageModelLoaderInvocation"] | components["schemas"]["QwenImageTextEncoderInvocation"] | components["schemas"]["RandomFloatInvocation"] | components["schemas"]["RandomIntInvocation"] | components["schemas"]["RandomRangeInvocation"] | components["schemas"]["RangeInvocation"] | components["schemas"]["RangeOfSizeInvocation"] | components["schemas"]["RectangleMaskInvocation"] | components["schemas"]["ResizeLatentsInvocation"] | components["schemas"]["RoundInvocation"] | components["schemas"]["SD3DenoiseInvocation"] | components["schemas"]["SD3ImageToLatentsInvocation"] | components["schemas"]["SD3LatentsToImageInvocation"] | components["schemas"]["SDXLCompelPromptInvocation"] | components["schemas"]["SDXLLoRACollectionLoader"] | components["schemas"]["SDXLLoRALoaderInvocation"] | components["schemas"]["SDXLModelLoaderInvocation"] | components["schemas"]["SDXLRefinerCompelPromptInvocation"] | components["schemas"]["SDXLRefinerModelLoaderInvocation"] | components["schemas"]["SaveImageInvocation"] | components["schemas"]["ScaleLatentsInvocation"] | components["schemas"]["SchedulerInvocation"] | components["schemas"]["Sd3ModelLoaderInvocation"] | components["schemas"]["Sd3TextEncoderInvocation"] | components["schemas"]["SeamlessModeInvocation"] | components["schemas"]["SegmentAnythingInvocation"] | components["schemas"]["ShowImageInvocation"] | components["schemas"]["SpandrelImageToImageAutoscaleInvocation"] | components["schemas"]["SpandrelImageToImageInvocation"] | components["schemas"]["StringBatchInvocation"] | components["schemas"]["StringCollectionInvocation"] | components["schemas"]["StringGenerator"] | components["schemas"]["StringInvocation"] | components["schemas"]["StringJoinInvocation"] | components["schemas"]["StringJoinThreeInvocation"] | components["schemas"]["StringReplaceInvocation"] | components["schemas"]["StringSplitInvocation"] | components["schemas"]["StringSplitNegInvocation"] | components["schemas"]["SubtractInvocation"] | components["schemas"]["T2IAdapterInvocation"] | components["schemas"]["TileToPropertiesInvocation"] | components["schemas"]["TiledMultiDiffusionDenoiseLatents"] | components["schemas"]["UnsharpMaskInvocation"] | components["schemas"]["VAELoaderInvocation"] | components["schemas"]["ZImageControlInvocation"] | components["schemas"]["ZImageDenoiseInvocation"] | components["schemas"]["ZImageDenoiseMetaInvocation"] | components["schemas"]["ZImageImageToLatentsInvocation"] | components["schemas"]["ZImageLatentsToImageInvocation"] | components["schemas"]["ZImageLoRACollectionLoader"] | components["schemas"]["ZImageLoRALoaderInvocation"] | components["schemas"]["ZImageModelLoaderInvocation"] | components["schemas"]["ZImageSeedVarianceEnhancerInvocation"] | components["schemas"]["ZImageTextEncoderInvocation"];
/**
* Invocation Source Id
* @description The ID of the prepared invocation's source node
@@ -15138,7 +15579,7 @@ export type components = {
* Invocation
* @description The ID of the invocation
*/
- invocation: components["schemas"]["AddInvocation"] | components["schemas"]["AlphaMaskToTensorInvocation"] | components["schemas"]["AnimaDenoiseInvocation"] | components["schemas"]["AnimaImageToLatentsInvocation"] | components["schemas"]["AnimaLatentsToImageInvocation"] | components["schemas"]["AnimaLoRACollectionLoader"] | components["schemas"]["AnimaLoRALoaderInvocation"] | components["schemas"]["AnimaModelLoaderInvocation"] | components["schemas"]["AnimaTextEncoderInvocation"] | components["schemas"]["ApplyMaskTensorToImageInvocation"] | components["schemas"]["ApplyMaskToImageInvocation"] | components["schemas"]["BlankImageInvocation"] | components["schemas"]["BlendLatentsInvocation"] | components["schemas"]["BooleanCollectionInvocation"] | components["schemas"]["BooleanInvocation"] | components["schemas"]["BoundingBoxInvocation"] | components["schemas"]["CLIPSkipInvocation"] | components["schemas"]["CV2InfillInvocation"] | components["schemas"]["CalculateImageTilesEvenSplitInvocation"] | components["schemas"]["CalculateImageTilesInvocation"] | components["schemas"]["CalculateImageTilesMinimumOverlapInvocation"] | components["schemas"]["CannyEdgeDetectionInvocation"] | components["schemas"]["CanvasOutputInvocation"] | components["schemas"]["CanvasPasteBackInvocation"] | components["schemas"]["CanvasV2MaskAndCropInvocation"] | components["schemas"]["CenterPadCropInvocation"] | components["schemas"]["CogView4DenoiseInvocation"] | components["schemas"]["CogView4ImageToLatentsInvocation"] | components["schemas"]["CogView4LatentsToImageInvocation"] | components["schemas"]["CogView4ModelLoaderInvocation"] | components["schemas"]["CogView4TextEncoderInvocation"] | components["schemas"]["CollectInvocation"] | components["schemas"]["ColorCorrectInvocation"] | components["schemas"]["ColorInvocation"] | components["schemas"]["ColorMapInvocation"] | components["schemas"]["CompelInvocation"] | components["schemas"]["ConditioningCollectionInvocation"] | components["schemas"]["ConditioningInvocation"] | components["schemas"]["ContentShuffleInvocation"] | components["schemas"]["ControlNetInvocation"] | components["schemas"]["CoreMetadataInvocation"] | components["schemas"]["CreateDenoiseMaskInvocation"] | components["schemas"]["CreateGradientMaskInvocation"] | components["schemas"]["CropImageToBoundingBoxInvocation"] | components["schemas"]["CropLatentsCoreInvocation"] | components["schemas"]["CvInpaintInvocation"] | components["schemas"]["DWOpenposeDetectionInvocation"] | components["schemas"]["DecodeInvisibleWatermarkInvocation"] | components["schemas"]["DenoiseLatentsInvocation"] | components["schemas"]["DenoiseLatentsMetaInvocation"] | components["schemas"]["DepthAnythingDepthEstimationInvocation"] | components["schemas"]["DivideInvocation"] | components["schemas"]["DynamicPromptInvocation"] | components["schemas"]["ESRGANInvocation"] | components["schemas"]["ExpandMaskWithFadeInvocation"] | components["schemas"]["FLUXLoRACollectionLoader"] | components["schemas"]["FaceIdentifierInvocation"] | components["schemas"]["FaceMaskInvocation"] | components["schemas"]["FaceOffInvocation"] | components["schemas"]["FloatBatchInvocation"] | components["schemas"]["FloatCollectionInvocation"] | components["schemas"]["FloatGenerator"] | components["schemas"]["FloatInvocation"] | components["schemas"]["FloatLinearRangeInvocation"] | components["schemas"]["FloatMathInvocation"] | components["schemas"]["FloatToIntegerInvocation"] | components["schemas"]["Flux2DenoiseInvocation"] | components["schemas"]["Flux2KleinLoRACollectionLoader"] | components["schemas"]["Flux2KleinLoRALoaderInvocation"] | components["schemas"]["Flux2KleinModelLoaderInvocation"] | components["schemas"]["Flux2KleinTextEncoderInvocation"] | components["schemas"]["Flux2VaeDecodeInvocation"] | components["schemas"]["Flux2VaeEncodeInvocation"] | components["schemas"]["FluxControlLoRALoaderInvocation"] | components["schemas"]["FluxControlNetInvocation"] | components["schemas"]["FluxDenoiseInvocation"] | components["schemas"]["FluxDenoiseLatentsMetaInvocation"] | components["schemas"]["FluxFillInvocation"] | components["schemas"]["FluxIPAdapterInvocation"] | components["schemas"]["FluxKontextConcatenateImagesInvocation"] | components["schemas"]["FluxKontextInvocation"] | components["schemas"]["FluxLoRALoaderInvocation"] | components["schemas"]["FluxModelLoaderInvocation"] | components["schemas"]["FluxReduxInvocation"] | components["schemas"]["FluxTextEncoderInvocation"] | components["schemas"]["FluxVaeDecodeInvocation"] | components["schemas"]["FluxVaeEncodeInvocation"] | components["schemas"]["FreeUInvocation"] | components["schemas"]["GetMaskBoundingBoxInvocation"] | components["schemas"]["GroundingDinoInvocation"] | components["schemas"]["HEDEdgeDetectionInvocation"] | components["schemas"]["HeuristicResizeInvocation"] | components["schemas"]["IPAdapterInvocation"] | components["schemas"]["IdealSizeInvocation"] | components["schemas"]["IfInvocation"] | components["schemas"]["ImageBatchInvocation"] | components["schemas"]["ImageBlurInvocation"] | components["schemas"]["ImageChannelInvocation"] | components["schemas"]["ImageChannelMultiplyInvocation"] | components["schemas"]["ImageChannelOffsetInvocation"] | components["schemas"]["ImageCollectionInvocation"] | components["schemas"]["ImageConvertInvocation"] | components["schemas"]["ImageCropInvocation"] | components["schemas"]["ImageGenerator"] | components["schemas"]["ImageHueAdjustmentInvocation"] | components["schemas"]["ImageInverseLerpInvocation"] | components["schemas"]["ImageInvocation"] | components["schemas"]["ImageLerpInvocation"] | components["schemas"]["ImageMaskToTensorInvocation"] | components["schemas"]["ImageMultiplyInvocation"] | components["schemas"]["ImageNSFWBlurInvocation"] | components["schemas"]["ImageNoiseInvocation"] | components["schemas"]["ImagePanelLayoutInvocation"] | components["schemas"]["ImagePasteInvocation"] | components["schemas"]["ImageResizeInvocation"] | components["schemas"]["ImageScaleInvocation"] | components["schemas"]["ImageToLatentsInvocation"] | components["schemas"]["ImageWatermarkInvocation"] | components["schemas"]["InfillColorInvocation"] | components["schemas"]["InfillPatchMatchInvocation"] | components["schemas"]["InfillTileInvocation"] | components["schemas"]["IntegerBatchInvocation"] | components["schemas"]["IntegerCollectionInvocation"] | components["schemas"]["IntegerGenerator"] | components["schemas"]["IntegerInvocation"] | components["schemas"]["IntegerMathInvocation"] | components["schemas"]["InvertTensorMaskInvocation"] | components["schemas"]["InvokeAdjustImageHuePlusInvocation"] | components["schemas"]["InvokeEquivalentAchromaticLightnessInvocation"] | components["schemas"]["InvokeImageBlendInvocation"] | components["schemas"]["InvokeImageCompositorInvocation"] | components["schemas"]["InvokeImageDilateOrErodeInvocation"] | components["schemas"]["InvokeImageEnhanceInvocation"] | components["schemas"]["InvokeImageValueThresholdsInvocation"] | components["schemas"]["IterateInvocation"] | components["schemas"]["LaMaInfillInvocation"] | components["schemas"]["LatentsCollectionInvocation"] | components["schemas"]["LatentsInvocation"] | components["schemas"]["LatentsToImageInvocation"] | components["schemas"]["LineartAnimeEdgeDetectionInvocation"] | components["schemas"]["LineartEdgeDetectionInvocation"] | components["schemas"]["LlavaOnevisionVllmInvocation"] | components["schemas"]["LoRACollectionLoader"] | components["schemas"]["LoRALoaderInvocation"] | components["schemas"]["LoRASelectorInvocation"] | components["schemas"]["MLSDDetectionInvocation"] | components["schemas"]["MainModelLoaderInvocation"] | components["schemas"]["MaskCombineInvocation"] | components["schemas"]["MaskEdgeInvocation"] | components["schemas"]["MaskFromAlphaInvocation"] | components["schemas"]["MaskFromIDInvocation"] | components["schemas"]["MaskTensorToImageInvocation"] | components["schemas"]["MediaPipeFaceDetectionInvocation"] | components["schemas"]["MergeMetadataInvocation"] | components["schemas"]["MergeTilesToImageInvocation"] | components["schemas"]["MetadataFieldExtractorInvocation"] | components["schemas"]["MetadataFromImageInvocation"] | components["schemas"]["MetadataInvocation"] | components["schemas"]["MetadataItemInvocation"] | components["schemas"]["MetadataItemLinkedInvocation"] | components["schemas"]["MetadataToBoolCollectionInvocation"] | components["schemas"]["MetadataToBoolInvocation"] | components["schemas"]["MetadataToControlnetsInvocation"] | components["schemas"]["MetadataToFloatCollectionInvocation"] | components["schemas"]["MetadataToFloatInvocation"] | components["schemas"]["MetadataToIPAdaptersInvocation"] | components["schemas"]["MetadataToIntegerCollectionInvocation"] | components["schemas"]["MetadataToIntegerInvocation"] | components["schemas"]["MetadataToLorasCollectionInvocation"] | components["schemas"]["MetadataToLorasInvocation"] | components["schemas"]["MetadataToModelInvocation"] | components["schemas"]["MetadataToSDXLLorasInvocation"] | components["schemas"]["MetadataToSDXLModelInvocation"] | components["schemas"]["MetadataToSchedulerInvocation"] | components["schemas"]["MetadataToStringCollectionInvocation"] | components["schemas"]["MetadataToStringInvocation"] | components["schemas"]["MetadataToT2IAdaptersInvocation"] | components["schemas"]["MetadataToVAEInvocation"] | components["schemas"]["ModelIdentifierInvocation"] | components["schemas"]["MultiplyInvocation"] | components["schemas"]["NoiseInvocation"] | components["schemas"]["NormalMapInvocation"] | components["schemas"]["PBRMapsInvocation"] | components["schemas"]["PairTileImageInvocation"] | components["schemas"]["PasteImageIntoBoundingBoxInvocation"] | components["schemas"]["PiDiNetEdgeDetectionInvocation"] | components["schemas"]["PromptTemplateInvocation"] | components["schemas"]["PromptsFromFileInvocation"] | components["schemas"]["QwenImageDenoiseInvocation"] | components["schemas"]["QwenImageImageToLatentsInvocation"] | components["schemas"]["QwenImageLatentsToImageInvocation"] | components["schemas"]["QwenImageLoRACollectionLoader"] | components["schemas"]["QwenImageLoRALoaderInvocation"] | components["schemas"]["QwenImageModelLoaderInvocation"] | components["schemas"]["QwenImageTextEncoderInvocation"] | components["schemas"]["RandomFloatInvocation"] | components["schemas"]["RandomIntInvocation"] | components["schemas"]["RandomRangeInvocation"] | components["schemas"]["RangeInvocation"] | components["schemas"]["RangeOfSizeInvocation"] | components["schemas"]["RectangleMaskInvocation"] | components["schemas"]["ResizeLatentsInvocation"] | components["schemas"]["RoundInvocation"] | components["schemas"]["SD3DenoiseInvocation"] | components["schemas"]["SD3ImageToLatentsInvocation"] | components["schemas"]["SD3LatentsToImageInvocation"] | components["schemas"]["SDXLCompelPromptInvocation"] | components["schemas"]["SDXLLoRACollectionLoader"] | components["schemas"]["SDXLLoRALoaderInvocation"] | components["schemas"]["SDXLModelLoaderInvocation"] | components["schemas"]["SDXLRefinerCompelPromptInvocation"] | components["schemas"]["SDXLRefinerModelLoaderInvocation"] | components["schemas"]["SaveImageInvocation"] | components["schemas"]["ScaleLatentsInvocation"] | components["schemas"]["SchedulerInvocation"] | components["schemas"]["Sd3ModelLoaderInvocation"] | components["schemas"]["Sd3TextEncoderInvocation"] | components["schemas"]["SeamlessModeInvocation"] | components["schemas"]["SegmentAnythingInvocation"] | components["schemas"]["ShowImageInvocation"] | components["schemas"]["SpandrelImageToImageAutoscaleInvocation"] | components["schemas"]["SpandrelImageToImageInvocation"] | components["schemas"]["StringBatchInvocation"] | components["schemas"]["StringCollectionInvocation"] | components["schemas"]["StringGenerator"] | components["schemas"]["StringInvocation"] | components["schemas"]["StringJoinInvocation"] | components["schemas"]["StringJoinThreeInvocation"] | components["schemas"]["StringReplaceInvocation"] | components["schemas"]["StringSplitInvocation"] | components["schemas"]["StringSplitNegInvocation"] | components["schemas"]["SubtractInvocation"] | components["schemas"]["T2IAdapterInvocation"] | components["schemas"]["TileToPropertiesInvocation"] | components["schemas"]["TiledMultiDiffusionDenoiseLatents"] | components["schemas"]["UnsharpMaskInvocation"] | components["schemas"]["VAELoaderInvocation"] | components["schemas"]["ZImageControlInvocation"] | components["schemas"]["ZImageDenoiseInvocation"] | components["schemas"]["ZImageDenoiseMetaInvocation"] | components["schemas"]["ZImageImageToLatentsInvocation"] | components["schemas"]["ZImageLatentsToImageInvocation"] | components["schemas"]["ZImageLoRACollectionLoader"] | components["schemas"]["ZImageLoRALoaderInvocation"] | components["schemas"]["ZImageModelLoaderInvocation"] | components["schemas"]["ZImageSeedVarianceEnhancerInvocation"] | components["schemas"]["ZImageTextEncoderInvocation"];
+ invocation: components["schemas"]["AddInvocation"] | components["schemas"]["AlphaMaskToTensorInvocation"] | components["schemas"]["AnimaDenoiseInvocation"] | components["schemas"]["AnimaImageToLatentsInvocation"] | components["schemas"]["AnimaLatentsToImageInvocation"] | components["schemas"]["AnimaLoRACollectionLoader"] | components["schemas"]["AnimaLoRALoaderInvocation"] | components["schemas"]["AnimaModelLoaderInvocation"] | components["schemas"]["AnimaTextEncoderInvocation"] | components["schemas"]["ApplyMaskTensorToImageInvocation"] | components["schemas"]["ApplyMaskToImageInvocation"] | components["schemas"]["BlankImageInvocation"] | components["schemas"]["BlendLatentsInvocation"] | components["schemas"]["BooleanCollectionInvocation"] | components["schemas"]["BooleanInvocation"] | components["schemas"]["BoundingBoxInvocation"] | components["schemas"]["CLIPSkipInvocation"] | components["schemas"]["CV2InfillInvocation"] | components["schemas"]["CalculateImageTilesEvenSplitInvocation"] | components["schemas"]["CalculateImageTilesInvocation"] | components["schemas"]["CalculateImageTilesMinimumOverlapInvocation"] | components["schemas"]["CannyEdgeDetectionInvocation"] | components["schemas"]["CanvasOutputInvocation"] | components["schemas"]["CanvasPasteBackInvocation"] | components["schemas"]["CanvasV2MaskAndCropInvocation"] | components["schemas"]["CenterPadCropInvocation"] | components["schemas"]["CogView4DenoiseInvocation"] | components["schemas"]["CogView4ImageToLatentsInvocation"] | components["schemas"]["CogView4LatentsToImageInvocation"] | components["schemas"]["CogView4ModelLoaderInvocation"] | components["schemas"]["CogView4TextEncoderInvocation"] | components["schemas"]["CollectInvocation"] | components["schemas"]["ColorCorrectInvocation"] | components["schemas"]["ColorInvocation"] | components["schemas"]["ColorMapInvocation"] | components["schemas"]["CompelInvocation"] | components["schemas"]["ConditioningCollectionInvocation"] | components["schemas"]["ConditioningInvocation"] | components["schemas"]["ContentShuffleInvocation"] | components["schemas"]["ControlNetInvocation"] | components["schemas"]["CoreMetadataInvocation"] | components["schemas"]["CreateDenoiseMaskInvocation"] | components["schemas"]["CreateGradientMaskInvocation"] | components["schemas"]["CropImageToBoundingBoxInvocation"] | components["schemas"]["CropLatentsCoreInvocation"] | components["schemas"]["CvInpaintInvocation"] | components["schemas"]["DWOpenposeDetectionInvocation"] | components["schemas"]["DecodeInvisibleWatermarkInvocation"] | components["schemas"]["DenoiseLatentsInvocation"] | components["schemas"]["DenoiseLatentsMetaInvocation"] | components["schemas"]["DepthAnythingDepthEstimationInvocation"] | components["schemas"]["DivideInvocation"] | components["schemas"]["DynamicPromptInvocation"] | components["schemas"]["ESRGANInvocation"] | components["schemas"]["ExpandMaskWithFadeInvocation"] | components["schemas"]["FLUXLoRACollectionLoader"] | components["schemas"]["FaceIdentifierInvocation"] | components["schemas"]["FaceMaskInvocation"] | components["schemas"]["FaceOffInvocation"] | components["schemas"]["FloatBatchInvocation"] | components["schemas"]["FloatCollectionInvocation"] | components["schemas"]["FloatGenerator"] | components["schemas"]["FloatInvocation"] | components["schemas"]["FloatLinearRangeInvocation"] | components["schemas"]["FloatMathInvocation"] | components["schemas"]["FloatToIntegerInvocation"] | components["schemas"]["Flux2DenoiseInvocation"] | components["schemas"]["Flux2KleinLoRACollectionLoader"] | components["schemas"]["Flux2KleinLoRALoaderInvocation"] | components["schemas"]["Flux2KleinModelLoaderInvocation"] | components["schemas"]["Flux2KleinTextEncoderInvocation"] | components["schemas"]["Flux2VaeDecodeInvocation"] | components["schemas"]["Flux2VaeEncodeInvocation"] | components["schemas"]["FluxControlLoRALoaderInvocation"] | components["schemas"]["FluxControlNetInvocation"] | components["schemas"]["FluxDenoiseInvocation"] | components["schemas"]["FluxDenoiseLatentsMetaInvocation"] | components["schemas"]["FluxFillInvocation"] | components["schemas"]["FluxIPAdapterInvocation"] | components["schemas"]["FluxKontextConcatenateImagesInvocation"] | components["schemas"]["FluxKontextInvocation"] | components["schemas"]["FluxLoRALoaderInvocation"] | components["schemas"]["FluxModelLoaderInvocation"] | components["schemas"]["FluxReduxInvocation"] | components["schemas"]["FluxTextEncoderInvocation"] | components["schemas"]["FluxVaeDecodeInvocation"] | components["schemas"]["FluxVaeEncodeInvocation"] | components["schemas"]["FreeUInvocation"] | components["schemas"]["GeminiImageGenerationInvocation"] | components["schemas"]["GetMaskBoundingBoxInvocation"] | components["schemas"]["GroundingDinoInvocation"] | components["schemas"]["HEDEdgeDetectionInvocation"] | components["schemas"]["HeuristicResizeInvocation"] | components["schemas"]["IPAdapterInvocation"] | components["schemas"]["IdealSizeInvocation"] | components["schemas"]["IfInvocation"] | components["schemas"]["ImageBatchInvocation"] | components["schemas"]["ImageBlurInvocation"] | components["schemas"]["ImageChannelInvocation"] | components["schemas"]["ImageChannelMultiplyInvocation"] | components["schemas"]["ImageChannelOffsetInvocation"] | components["schemas"]["ImageCollectionInvocation"] | components["schemas"]["ImageConvertInvocation"] | components["schemas"]["ImageCropInvocation"] | components["schemas"]["ImageGenerator"] | components["schemas"]["ImageHueAdjustmentInvocation"] | components["schemas"]["ImageInverseLerpInvocation"] | components["schemas"]["ImageInvocation"] | components["schemas"]["ImageLerpInvocation"] | components["schemas"]["ImageMaskToTensorInvocation"] | components["schemas"]["ImageMultiplyInvocation"] | components["schemas"]["ImageNSFWBlurInvocation"] | components["schemas"]["ImageNoiseInvocation"] | components["schemas"]["ImagePanelLayoutInvocation"] | components["schemas"]["ImagePasteInvocation"] | components["schemas"]["ImageResizeInvocation"] | components["schemas"]["ImageScaleInvocation"] | components["schemas"]["ImageToLatentsInvocation"] | components["schemas"]["ImageWatermarkInvocation"] | components["schemas"]["InfillColorInvocation"] | components["schemas"]["InfillPatchMatchInvocation"] | components["schemas"]["InfillTileInvocation"] | components["schemas"]["IntegerBatchInvocation"] | components["schemas"]["IntegerCollectionInvocation"] | components["schemas"]["IntegerGenerator"] | components["schemas"]["IntegerInvocation"] | components["schemas"]["IntegerMathInvocation"] | components["schemas"]["InvertTensorMaskInvocation"] | components["schemas"]["InvokeAdjustImageHuePlusInvocation"] | components["schemas"]["InvokeEquivalentAchromaticLightnessInvocation"] | components["schemas"]["InvokeImageBlendInvocation"] | components["schemas"]["InvokeImageCompositorInvocation"] | components["schemas"]["InvokeImageDilateOrErodeInvocation"] | components["schemas"]["InvokeImageEnhanceInvocation"] | components["schemas"]["InvokeImageValueThresholdsInvocation"] | components["schemas"]["IterateInvocation"] | components["schemas"]["LaMaInfillInvocation"] | components["schemas"]["LatentsCollectionInvocation"] | components["schemas"]["LatentsInvocation"] | components["schemas"]["LatentsToImageInvocation"] | components["schemas"]["LineartAnimeEdgeDetectionInvocation"] | components["schemas"]["LineartEdgeDetectionInvocation"] | components["schemas"]["LlavaOnevisionVllmInvocation"] | components["schemas"]["LoRACollectionLoader"] | components["schemas"]["LoRALoaderInvocation"] | components["schemas"]["LoRASelectorInvocation"] | components["schemas"]["MLSDDetectionInvocation"] | components["schemas"]["MainModelLoaderInvocation"] | components["schemas"]["MaskCombineInvocation"] | components["schemas"]["MaskEdgeInvocation"] | components["schemas"]["MaskFromAlphaInvocation"] | components["schemas"]["MaskFromIDInvocation"] | components["schemas"]["MaskTensorToImageInvocation"] | components["schemas"]["MediaPipeFaceDetectionInvocation"] | components["schemas"]["MergeMetadataInvocation"] | components["schemas"]["MergeTilesToImageInvocation"] | components["schemas"]["MetadataFieldExtractorInvocation"] | components["schemas"]["MetadataFromImageInvocation"] | components["schemas"]["MetadataInvocation"] | components["schemas"]["MetadataItemInvocation"] | components["schemas"]["MetadataItemLinkedInvocation"] | components["schemas"]["MetadataToBoolCollectionInvocation"] | components["schemas"]["MetadataToBoolInvocation"] | components["schemas"]["MetadataToControlnetsInvocation"] | components["schemas"]["MetadataToFloatCollectionInvocation"] | components["schemas"]["MetadataToFloatInvocation"] | components["schemas"]["MetadataToIPAdaptersInvocation"] | components["schemas"]["MetadataToIntegerCollectionInvocation"] | components["schemas"]["MetadataToIntegerInvocation"] | components["schemas"]["MetadataToLorasCollectionInvocation"] | components["schemas"]["MetadataToLorasInvocation"] | components["schemas"]["MetadataToModelInvocation"] | components["schemas"]["MetadataToSDXLLorasInvocation"] | components["schemas"]["MetadataToSDXLModelInvocation"] | components["schemas"]["MetadataToSchedulerInvocation"] | components["schemas"]["MetadataToStringCollectionInvocation"] | components["schemas"]["MetadataToStringInvocation"] | components["schemas"]["MetadataToT2IAdaptersInvocation"] | components["schemas"]["MetadataToVAEInvocation"] | components["schemas"]["ModelIdentifierInvocation"] | components["schemas"]["MultiplyInvocation"] | components["schemas"]["NoiseInvocation"] | components["schemas"]["NormalMapInvocation"] | components["schemas"]["OpenAIImageGenerationInvocation"] | components["schemas"]["PBRMapsInvocation"] | components["schemas"]["PairTileImageInvocation"] | components["schemas"]["PasteImageIntoBoundingBoxInvocation"] | components["schemas"]["PiDiNetEdgeDetectionInvocation"] | components["schemas"]["PromptTemplateInvocation"] | components["schemas"]["PromptsFromFileInvocation"] | components["schemas"]["QwenImageDenoiseInvocation"] | components["schemas"]["QwenImageImageToLatentsInvocation"] | components["schemas"]["QwenImageLatentsToImageInvocation"] | components["schemas"]["QwenImageLoRACollectionLoader"] | components["schemas"]["QwenImageLoRALoaderInvocation"] | components["schemas"]["QwenImageModelLoaderInvocation"] | components["schemas"]["QwenImageTextEncoderInvocation"] | components["schemas"]["RandomFloatInvocation"] | components["schemas"]["RandomIntInvocation"] | components["schemas"]["RandomRangeInvocation"] | components["schemas"]["RangeInvocation"] | components["schemas"]["RangeOfSizeInvocation"] | components["schemas"]["RectangleMaskInvocation"] | components["schemas"]["ResizeLatentsInvocation"] | components["schemas"]["RoundInvocation"] | components["schemas"]["SD3DenoiseInvocation"] | components["schemas"]["SD3ImageToLatentsInvocation"] | components["schemas"]["SD3LatentsToImageInvocation"] | components["schemas"]["SDXLCompelPromptInvocation"] | components["schemas"]["SDXLLoRACollectionLoader"] | components["schemas"]["SDXLLoRALoaderInvocation"] | components["schemas"]["SDXLModelLoaderInvocation"] | components["schemas"]["SDXLRefinerCompelPromptInvocation"] | components["schemas"]["SDXLRefinerModelLoaderInvocation"] | components["schemas"]["SaveImageInvocation"] | components["schemas"]["ScaleLatentsInvocation"] | components["schemas"]["SchedulerInvocation"] | components["schemas"]["Sd3ModelLoaderInvocation"] | components["schemas"]["Sd3TextEncoderInvocation"] | components["schemas"]["SeamlessModeInvocation"] | components["schemas"]["SegmentAnythingInvocation"] | components["schemas"]["ShowImageInvocation"] | components["schemas"]["SpandrelImageToImageAutoscaleInvocation"] | components["schemas"]["SpandrelImageToImageInvocation"] | components["schemas"]["StringBatchInvocation"] | components["schemas"]["StringCollectionInvocation"] | components["schemas"]["StringGenerator"] | components["schemas"]["StringInvocation"] | components["schemas"]["StringJoinInvocation"] | components["schemas"]["StringJoinThreeInvocation"] | components["schemas"]["StringReplaceInvocation"] | components["schemas"]["StringSplitInvocation"] | components["schemas"]["StringSplitNegInvocation"] | components["schemas"]["SubtractInvocation"] | components["schemas"]["T2IAdapterInvocation"] | components["schemas"]["TileToPropertiesInvocation"] | components["schemas"]["TiledMultiDiffusionDenoiseLatents"] | components["schemas"]["UnsharpMaskInvocation"] | components["schemas"]["VAELoaderInvocation"] | components["schemas"]["ZImageControlInvocation"] | components["schemas"]["ZImageDenoiseInvocation"] | components["schemas"]["ZImageDenoiseMetaInvocation"] | components["schemas"]["ZImageImageToLatentsInvocation"] | components["schemas"]["ZImageLatentsToImageInvocation"] | components["schemas"]["ZImageLoRACollectionLoader"] | components["schemas"]["ZImageLoRALoaderInvocation"] | components["schemas"]["ZImageModelLoaderInvocation"] | components["schemas"]["ZImageSeedVarianceEnhancerInvocation"] | components["schemas"]["ZImageTextEncoderInvocation"];
/**
* Invocation Source Id
* @description The ID of the prepared invocation's source node
@@ -15212,6 +15653,10 @@ export type components = {
* allow_unknown_models: Allow installation of models that we are unable to identify. If enabled, models will be marked as `unknown` in the database, and will not have any metadata associated with them. If disabled, unknown models will be rejected during installation.
* multiuser: Enable multiuser support. When disabled, the application runs in single-user mode using a default system account with administrator privileges. When enabled, requires user authentication and authorization.
* strict_password_checking: Enforce strict password requirements. When True, passwords must contain uppercase, lowercase, and numbers. When False (default), any password is accepted but its strength (weak/moderate/strong) is reported to the user.
+ * external_gemini_api_key: API key for Gemini image generation.
+ * external_openai_api_key: API key for OpenAI image generation.
+ * external_gemini_base_url: Base URL override for Gemini image generation.
+ * external_openai_base_url: Base URL override for OpenAI image generation.
*/
InvokeAIAppConfig: {
/**
@@ -15596,6 +16041,26 @@ export type components = {
* @default false
*/
strict_password_checking?: boolean;
+ /**
+ * External Gemini Api Key
+ * @description API key for Gemini image generation.
+ */
+ external_gemini_api_key?: string | null;
+ /**
+ * External Openai Api Key
+ * @description API key for OpenAI image generation.
+ */
+ external_openai_api_key?: string | null;
+ /**
+ * External Gemini Base Url
+ * @description Base URL override for Gemini image generation.
+ */
+ external_gemini_base_url?: string | null;
+ /**
+ * External Openai Base Url
+ * @description Base URL override for OpenAI image generation.
+ */
+ external_openai_base_url?: string | null;
};
/**
* InvokeAIAppConfigWithSetFields
@@ -21987,7 +22452,7 @@ export type components = {
* @description Storage format of model.
* @enum {string}
*/
- ModelFormat: "omi" | "diffusers" | "checkpoint" | "lycoris" | "onnx" | "olive" | "embedding_file" | "embedding_folder" | "invokeai" | "t5_encoder" | "qwen3_encoder" | "bnb_quantized_int8b" | "bnb_quantized_nf4b" | "gguf_quantized" | "unknown";
+ ModelFormat: "omi" | "diffusers" | "checkpoint" | "lycoris" | "onnx" | "olive" | "embedding_file" | "embedding_folder" | "invokeai" | "t5_encoder" | "qwen3_encoder" | "bnb_quantized_int8b" | "bnb_quantized_nf4b" | "gguf_quantized" | "external_api" | "unknown";
/** ModelIdentifierField */
ModelIdentifierField: {
/**
@@ -22088,7 +22553,7 @@ export type components = {
* Source
* @description Source of the model; local path, repo_id or url
*/
- source: components["schemas"]["LocalModelSource"] | components["schemas"]["HFModelSource"] | components["schemas"]["URLModelSource"];
+ source: components["schemas"]["LocalModelSource"] | components["schemas"]["HFModelSource"] | components["schemas"]["URLModelSource"] | components["schemas"]["ExternalModelSource"];
};
/**
* ModelInstallCompleteEvent
@@ -22109,7 +22574,7 @@ export type components = {
* Source
* @description Source of the model; local path, repo_id or url
*/
- source: components["schemas"]["LocalModelSource"] | components["schemas"]["HFModelSource"] | components["schemas"]["URLModelSource"];
+ source: components["schemas"]["LocalModelSource"] | components["schemas"]["HFModelSource"] | components["schemas"]["URLModelSource"] | components["schemas"]["ExternalModelSource"];
/**
* Key
* @description Model config record key
@@ -22124,7 +22589,7 @@ export type components = {
* Config
* @description The installed model's config
*/
- config: components["schemas"]["Main_Diffusers_SD1_Config"] | components["schemas"]["Main_Diffusers_SD2_Config"] | components["schemas"]["Main_Diffusers_SDXL_Config"] | components["schemas"]["Main_Diffusers_SDXLRefiner_Config"] | components["schemas"]["Main_Diffusers_SD3_Config"] | components["schemas"]["Main_Diffusers_FLUX_Config"] | components["schemas"]["Main_Diffusers_Flux2_Config"] | components["schemas"]["Main_Diffusers_CogView4_Config"] | components["schemas"]["Main_Diffusers_QwenImage_Config"] | components["schemas"]["Main_Diffusers_ZImage_Config"] | components["schemas"]["Main_Checkpoint_SD1_Config"] | components["schemas"]["Main_Checkpoint_SD2_Config"] | components["schemas"]["Main_Checkpoint_SDXL_Config"] | components["schemas"]["Main_Checkpoint_SDXLRefiner_Config"] | components["schemas"]["Main_Checkpoint_Flux2_Config"] | components["schemas"]["Main_Checkpoint_FLUX_Config"] | components["schemas"]["Main_Checkpoint_ZImage_Config"] | components["schemas"]["Main_Checkpoint_Anima_Config"] | components["schemas"]["Main_BnBNF4_FLUX_Config"] | components["schemas"]["Main_GGUF_Flux2_Config"] | components["schemas"]["Main_GGUF_FLUX_Config"] | components["schemas"]["Main_GGUF_QwenImage_Config"] | components["schemas"]["Main_GGUF_ZImage_Config"] | components["schemas"]["VAE_Checkpoint_SD1_Config"] | components["schemas"]["VAE_Checkpoint_SD2_Config"] | components["schemas"]["VAE_Checkpoint_SDXL_Config"] | components["schemas"]["VAE_Checkpoint_FLUX_Config"] | components["schemas"]["VAE_Checkpoint_Flux2_Config"] | components["schemas"]["VAE_Checkpoint_Anima_Config"] | components["schemas"]["VAE_Diffusers_SD1_Config"] | components["schemas"]["VAE_Diffusers_SDXL_Config"] | components["schemas"]["VAE_Diffusers_Flux2_Config"] | components["schemas"]["ControlNet_Checkpoint_SD1_Config"] | components["schemas"]["ControlNet_Checkpoint_SD2_Config"] | components["schemas"]["ControlNet_Checkpoint_SDXL_Config"] | components["schemas"]["ControlNet_Checkpoint_FLUX_Config"] | components["schemas"]["ControlNet_Checkpoint_ZImage_Config"] | components["schemas"]["ControlNet_Diffusers_SD1_Config"] | components["schemas"]["ControlNet_Diffusers_SD2_Config"] | components["schemas"]["ControlNet_Diffusers_SDXL_Config"] | components["schemas"]["ControlNet_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_SD1_Config"] | components["schemas"]["LoRA_LyCORIS_SD2_Config"] | components["schemas"]["LoRA_LyCORIS_SDXL_Config"] | components["schemas"]["LoRA_LyCORIS_Flux2_Config"] | components["schemas"]["LoRA_LyCORIS_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_ZImage_Config"] | components["schemas"]["LoRA_LyCORIS_QwenImage_Config"] | components["schemas"]["LoRA_LyCORIS_Anima_Config"] | components["schemas"]["LoRA_OMI_SDXL_Config"] | components["schemas"]["LoRA_OMI_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_SD1_Config"] | components["schemas"]["LoRA_Diffusers_SD2_Config"] | components["schemas"]["LoRA_Diffusers_SDXL_Config"] | components["schemas"]["LoRA_Diffusers_Flux2_Config"] | components["schemas"]["LoRA_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_ZImage_Config"] | components["schemas"]["ControlLoRA_LyCORIS_FLUX_Config"] | components["schemas"]["T5Encoder_T5Encoder_Config"] | components["schemas"]["T5Encoder_BnBLLMint8_Config"] | components["schemas"]["Qwen3Encoder_Qwen3Encoder_Config"] | components["schemas"]["Qwen3Encoder_Checkpoint_Config"] | components["schemas"]["Qwen3Encoder_GGUF_Config"] | components["schemas"]["TI_File_SD1_Config"] | components["schemas"]["TI_File_SD2_Config"] | components["schemas"]["TI_File_SDXL_Config"] | components["schemas"]["TI_Folder_SD1_Config"] | components["schemas"]["TI_Folder_SD2_Config"] | components["schemas"]["TI_Folder_SDXL_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD1_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD2_Config"] | components["schemas"]["IPAdapter_InvokeAI_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD1_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD2_Config"] | components["schemas"]["IPAdapter_Checkpoint_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_FLUX_Config"] | components["schemas"]["T2IAdapter_Diffusers_SD1_Config"] | components["schemas"]["T2IAdapter_Diffusers_SDXL_Config"] | components["schemas"]["Spandrel_Checkpoint_Config"] | components["schemas"]["CLIPEmbed_Diffusers_G_Config"] | components["schemas"]["CLIPEmbed_Diffusers_L_Config"] | components["schemas"]["CLIPVision_Diffusers_Config"] | components["schemas"]["SigLIP_Diffusers_Config"] | components["schemas"]["FLUXRedux_Checkpoint_Config"] | components["schemas"]["LlavaOnevision_Diffusers_Config"] | components["schemas"]["Unknown_Config"];
+ config: components["schemas"]["Main_Diffusers_SD1_Config"] | components["schemas"]["Main_Diffusers_SD2_Config"] | components["schemas"]["Main_Diffusers_SDXL_Config"] | components["schemas"]["Main_Diffusers_SDXLRefiner_Config"] | components["schemas"]["Main_Diffusers_SD3_Config"] | components["schemas"]["Main_Diffusers_FLUX_Config"] | components["schemas"]["Main_Diffusers_Flux2_Config"] | components["schemas"]["Main_Diffusers_CogView4_Config"] | components["schemas"]["Main_Diffusers_QwenImage_Config"] | components["schemas"]["Main_Diffusers_ZImage_Config"] | components["schemas"]["Main_Checkpoint_SD1_Config"] | components["schemas"]["Main_Checkpoint_SD2_Config"] | components["schemas"]["Main_Checkpoint_SDXL_Config"] | components["schemas"]["Main_Checkpoint_SDXLRefiner_Config"] | components["schemas"]["Main_Checkpoint_Flux2_Config"] | components["schemas"]["Main_Checkpoint_FLUX_Config"] | components["schemas"]["Main_Checkpoint_ZImage_Config"] | components["schemas"]["Main_Checkpoint_Anima_Config"] | components["schemas"]["Main_BnBNF4_FLUX_Config"] | components["schemas"]["Main_GGUF_Flux2_Config"] | components["schemas"]["Main_GGUF_FLUX_Config"] | components["schemas"]["Main_GGUF_QwenImage_Config"] | components["schemas"]["Main_GGUF_ZImage_Config"] | components["schemas"]["VAE_Checkpoint_SD1_Config"] | components["schemas"]["VAE_Checkpoint_SD2_Config"] | components["schemas"]["VAE_Checkpoint_SDXL_Config"] | components["schemas"]["VAE_Checkpoint_FLUX_Config"] | components["schemas"]["VAE_Checkpoint_Flux2_Config"] | components["schemas"]["VAE_Checkpoint_Anima_Config"] | components["schemas"]["VAE_Diffusers_SD1_Config"] | components["schemas"]["VAE_Diffusers_SDXL_Config"] | components["schemas"]["VAE_Diffusers_Flux2_Config"] | components["schemas"]["ControlNet_Checkpoint_SD1_Config"] | components["schemas"]["ControlNet_Checkpoint_SD2_Config"] | components["schemas"]["ControlNet_Checkpoint_SDXL_Config"] | components["schemas"]["ControlNet_Checkpoint_FLUX_Config"] | components["schemas"]["ControlNet_Checkpoint_ZImage_Config"] | components["schemas"]["ControlNet_Diffusers_SD1_Config"] | components["schemas"]["ControlNet_Diffusers_SD2_Config"] | components["schemas"]["ControlNet_Diffusers_SDXL_Config"] | components["schemas"]["ControlNet_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_SD1_Config"] | components["schemas"]["LoRA_LyCORIS_SD2_Config"] | components["schemas"]["LoRA_LyCORIS_SDXL_Config"] | components["schemas"]["LoRA_LyCORIS_Flux2_Config"] | components["schemas"]["LoRA_LyCORIS_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_ZImage_Config"] | components["schemas"]["LoRA_LyCORIS_QwenImage_Config"] | components["schemas"]["LoRA_LyCORIS_Anima_Config"] | components["schemas"]["LoRA_OMI_SDXL_Config"] | components["schemas"]["LoRA_OMI_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_SD1_Config"] | components["schemas"]["LoRA_Diffusers_SD2_Config"] | components["schemas"]["LoRA_Diffusers_SDXL_Config"] | components["schemas"]["LoRA_Diffusers_Flux2_Config"] | components["schemas"]["LoRA_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_ZImage_Config"] | components["schemas"]["ControlLoRA_LyCORIS_FLUX_Config"] | components["schemas"]["T5Encoder_T5Encoder_Config"] | components["schemas"]["T5Encoder_BnBLLMint8_Config"] | components["schemas"]["Qwen3Encoder_Qwen3Encoder_Config"] | components["schemas"]["Qwen3Encoder_Checkpoint_Config"] | components["schemas"]["Qwen3Encoder_GGUF_Config"] | components["schemas"]["TI_File_SD1_Config"] | components["schemas"]["TI_File_SD2_Config"] | components["schemas"]["TI_File_SDXL_Config"] | components["schemas"]["TI_Folder_SD1_Config"] | components["schemas"]["TI_Folder_SD2_Config"] | components["schemas"]["TI_Folder_SDXL_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD1_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD2_Config"] | components["schemas"]["IPAdapter_InvokeAI_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD1_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD2_Config"] | components["schemas"]["IPAdapter_Checkpoint_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_FLUX_Config"] | components["schemas"]["T2IAdapter_Diffusers_SD1_Config"] | components["schemas"]["T2IAdapter_Diffusers_SDXL_Config"] | components["schemas"]["Spandrel_Checkpoint_Config"] | components["schemas"]["CLIPEmbed_Diffusers_G_Config"] | components["schemas"]["CLIPEmbed_Diffusers_L_Config"] | components["schemas"]["CLIPVision_Diffusers_Config"] | components["schemas"]["SigLIP_Diffusers_Config"] | components["schemas"]["FLUXRedux_Checkpoint_Config"] | components["schemas"]["LlavaOnevision_Diffusers_Config"] | components["schemas"]["ExternalApiModelConfig"] | components["schemas"]["Unknown_Config"];
};
/**
* ModelInstallDownloadProgressEvent
@@ -22145,7 +22610,7 @@ export type components = {
* Source
* @description Source of the model; local path, repo_id or url
*/
- source: components["schemas"]["LocalModelSource"] | components["schemas"]["HFModelSource"] | components["schemas"]["URLModelSource"];
+ source: components["schemas"]["LocalModelSource"] | components["schemas"]["HFModelSource"] | components["schemas"]["URLModelSource"] | components["schemas"]["ExternalModelSource"];
/**
* Local Path
* @description Where model is downloading to
@@ -22188,7 +22653,7 @@ export type components = {
* Source
* @description Source of the model; local path, repo_id or url
*/
- source: components["schemas"]["LocalModelSource"] | components["schemas"]["HFModelSource"] | components["schemas"]["URLModelSource"];
+ source: components["schemas"]["LocalModelSource"] | components["schemas"]["HFModelSource"] | components["schemas"]["URLModelSource"] | components["schemas"]["ExternalModelSource"];
/**
* Local Path
* @description Where model is downloading to
@@ -22231,7 +22696,7 @@ export type components = {
* Source
* @description Source of the model; local path, repo_id or url
*/
- source: components["schemas"]["LocalModelSource"] | components["schemas"]["HFModelSource"] | components["schemas"]["URLModelSource"];
+ source: components["schemas"]["LocalModelSource"] | components["schemas"]["HFModelSource"] | components["schemas"]["URLModelSource"] | components["schemas"]["ExternalModelSource"];
};
/**
* ModelInstallErrorEvent
@@ -22252,7 +22717,7 @@ export type components = {
* Source
* @description Source of the model; local path, repo_id or url
*/
- source: components["schemas"]["LocalModelSource"] | components["schemas"]["HFModelSource"] | components["schemas"]["URLModelSource"];
+ source: components["schemas"]["LocalModelSource"] | components["schemas"]["HFModelSource"] | components["schemas"]["URLModelSource"] | components["schemas"]["ExternalModelSource"];
/**
* Error Type
* @description The name of the exception
@@ -22290,7 +22755,7 @@ export type components = {
* Config Out
* @description After successful installation, this will hold the configuration object.
*/
- config_out?: (components["schemas"]["Main_Diffusers_SD1_Config"] | components["schemas"]["Main_Diffusers_SD2_Config"] | components["schemas"]["Main_Diffusers_SDXL_Config"] | components["schemas"]["Main_Diffusers_SDXLRefiner_Config"] | components["schemas"]["Main_Diffusers_SD3_Config"] | components["schemas"]["Main_Diffusers_FLUX_Config"] | components["schemas"]["Main_Diffusers_Flux2_Config"] | components["schemas"]["Main_Diffusers_CogView4_Config"] | components["schemas"]["Main_Diffusers_QwenImage_Config"] | components["schemas"]["Main_Diffusers_ZImage_Config"] | components["schemas"]["Main_Checkpoint_SD1_Config"] | components["schemas"]["Main_Checkpoint_SD2_Config"] | components["schemas"]["Main_Checkpoint_SDXL_Config"] | components["schemas"]["Main_Checkpoint_SDXLRefiner_Config"] | components["schemas"]["Main_Checkpoint_Flux2_Config"] | components["schemas"]["Main_Checkpoint_FLUX_Config"] | components["schemas"]["Main_Checkpoint_ZImage_Config"] | components["schemas"]["Main_Checkpoint_Anima_Config"] | components["schemas"]["Main_BnBNF4_FLUX_Config"] | components["schemas"]["Main_GGUF_Flux2_Config"] | components["schemas"]["Main_GGUF_FLUX_Config"] | components["schemas"]["Main_GGUF_QwenImage_Config"] | components["schemas"]["Main_GGUF_ZImage_Config"] | components["schemas"]["VAE_Checkpoint_SD1_Config"] | components["schemas"]["VAE_Checkpoint_SD2_Config"] | components["schemas"]["VAE_Checkpoint_SDXL_Config"] | components["schemas"]["VAE_Checkpoint_FLUX_Config"] | components["schemas"]["VAE_Checkpoint_Flux2_Config"] | components["schemas"]["VAE_Checkpoint_Anima_Config"] | components["schemas"]["VAE_Diffusers_SD1_Config"] | components["schemas"]["VAE_Diffusers_SDXL_Config"] | components["schemas"]["VAE_Diffusers_Flux2_Config"] | components["schemas"]["ControlNet_Checkpoint_SD1_Config"] | components["schemas"]["ControlNet_Checkpoint_SD2_Config"] | components["schemas"]["ControlNet_Checkpoint_SDXL_Config"] | components["schemas"]["ControlNet_Checkpoint_FLUX_Config"] | components["schemas"]["ControlNet_Checkpoint_ZImage_Config"] | components["schemas"]["ControlNet_Diffusers_SD1_Config"] | components["schemas"]["ControlNet_Diffusers_SD2_Config"] | components["schemas"]["ControlNet_Diffusers_SDXL_Config"] | components["schemas"]["ControlNet_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_SD1_Config"] | components["schemas"]["LoRA_LyCORIS_SD2_Config"] | components["schemas"]["LoRA_LyCORIS_SDXL_Config"] | components["schemas"]["LoRA_LyCORIS_Flux2_Config"] | components["schemas"]["LoRA_LyCORIS_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_ZImage_Config"] | components["schemas"]["LoRA_LyCORIS_QwenImage_Config"] | components["schemas"]["LoRA_LyCORIS_Anima_Config"] | components["schemas"]["LoRA_OMI_SDXL_Config"] | components["schemas"]["LoRA_OMI_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_SD1_Config"] | components["schemas"]["LoRA_Diffusers_SD2_Config"] | components["schemas"]["LoRA_Diffusers_SDXL_Config"] | components["schemas"]["LoRA_Diffusers_Flux2_Config"] | components["schemas"]["LoRA_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_ZImage_Config"] | components["schemas"]["ControlLoRA_LyCORIS_FLUX_Config"] | components["schemas"]["T5Encoder_T5Encoder_Config"] | components["schemas"]["T5Encoder_BnBLLMint8_Config"] | components["schemas"]["Qwen3Encoder_Qwen3Encoder_Config"] | components["schemas"]["Qwen3Encoder_Checkpoint_Config"] | components["schemas"]["Qwen3Encoder_GGUF_Config"] | components["schemas"]["TI_File_SD1_Config"] | components["schemas"]["TI_File_SD2_Config"] | components["schemas"]["TI_File_SDXL_Config"] | components["schemas"]["TI_Folder_SD1_Config"] | components["schemas"]["TI_Folder_SD2_Config"] | components["schemas"]["TI_Folder_SDXL_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD1_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD2_Config"] | components["schemas"]["IPAdapter_InvokeAI_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD1_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD2_Config"] | components["schemas"]["IPAdapter_Checkpoint_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_FLUX_Config"] | components["schemas"]["T2IAdapter_Diffusers_SD1_Config"] | components["schemas"]["T2IAdapter_Diffusers_SDXL_Config"] | components["schemas"]["Spandrel_Checkpoint_Config"] | components["schemas"]["CLIPEmbed_Diffusers_G_Config"] | components["schemas"]["CLIPEmbed_Diffusers_L_Config"] | components["schemas"]["CLIPVision_Diffusers_Config"] | components["schemas"]["SigLIP_Diffusers_Config"] | components["schemas"]["FLUXRedux_Checkpoint_Config"] | components["schemas"]["LlavaOnevision_Diffusers_Config"] | components["schemas"]["Unknown_Config"]) | null;
+ config_out?: (components["schemas"]["Main_Diffusers_SD1_Config"] | components["schemas"]["Main_Diffusers_SD2_Config"] | components["schemas"]["Main_Diffusers_SDXL_Config"] | components["schemas"]["Main_Diffusers_SDXLRefiner_Config"] | components["schemas"]["Main_Diffusers_SD3_Config"] | components["schemas"]["Main_Diffusers_FLUX_Config"] | components["schemas"]["Main_Diffusers_Flux2_Config"] | components["schemas"]["Main_Diffusers_CogView4_Config"] | components["schemas"]["Main_Diffusers_QwenImage_Config"] | components["schemas"]["Main_Diffusers_ZImage_Config"] | components["schemas"]["Main_Checkpoint_SD1_Config"] | components["schemas"]["Main_Checkpoint_SD2_Config"] | components["schemas"]["Main_Checkpoint_SDXL_Config"] | components["schemas"]["Main_Checkpoint_SDXLRefiner_Config"] | components["schemas"]["Main_Checkpoint_Flux2_Config"] | components["schemas"]["Main_Checkpoint_FLUX_Config"] | components["schemas"]["Main_Checkpoint_ZImage_Config"] | components["schemas"]["Main_Checkpoint_Anima_Config"] | components["schemas"]["Main_BnBNF4_FLUX_Config"] | components["schemas"]["Main_GGUF_Flux2_Config"] | components["schemas"]["Main_GGUF_FLUX_Config"] | components["schemas"]["Main_GGUF_QwenImage_Config"] | components["schemas"]["Main_GGUF_ZImage_Config"] | components["schemas"]["VAE_Checkpoint_SD1_Config"] | components["schemas"]["VAE_Checkpoint_SD2_Config"] | components["schemas"]["VAE_Checkpoint_SDXL_Config"] | components["schemas"]["VAE_Checkpoint_FLUX_Config"] | components["schemas"]["VAE_Checkpoint_Flux2_Config"] | components["schemas"]["VAE_Checkpoint_Anima_Config"] | components["schemas"]["VAE_Diffusers_SD1_Config"] | components["schemas"]["VAE_Diffusers_SDXL_Config"] | components["schemas"]["VAE_Diffusers_Flux2_Config"] | components["schemas"]["ControlNet_Checkpoint_SD1_Config"] | components["schemas"]["ControlNet_Checkpoint_SD2_Config"] | components["schemas"]["ControlNet_Checkpoint_SDXL_Config"] | components["schemas"]["ControlNet_Checkpoint_FLUX_Config"] | components["schemas"]["ControlNet_Checkpoint_ZImage_Config"] | components["schemas"]["ControlNet_Diffusers_SD1_Config"] | components["schemas"]["ControlNet_Diffusers_SD2_Config"] | components["schemas"]["ControlNet_Diffusers_SDXL_Config"] | components["schemas"]["ControlNet_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_SD1_Config"] | components["schemas"]["LoRA_LyCORIS_SD2_Config"] | components["schemas"]["LoRA_LyCORIS_SDXL_Config"] | components["schemas"]["LoRA_LyCORIS_Flux2_Config"] | components["schemas"]["LoRA_LyCORIS_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_ZImage_Config"] | components["schemas"]["LoRA_LyCORIS_QwenImage_Config"] | components["schemas"]["LoRA_LyCORIS_Anima_Config"] | components["schemas"]["LoRA_OMI_SDXL_Config"] | components["schemas"]["LoRA_OMI_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_SD1_Config"] | components["schemas"]["LoRA_Diffusers_SD2_Config"] | components["schemas"]["LoRA_Diffusers_SDXL_Config"] | components["schemas"]["LoRA_Diffusers_Flux2_Config"] | components["schemas"]["LoRA_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_ZImage_Config"] | components["schemas"]["ControlLoRA_LyCORIS_FLUX_Config"] | components["schemas"]["T5Encoder_T5Encoder_Config"] | components["schemas"]["T5Encoder_BnBLLMint8_Config"] | components["schemas"]["Qwen3Encoder_Qwen3Encoder_Config"] | components["schemas"]["Qwen3Encoder_Checkpoint_Config"] | components["schemas"]["Qwen3Encoder_GGUF_Config"] | components["schemas"]["TI_File_SD1_Config"] | components["schemas"]["TI_File_SD2_Config"] | components["schemas"]["TI_File_SDXL_Config"] | components["schemas"]["TI_Folder_SD1_Config"] | components["schemas"]["TI_Folder_SD2_Config"] | components["schemas"]["TI_Folder_SDXL_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD1_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD2_Config"] | components["schemas"]["IPAdapter_InvokeAI_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD1_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD2_Config"] | components["schemas"]["IPAdapter_Checkpoint_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_FLUX_Config"] | components["schemas"]["T2IAdapter_Diffusers_SD1_Config"] | components["schemas"]["T2IAdapter_Diffusers_SDXL_Config"] | components["schemas"]["Spandrel_Checkpoint_Config"] | components["schemas"]["CLIPEmbed_Diffusers_G_Config"] | components["schemas"]["CLIPEmbed_Diffusers_L_Config"] | components["schemas"]["CLIPVision_Diffusers_Config"] | components["schemas"]["SigLIP_Diffusers_Config"] | components["schemas"]["FLUXRedux_Checkpoint_Config"] | components["schemas"]["LlavaOnevision_Diffusers_Config"] | components["schemas"]["ExternalApiModelConfig"] | components["schemas"]["Unknown_Config"]) | null;
/**
* Inplace
* @description Leave model in its current location; otherwise install under models directory
@@ -22301,7 +22766,7 @@ export type components = {
* Source
* @description Source (URL, repo_id, or local path) of model
*/
- source: components["schemas"]["LocalModelSource"] | components["schemas"]["HFModelSource"] | components["schemas"]["URLModelSource"];
+ source: components["schemas"]["LocalModelSource"] | components["schemas"]["HFModelSource"] | components["schemas"]["URLModelSource"] | components["schemas"]["ExternalModelSource"];
/**
* Local Path
* Format: path
@@ -22360,7 +22825,7 @@ export type components = {
* Source
* @description Source of the model; local path, repo_id or url
*/
- source: components["schemas"]["LocalModelSource"] | components["schemas"]["HFModelSource"] | components["schemas"]["URLModelSource"];
+ source: components["schemas"]["LocalModelSource"] | components["schemas"]["HFModelSource"] | components["schemas"]["URLModelSource"] | components["schemas"]["ExternalModelSource"];
};
/**
* ModelLoadCompleteEvent
@@ -22376,7 +22841,7 @@ export type components = {
* Config
* @description The model's config
*/
- config: components["schemas"]["Main_Diffusers_SD1_Config"] | components["schemas"]["Main_Diffusers_SD2_Config"] | components["schemas"]["Main_Diffusers_SDXL_Config"] | components["schemas"]["Main_Diffusers_SDXLRefiner_Config"] | components["schemas"]["Main_Diffusers_SD3_Config"] | components["schemas"]["Main_Diffusers_FLUX_Config"] | components["schemas"]["Main_Diffusers_Flux2_Config"] | components["schemas"]["Main_Diffusers_CogView4_Config"] | components["schemas"]["Main_Diffusers_QwenImage_Config"] | components["schemas"]["Main_Diffusers_ZImage_Config"] | components["schemas"]["Main_Checkpoint_SD1_Config"] | components["schemas"]["Main_Checkpoint_SD2_Config"] | components["schemas"]["Main_Checkpoint_SDXL_Config"] | components["schemas"]["Main_Checkpoint_SDXLRefiner_Config"] | components["schemas"]["Main_Checkpoint_Flux2_Config"] | components["schemas"]["Main_Checkpoint_FLUX_Config"] | components["schemas"]["Main_Checkpoint_ZImage_Config"] | components["schemas"]["Main_Checkpoint_Anima_Config"] | components["schemas"]["Main_BnBNF4_FLUX_Config"] | components["schemas"]["Main_GGUF_Flux2_Config"] | components["schemas"]["Main_GGUF_FLUX_Config"] | components["schemas"]["Main_GGUF_QwenImage_Config"] | components["schemas"]["Main_GGUF_ZImage_Config"] | components["schemas"]["VAE_Checkpoint_SD1_Config"] | components["schemas"]["VAE_Checkpoint_SD2_Config"] | components["schemas"]["VAE_Checkpoint_SDXL_Config"] | components["schemas"]["VAE_Checkpoint_FLUX_Config"] | components["schemas"]["VAE_Checkpoint_Flux2_Config"] | components["schemas"]["VAE_Checkpoint_Anima_Config"] | components["schemas"]["VAE_Diffusers_SD1_Config"] | components["schemas"]["VAE_Diffusers_SDXL_Config"] | components["schemas"]["VAE_Diffusers_Flux2_Config"] | components["schemas"]["ControlNet_Checkpoint_SD1_Config"] | components["schemas"]["ControlNet_Checkpoint_SD2_Config"] | components["schemas"]["ControlNet_Checkpoint_SDXL_Config"] | components["schemas"]["ControlNet_Checkpoint_FLUX_Config"] | components["schemas"]["ControlNet_Checkpoint_ZImage_Config"] | components["schemas"]["ControlNet_Diffusers_SD1_Config"] | components["schemas"]["ControlNet_Diffusers_SD2_Config"] | components["schemas"]["ControlNet_Diffusers_SDXL_Config"] | components["schemas"]["ControlNet_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_SD1_Config"] | components["schemas"]["LoRA_LyCORIS_SD2_Config"] | components["schemas"]["LoRA_LyCORIS_SDXL_Config"] | components["schemas"]["LoRA_LyCORIS_Flux2_Config"] | components["schemas"]["LoRA_LyCORIS_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_ZImage_Config"] | components["schemas"]["LoRA_LyCORIS_QwenImage_Config"] | components["schemas"]["LoRA_LyCORIS_Anima_Config"] | components["schemas"]["LoRA_OMI_SDXL_Config"] | components["schemas"]["LoRA_OMI_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_SD1_Config"] | components["schemas"]["LoRA_Diffusers_SD2_Config"] | components["schemas"]["LoRA_Diffusers_SDXL_Config"] | components["schemas"]["LoRA_Diffusers_Flux2_Config"] | components["schemas"]["LoRA_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_ZImage_Config"] | components["schemas"]["ControlLoRA_LyCORIS_FLUX_Config"] | components["schemas"]["T5Encoder_T5Encoder_Config"] | components["schemas"]["T5Encoder_BnBLLMint8_Config"] | components["schemas"]["Qwen3Encoder_Qwen3Encoder_Config"] | components["schemas"]["Qwen3Encoder_Checkpoint_Config"] | components["schemas"]["Qwen3Encoder_GGUF_Config"] | components["schemas"]["TI_File_SD1_Config"] | components["schemas"]["TI_File_SD2_Config"] | components["schemas"]["TI_File_SDXL_Config"] | components["schemas"]["TI_Folder_SD1_Config"] | components["schemas"]["TI_Folder_SD2_Config"] | components["schemas"]["TI_Folder_SDXL_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD1_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD2_Config"] | components["schemas"]["IPAdapter_InvokeAI_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD1_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD2_Config"] | components["schemas"]["IPAdapter_Checkpoint_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_FLUX_Config"] | components["schemas"]["T2IAdapter_Diffusers_SD1_Config"] | components["schemas"]["T2IAdapter_Diffusers_SDXL_Config"] | components["schemas"]["Spandrel_Checkpoint_Config"] | components["schemas"]["CLIPEmbed_Diffusers_G_Config"] | components["schemas"]["CLIPEmbed_Diffusers_L_Config"] | components["schemas"]["CLIPVision_Diffusers_Config"] | components["schemas"]["SigLIP_Diffusers_Config"] | components["schemas"]["FLUXRedux_Checkpoint_Config"] | components["schemas"]["LlavaOnevision_Diffusers_Config"] | components["schemas"]["Unknown_Config"];
+ config: components["schemas"]["Main_Diffusers_SD1_Config"] | components["schemas"]["Main_Diffusers_SD2_Config"] | components["schemas"]["Main_Diffusers_SDXL_Config"] | components["schemas"]["Main_Diffusers_SDXLRefiner_Config"] | components["schemas"]["Main_Diffusers_SD3_Config"] | components["schemas"]["Main_Diffusers_FLUX_Config"] | components["schemas"]["Main_Diffusers_Flux2_Config"] | components["schemas"]["Main_Diffusers_CogView4_Config"] | components["schemas"]["Main_Diffusers_QwenImage_Config"] | components["schemas"]["Main_Diffusers_ZImage_Config"] | components["schemas"]["Main_Checkpoint_SD1_Config"] | components["schemas"]["Main_Checkpoint_SD2_Config"] | components["schemas"]["Main_Checkpoint_SDXL_Config"] | components["schemas"]["Main_Checkpoint_SDXLRefiner_Config"] | components["schemas"]["Main_Checkpoint_Flux2_Config"] | components["schemas"]["Main_Checkpoint_FLUX_Config"] | components["schemas"]["Main_Checkpoint_ZImage_Config"] | components["schemas"]["Main_Checkpoint_Anima_Config"] | components["schemas"]["Main_BnBNF4_FLUX_Config"] | components["schemas"]["Main_GGUF_Flux2_Config"] | components["schemas"]["Main_GGUF_FLUX_Config"] | components["schemas"]["Main_GGUF_QwenImage_Config"] | components["schemas"]["Main_GGUF_ZImage_Config"] | components["schemas"]["VAE_Checkpoint_SD1_Config"] | components["schemas"]["VAE_Checkpoint_SD2_Config"] | components["schemas"]["VAE_Checkpoint_SDXL_Config"] | components["schemas"]["VAE_Checkpoint_FLUX_Config"] | components["schemas"]["VAE_Checkpoint_Flux2_Config"] | components["schemas"]["VAE_Checkpoint_Anima_Config"] | components["schemas"]["VAE_Diffusers_SD1_Config"] | components["schemas"]["VAE_Diffusers_SDXL_Config"] | components["schemas"]["VAE_Diffusers_Flux2_Config"] | components["schemas"]["ControlNet_Checkpoint_SD1_Config"] | components["schemas"]["ControlNet_Checkpoint_SD2_Config"] | components["schemas"]["ControlNet_Checkpoint_SDXL_Config"] | components["schemas"]["ControlNet_Checkpoint_FLUX_Config"] | components["schemas"]["ControlNet_Checkpoint_ZImage_Config"] | components["schemas"]["ControlNet_Diffusers_SD1_Config"] | components["schemas"]["ControlNet_Diffusers_SD2_Config"] | components["schemas"]["ControlNet_Diffusers_SDXL_Config"] | components["schemas"]["ControlNet_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_SD1_Config"] | components["schemas"]["LoRA_LyCORIS_SD2_Config"] | components["schemas"]["LoRA_LyCORIS_SDXL_Config"] | components["schemas"]["LoRA_LyCORIS_Flux2_Config"] | components["schemas"]["LoRA_LyCORIS_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_ZImage_Config"] | components["schemas"]["LoRA_LyCORIS_QwenImage_Config"] | components["schemas"]["LoRA_LyCORIS_Anima_Config"] | components["schemas"]["LoRA_OMI_SDXL_Config"] | components["schemas"]["LoRA_OMI_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_SD1_Config"] | components["schemas"]["LoRA_Diffusers_SD2_Config"] | components["schemas"]["LoRA_Diffusers_SDXL_Config"] | components["schemas"]["LoRA_Diffusers_Flux2_Config"] | components["schemas"]["LoRA_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_ZImage_Config"] | components["schemas"]["ControlLoRA_LyCORIS_FLUX_Config"] | components["schemas"]["T5Encoder_T5Encoder_Config"] | components["schemas"]["T5Encoder_BnBLLMint8_Config"] | components["schemas"]["Qwen3Encoder_Qwen3Encoder_Config"] | components["schemas"]["Qwen3Encoder_Checkpoint_Config"] | components["schemas"]["Qwen3Encoder_GGUF_Config"] | components["schemas"]["TI_File_SD1_Config"] | components["schemas"]["TI_File_SD2_Config"] | components["schemas"]["TI_File_SDXL_Config"] | components["schemas"]["TI_Folder_SD1_Config"] | components["schemas"]["TI_Folder_SD2_Config"] | components["schemas"]["TI_Folder_SDXL_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD1_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD2_Config"] | components["schemas"]["IPAdapter_InvokeAI_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD1_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD2_Config"] | components["schemas"]["IPAdapter_Checkpoint_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_FLUX_Config"] | components["schemas"]["T2IAdapter_Diffusers_SD1_Config"] | components["schemas"]["T2IAdapter_Diffusers_SDXL_Config"] | components["schemas"]["Spandrel_Checkpoint_Config"] | components["schemas"]["CLIPEmbed_Diffusers_G_Config"] | components["schemas"]["CLIPEmbed_Diffusers_L_Config"] | components["schemas"]["CLIPVision_Diffusers_Config"] | components["schemas"]["SigLIP_Diffusers_Config"] | components["schemas"]["FLUXRedux_Checkpoint_Config"] | components["schemas"]["LlavaOnevision_Diffusers_Config"] | components["schemas"]["ExternalApiModelConfig"] | components["schemas"]["Unknown_Config"];
/**
* @description The submodel type, if any
* @default null
@@ -22397,7 +22862,7 @@ export type components = {
* Config
* @description The model's config
*/
- config: components["schemas"]["Main_Diffusers_SD1_Config"] | components["schemas"]["Main_Diffusers_SD2_Config"] | components["schemas"]["Main_Diffusers_SDXL_Config"] | components["schemas"]["Main_Diffusers_SDXLRefiner_Config"] | components["schemas"]["Main_Diffusers_SD3_Config"] | components["schemas"]["Main_Diffusers_FLUX_Config"] | components["schemas"]["Main_Diffusers_Flux2_Config"] | components["schemas"]["Main_Diffusers_CogView4_Config"] | components["schemas"]["Main_Diffusers_QwenImage_Config"] | components["schemas"]["Main_Diffusers_ZImage_Config"] | components["schemas"]["Main_Checkpoint_SD1_Config"] | components["schemas"]["Main_Checkpoint_SD2_Config"] | components["schemas"]["Main_Checkpoint_SDXL_Config"] | components["schemas"]["Main_Checkpoint_SDXLRefiner_Config"] | components["schemas"]["Main_Checkpoint_Flux2_Config"] | components["schemas"]["Main_Checkpoint_FLUX_Config"] | components["schemas"]["Main_Checkpoint_ZImage_Config"] | components["schemas"]["Main_Checkpoint_Anima_Config"] | components["schemas"]["Main_BnBNF4_FLUX_Config"] | components["schemas"]["Main_GGUF_Flux2_Config"] | components["schemas"]["Main_GGUF_FLUX_Config"] | components["schemas"]["Main_GGUF_QwenImage_Config"] | components["schemas"]["Main_GGUF_ZImage_Config"] | components["schemas"]["VAE_Checkpoint_SD1_Config"] | components["schemas"]["VAE_Checkpoint_SD2_Config"] | components["schemas"]["VAE_Checkpoint_SDXL_Config"] | components["schemas"]["VAE_Checkpoint_FLUX_Config"] | components["schemas"]["VAE_Checkpoint_Flux2_Config"] | components["schemas"]["VAE_Checkpoint_Anima_Config"] | components["schemas"]["VAE_Diffusers_SD1_Config"] | components["schemas"]["VAE_Diffusers_SDXL_Config"] | components["schemas"]["VAE_Diffusers_Flux2_Config"] | components["schemas"]["ControlNet_Checkpoint_SD1_Config"] | components["schemas"]["ControlNet_Checkpoint_SD2_Config"] | components["schemas"]["ControlNet_Checkpoint_SDXL_Config"] | components["schemas"]["ControlNet_Checkpoint_FLUX_Config"] | components["schemas"]["ControlNet_Checkpoint_ZImage_Config"] | components["schemas"]["ControlNet_Diffusers_SD1_Config"] | components["schemas"]["ControlNet_Diffusers_SD2_Config"] | components["schemas"]["ControlNet_Diffusers_SDXL_Config"] | components["schemas"]["ControlNet_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_SD1_Config"] | components["schemas"]["LoRA_LyCORIS_SD2_Config"] | components["schemas"]["LoRA_LyCORIS_SDXL_Config"] | components["schemas"]["LoRA_LyCORIS_Flux2_Config"] | components["schemas"]["LoRA_LyCORIS_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_ZImage_Config"] | components["schemas"]["LoRA_LyCORIS_QwenImage_Config"] | components["schemas"]["LoRA_LyCORIS_Anima_Config"] | components["schemas"]["LoRA_OMI_SDXL_Config"] | components["schemas"]["LoRA_OMI_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_SD1_Config"] | components["schemas"]["LoRA_Diffusers_SD2_Config"] | components["schemas"]["LoRA_Diffusers_SDXL_Config"] | components["schemas"]["LoRA_Diffusers_Flux2_Config"] | components["schemas"]["LoRA_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_ZImage_Config"] | components["schemas"]["ControlLoRA_LyCORIS_FLUX_Config"] | components["schemas"]["T5Encoder_T5Encoder_Config"] | components["schemas"]["T5Encoder_BnBLLMint8_Config"] | components["schemas"]["Qwen3Encoder_Qwen3Encoder_Config"] | components["schemas"]["Qwen3Encoder_Checkpoint_Config"] | components["schemas"]["Qwen3Encoder_GGUF_Config"] | components["schemas"]["TI_File_SD1_Config"] | components["schemas"]["TI_File_SD2_Config"] | components["schemas"]["TI_File_SDXL_Config"] | components["schemas"]["TI_Folder_SD1_Config"] | components["schemas"]["TI_Folder_SD2_Config"] | components["schemas"]["TI_Folder_SDXL_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD1_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD2_Config"] | components["schemas"]["IPAdapter_InvokeAI_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD1_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD2_Config"] | components["schemas"]["IPAdapter_Checkpoint_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_FLUX_Config"] | components["schemas"]["T2IAdapter_Diffusers_SD1_Config"] | components["schemas"]["T2IAdapter_Diffusers_SDXL_Config"] | components["schemas"]["Spandrel_Checkpoint_Config"] | components["schemas"]["CLIPEmbed_Diffusers_G_Config"] | components["schemas"]["CLIPEmbed_Diffusers_L_Config"] | components["schemas"]["CLIPVision_Diffusers_Config"] | components["schemas"]["SigLIP_Diffusers_Config"] | components["schemas"]["FLUXRedux_Checkpoint_Config"] | components["schemas"]["LlavaOnevision_Diffusers_Config"] | components["schemas"]["Unknown_Config"];
+ config: components["schemas"]["Main_Diffusers_SD1_Config"] | components["schemas"]["Main_Diffusers_SD2_Config"] | components["schemas"]["Main_Diffusers_SDXL_Config"] | components["schemas"]["Main_Diffusers_SDXLRefiner_Config"] | components["schemas"]["Main_Diffusers_SD3_Config"] | components["schemas"]["Main_Diffusers_FLUX_Config"] | components["schemas"]["Main_Diffusers_Flux2_Config"] | components["schemas"]["Main_Diffusers_CogView4_Config"] | components["schemas"]["Main_Diffusers_QwenImage_Config"] | components["schemas"]["Main_Diffusers_ZImage_Config"] | components["schemas"]["Main_Checkpoint_SD1_Config"] | components["schemas"]["Main_Checkpoint_SD2_Config"] | components["schemas"]["Main_Checkpoint_SDXL_Config"] | components["schemas"]["Main_Checkpoint_SDXLRefiner_Config"] | components["schemas"]["Main_Checkpoint_Flux2_Config"] | components["schemas"]["Main_Checkpoint_FLUX_Config"] | components["schemas"]["Main_Checkpoint_ZImage_Config"] | components["schemas"]["Main_Checkpoint_Anima_Config"] | components["schemas"]["Main_BnBNF4_FLUX_Config"] | components["schemas"]["Main_GGUF_Flux2_Config"] | components["schemas"]["Main_GGUF_FLUX_Config"] | components["schemas"]["Main_GGUF_QwenImage_Config"] | components["schemas"]["Main_GGUF_ZImage_Config"] | components["schemas"]["VAE_Checkpoint_SD1_Config"] | components["schemas"]["VAE_Checkpoint_SD2_Config"] | components["schemas"]["VAE_Checkpoint_SDXL_Config"] | components["schemas"]["VAE_Checkpoint_FLUX_Config"] | components["schemas"]["VAE_Checkpoint_Flux2_Config"] | components["schemas"]["VAE_Checkpoint_Anima_Config"] | components["schemas"]["VAE_Diffusers_SD1_Config"] | components["schemas"]["VAE_Diffusers_SDXL_Config"] | components["schemas"]["VAE_Diffusers_Flux2_Config"] | components["schemas"]["ControlNet_Checkpoint_SD1_Config"] | components["schemas"]["ControlNet_Checkpoint_SD2_Config"] | components["schemas"]["ControlNet_Checkpoint_SDXL_Config"] | components["schemas"]["ControlNet_Checkpoint_FLUX_Config"] | components["schemas"]["ControlNet_Checkpoint_ZImage_Config"] | components["schemas"]["ControlNet_Diffusers_SD1_Config"] | components["schemas"]["ControlNet_Diffusers_SD2_Config"] | components["schemas"]["ControlNet_Diffusers_SDXL_Config"] | components["schemas"]["ControlNet_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_SD1_Config"] | components["schemas"]["LoRA_LyCORIS_SD2_Config"] | components["schemas"]["LoRA_LyCORIS_SDXL_Config"] | components["schemas"]["LoRA_LyCORIS_Flux2_Config"] | components["schemas"]["LoRA_LyCORIS_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_ZImage_Config"] | components["schemas"]["LoRA_LyCORIS_QwenImage_Config"] | components["schemas"]["LoRA_LyCORIS_Anima_Config"] | components["schemas"]["LoRA_OMI_SDXL_Config"] | components["schemas"]["LoRA_OMI_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_SD1_Config"] | components["schemas"]["LoRA_Diffusers_SD2_Config"] | components["schemas"]["LoRA_Diffusers_SDXL_Config"] | components["schemas"]["LoRA_Diffusers_Flux2_Config"] | components["schemas"]["LoRA_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_ZImage_Config"] | components["schemas"]["ControlLoRA_LyCORIS_FLUX_Config"] | components["schemas"]["T5Encoder_T5Encoder_Config"] | components["schemas"]["T5Encoder_BnBLLMint8_Config"] | components["schemas"]["Qwen3Encoder_Qwen3Encoder_Config"] | components["schemas"]["Qwen3Encoder_Checkpoint_Config"] | components["schemas"]["Qwen3Encoder_GGUF_Config"] | components["schemas"]["TI_File_SD1_Config"] | components["schemas"]["TI_File_SD2_Config"] | components["schemas"]["TI_File_SDXL_Config"] | components["schemas"]["TI_Folder_SD1_Config"] | components["schemas"]["TI_Folder_SD2_Config"] | components["schemas"]["TI_Folder_SDXL_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD1_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD2_Config"] | components["schemas"]["IPAdapter_InvokeAI_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD1_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD2_Config"] | components["schemas"]["IPAdapter_Checkpoint_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_FLUX_Config"] | components["schemas"]["T2IAdapter_Diffusers_SD1_Config"] | components["schemas"]["T2IAdapter_Diffusers_SDXL_Config"] | components["schemas"]["Spandrel_Checkpoint_Config"] | components["schemas"]["CLIPEmbed_Diffusers_G_Config"] | components["schemas"]["CLIPEmbed_Diffusers_L_Config"] | components["schemas"]["CLIPVision_Diffusers_Config"] | components["schemas"]["SigLIP_Diffusers_Config"] | components["schemas"]["FLUXRedux_Checkpoint_Config"] | components["schemas"]["LlavaOnevision_Diffusers_Config"] | components["schemas"]["ExternalApiModelConfig"] | components["schemas"]["Unknown_Config"];
/**
* @description The submodel type, if any
* @default null
@@ -22496,7 +22961,19 @@ export type components = {
* Default Settings
* @description Default settings for this model
*/
- default_settings?: components["schemas"]["MainModelDefaultSettings"] | components["schemas"]["LoraModelDefaultSettings"] | components["schemas"]["ControlAdapterDefaultSettings"] | null;
+ default_settings?: components["schemas"]["MainModelDefaultSettings"] | components["schemas"]["LoraModelDefaultSettings"] | components["schemas"]["ControlAdapterDefaultSettings"] | components["schemas"]["ExternalApiModelDefaultSettings"] | null;
+ /**
+ * Provider Id
+ * @description External provider identifier
+ */
+ provider_id?: string | null;
+ /**
+ * Provider Model Id
+ * @description External provider model identifier
+ */
+ provider_model_id?: string | null;
+ /** @description External model capabilities */
+ capabilities?: components["schemas"]["ExternalModelCapabilities"] | null;
/**
* Cpu Only
* @description Whether this model should run on CPU only
@@ -22552,13 +23029,13 @@ export type components = {
* @description Model source type.
* @enum {string}
*/
- ModelSourceType: "path" | "url" | "hf_repo_id";
+ ModelSourceType: "path" | "url" | "hf_repo_id" | "external";
/**
* ModelType
* @description Model type.
* @enum {string}
*/
- ModelType: "onnx" | "main" | "vae" | "lora" | "control_lora" | "controlnet" | "embedding" | "ip_adapter" | "clip_vision" | "clip_embed" | "t2i_adapter" | "t5_encoder" | "qwen3_encoder" | "spandrel_image_to_image" | "siglip" | "flux_redux" | "llava_onevision" | "unknown";
+ ModelType: "onnx" | "main" | "vae" | "lora" | "control_lora" | "controlnet" | "embedding" | "ip_adapter" | "clip_vision" | "clip_embed" | "t2i_adapter" | "t5_encoder" | "qwen3_encoder" | "spandrel_image_to_image" | "siglip" | "flux_redux" | "llava_onevision" | "external_image_generator" | "unknown";
/**
* ModelVariantType
* @description Variant type.
@@ -22571,7 +23048,7 @@ export type components = {
*/
ModelsList: {
/** Models */
- models: (components["schemas"]["Main_Diffusers_SD1_Config"] | components["schemas"]["Main_Diffusers_SD2_Config"] | components["schemas"]["Main_Diffusers_SDXL_Config"] | components["schemas"]["Main_Diffusers_SDXLRefiner_Config"] | components["schemas"]["Main_Diffusers_SD3_Config"] | components["schemas"]["Main_Diffusers_FLUX_Config"] | components["schemas"]["Main_Diffusers_Flux2_Config"] | components["schemas"]["Main_Diffusers_CogView4_Config"] | components["schemas"]["Main_Diffusers_QwenImage_Config"] | components["schemas"]["Main_Diffusers_ZImage_Config"] | components["schemas"]["Main_Checkpoint_SD1_Config"] | components["schemas"]["Main_Checkpoint_SD2_Config"] | components["schemas"]["Main_Checkpoint_SDXL_Config"] | components["schemas"]["Main_Checkpoint_SDXLRefiner_Config"] | components["schemas"]["Main_Checkpoint_Flux2_Config"] | components["schemas"]["Main_Checkpoint_FLUX_Config"] | components["schemas"]["Main_Checkpoint_ZImage_Config"] | components["schemas"]["Main_Checkpoint_Anima_Config"] | components["schemas"]["Main_BnBNF4_FLUX_Config"] | components["schemas"]["Main_GGUF_Flux2_Config"] | components["schemas"]["Main_GGUF_FLUX_Config"] | components["schemas"]["Main_GGUF_QwenImage_Config"] | components["schemas"]["Main_GGUF_ZImage_Config"] | components["schemas"]["VAE_Checkpoint_SD1_Config"] | components["schemas"]["VAE_Checkpoint_SD2_Config"] | components["schemas"]["VAE_Checkpoint_SDXL_Config"] | components["schemas"]["VAE_Checkpoint_FLUX_Config"] | components["schemas"]["VAE_Checkpoint_Flux2_Config"] | components["schemas"]["VAE_Checkpoint_Anima_Config"] | components["schemas"]["VAE_Diffusers_SD1_Config"] | components["schemas"]["VAE_Diffusers_SDXL_Config"] | components["schemas"]["VAE_Diffusers_Flux2_Config"] | components["schemas"]["ControlNet_Checkpoint_SD1_Config"] | components["schemas"]["ControlNet_Checkpoint_SD2_Config"] | components["schemas"]["ControlNet_Checkpoint_SDXL_Config"] | components["schemas"]["ControlNet_Checkpoint_FLUX_Config"] | components["schemas"]["ControlNet_Checkpoint_ZImage_Config"] | components["schemas"]["ControlNet_Diffusers_SD1_Config"] | components["schemas"]["ControlNet_Diffusers_SD2_Config"] | components["schemas"]["ControlNet_Diffusers_SDXL_Config"] | components["schemas"]["ControlNet_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_SD1_Config"] | components["schemas"]["LoRA_LyCORIS_SD2_Config"] | components["schemas"]["LoRA_LyCORIS_SDXL_Config"] | components["schemas"]["LoRA_LyCORIS_Flux2_Config"] | components["schemas"]["LoRA_LyCORIS_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_ZImage_Config"] | components["schemas"]["LoRA_LyCORIS_QwenImage_Config"] | components["schemas"]["LoRA_LyCORIS_Anima_Config"] | components["schemas"]["LoRA_OMI_SDXL_Config"] | components["schemas"]["LoRA_OMI_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_SD1_Config"] | components["schemas"]["LoRA_Diffusers_SD2_Config"] | components["schemas"]["LoRA_Diffusers_SDXL_Config"] | components["schemas"]["LoRA_Diffusers_Flux2_Config"] | components["schemas"]["LoRA_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_ZImage_Config"] | components["schemas"]["ControlLoRA_LyCORIS_FLUX_Config"] | components["schemas"]["T5Encoder_T5Encoder_Config"] | components["schemas"]["T5Encoder_BnBLLMint8_Config"] | components["schemas"]["Qwen3Encoder_Qwen3Encoder_Config"] | components["schemas"]["Qwen3Encoder_Checkpoint_Config"] | components["schemas"]["Qwen3Encoder_GGUF_Config"] | components["schemas"]["TI_File_SD1_Config"] | components["schemas"]["TI_File_SD2_Config"] | components["schemas"]["TI_File_SDXL_Config"] | components["schemas"]["TI_Folder_SD1_Config"] | components["schemas"]["TI_Folder_SD2_Config"] | components["schemas"]["TI_Folder_SDXL_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD1_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD2_Config"] | components["schemas"]["IPAdapter_InvokeAI_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD1_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD2_Config"] | components["schemas"]["IPAdapter_Checkpoint_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_FLUX_Config"] | components["schemas"]["T2IAdapter_Diffusers_SD1_Config"] | components["schemas"]["T2IAdapter_Diffusers_SDXL_Config"] | components["schemas"]["Spandrel_Checkpoint_Config"] | components["schemas"]["CLIPEmbed_Diffusers_G_Config"] | components["schemas"]["CLIPEmbed_Diffusers_L_Config"] | components["schemas"]["CLIPVision_Diffusers_Config"] | components["schemas"]["SigLIP_Diffusers_Config"] | components["schemas"]["FLUXRedux_Checkpoint_Config"] | components["schemas"]["LlavaOnevision_Diffusers_Config"] | components["schemas"]["Unknown_Config"])[];
+ models: (components["schemas"]["Main_Diffusers_SD1_Config"] | components["schemas"]["Main_Diffusers_SD2_Config"] | components["schemas"]["Main_Diffusers_SDXL_Config"] | components["schemas"]["Main_Diffusers_SDXLRefiner_Config"] | components["schemas"]["Main_Diffusers_SD3_Config"] | components["schemas"]["Main_Diffusers_FLUX_Config"] | components["schemas"]["Main_Diffusers_Flux2_Config"] | components["schemas"]["Main_Diffusers_CogView4_Config"] | components["schemas"]["Main_Diffusers_QwenImage_Config"] | components["schemas"]["Main_Diffusers_ZImage_Config"] | components["schemas"]["Main_Checkpoint_SD1_Config"] | components["schemas"]["Main_Checkpoint_SD2_Config"] | components["schemas"]["Main_Checkpoint_SDXL_Config"] | components["schemas"]["Main_Checkpoint_SDXLRefiner_Config"] | components["schemas"]["Main_Checkpoint_Flux2_Config"] | components["schemas"]["Main_Checkpoint_FLUX_Config"] | components["schemas"]["Main_Checkpoint_ZImage_Config"] | components["schemas"]["Main_Checkpoint_Anima_Config"] | components["schemas"]["Main_BnBNF4_FLUX_Config"] | components["schemas"]["Main_GGUF_Flux2_Config"] | components["schemas"]["Main_GGUF_FLUX_Config"] | components["schemas"]["Main_GGUF_QwenImage_Config"] | components["schemas"]["Main_GGUF_ZImage_Config"] | components["schemas"]["VAE_Checkpoint_SD1_Config"] | components["schemas"]["VAE_Checkpoint_SD2_Config"] | components["schemas"]["VAE_Checkpoint_SDXL_Config"] | components["schemas"]["VAE_Checkpoint_FLUX_Config"] | components["schemas"]["VAE_Checkpoint_Flux2_Config"] | components["schemas"]["VAE_Checkpoint_Anima_Config"] | components["schemas"]["VAE_Diffusers_SD1_Config"] | components["schemas"]["VAE_Diffusers_SDXL_Config"] | components["schemas"]["VAE_Diffusers_Flux2_Config"] | components["schemas"]["ControlNet_Checkpoint_SD1_Config"] | components["schemas"]["ControlNet_Checkpoint_SD2_Config"] | components["schemas"]["ControlNet_Checkpoint_SDXL_Config"] | components["schemas"]["ControlNet_Checkpoint_FLUX_Config"] | components["schemas"]["ControlNet_Checkpoint_ZImage_Config"] | components["schemas"]["ControlNet_Diffusers_SD1_Config"] | components["schemas"]["ControlNet_Diffusers_SD2_Config"] | components["schemas"]["ControlNet_Diffusers_SDXL_Config"] | components["schemas"]["ControlNet_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_SD1_Config"] | components["schemas"]["LoRA_LyCORIS_SD2_Config"] | components["schemas"]["LoRA_LyCORIS_SDXL_Config"] | components["schemas"]["LoRA_LyCORIS_Flux2_Config"] | components["schemas"]["LoRA_LyCORIS_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_ZImage_Config"] | components["schemas"]["LoRA_LyCORIS_QwenImage_Config"] | components["schemas"]["LoRA_LyCORIS_Anima_Config"] | components["schemas"]["LoRA_OMI_SDXL_Config"] | components["schemas"]["LoRA_OMI_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_SD1_Config"] | components["schemas"]["LoRA_Diffusers_SD2_Config"] | components["schemas"]["LoRA_Diffusers_SDXL_Config"] | components["schemas"]["LoRA_Diffusers_Flux2_Config"] | components["schemas"]["LoRA_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_ZImage_Config"] | components["schemas"]["ControlLoRA_LyCORIS_FLUX_Config"] | components["schemas"]["T5Encoder_T5Encoder_Config"] | components["schemas"]["T5Encoder_BnBLLMint8_Config"] | components["schemas"]["Qwen3Encoder_Qwen3Encoder_Config"] | components["schemas"]["Qwen3Encoder_Checkpoint_Config"] | components["schemas"]["Qwen3Encoder_GGUF_Config"] | components["schemas"]["TI_File_SD1_Config"] | components["schemas"]["TI_File_SD2_Config"] | components["schemas"]["TI_File_SDXL_Config"] | components["schemas"]["TI_Folder_SD1_Config"] | components["schemas"]["TI_Folder_SD2_Config"] | components["schemas"]["TI_Folder_SDXL_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD1_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD2_Config"] | components["schemas"]["IPAdapter_InvokeAI_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD1_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD2_Config"] | components["schemas"]["IPAdapter_Checkpoint_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_FLUX_Config"] | components["schemas"]["T2IAdapter_Diffusers_SD1_Config"] | components["schemas"]["T2IAdapter_Diffusers_SDXL_Config"] | components["schemas"]["Spandrel_Checkpoint_Config"] | components["schemas"]["CLIPEmbed_Diffusers_G_Config"] | components["schemas"]["CLIPEmbed_Diffusers_L_Config"] | components["schemas"]["CLIPVision_Diffusers_Config"] | components["schemas"]["SigLIP_Diffusers_Config"] | components["schemas"]["FLUXRedux_Checkpoint_Config"] | components["schemas"]["LlavaOnevision_Diffusers_Config"] | components["schemas"]["ExternalApiModelConfig"] | components["schemas"]["Unknown_Config"])[];
};
/**
* Multiply Integers
@@ -22799,6 +23276,129 @@ export type components = {
*/
items: components["schemas"]["ImageDTO"][];
};
+ /**
+ * OpenAI Image Generation
+ * @description Generate images using an OpenAI-hosted external model.
+ */
+ OpenAIImageGenerationInvocation: {
+ /**
+ * @description The board to save the image to
+ * @default null
+ */
+ board?: components["schemas"]["BoardField"] | null;
+ /**
+ * @description Optional metadata to be saved with the image
+ * @default null
+ */
+ metadata?: components["schemas"]["MetadataField"] | null;
+ /**
+ * Id
+ * @description The id of this instance of an invocation. Must be unique among all instances of invocations.
+ */
+ id: string;
+ /**
+ * Is Intermediate
+ * @description Whether or not this is an intermediate invocation.
+ * @default false
+ */
+ is_intermediate?: boolean;
+ /**
+ * Use Cache
+ * @description Whether or not to use the cache
+ * @default true
+ */
+ use_cache?: boolean;
+ /**
+ * @description Main model (UNet, VAE, CLIP) to load
+ * @default null
+ */
+ model?: components["schemas"]["ModelIdentifierField"] | null;
+ /**
+ * Mode
+ * @description Generation mode.
+ * @default txt2img
+ * @enum {string}
+ */
+ mode?: "txt2img" | "img2img" | "inpaint";
+ /**
+ * Prompt
+ * @description Prompt
+ * @default null
+ */
+ prompt?: string | null;
+ /**
+ * Seed
+ * @description Seed for random number generation
+ * @default null
+ */
+ seed?: number | null;
+ /**
+ * Num Images
+ * @description Number of images to generate
+ * @default 1
+ */
+ num_images?: number;
+ /**
+ * Width
+ * @description Width of output (px)
+ * @default 1024
+ */
+ width?: number;
+ /**
+ * Height
+ * @description Height of output (px)
+ * @default 1024
+ */
+ height?: number;
+ /**
+ * Image Size
+ * @description Image size preset (e.g. 1K, 2K, 4K)
+ * @default null
+ */
+ image_size?: string | null;
+ /**
+ * @description Init image (use reference_images instead)
+ * @default null
+ */
+ init_image?: components["schemas"]["ImageField"] | null;
+ /**
+ * @description Mask image for inpaint
+ * @default null
+ */
+ mask_image?: components["schemas"]["ImageField"] | null;
+ /**
+ * Reference Images
+ * @description Reference images
+ * @default []
+ */
+ reference_images?: components["schemas"]["ImageField"][];
+ /**
+ * Quality
+ * @description Output image quality
+ * @default auto
+ * @enum {string}
+ */
+ quality?: "auto" | "high" | "medium" | "low";
+ /**
+ * Background
+ * @description Background transparency handling
+ * @default auto
+ * @enum {string}
+ */
+ background?: "auto" | "transparent" | "opaque";
+ /**
+ * Input Fidelity
+ * @description Fidelity to source images (edits only)
+ * @default null
+ */
+ input_fidelity?: ("low" | "high") | null;
+ /**
+ * type
+ * @default openai_image_generation
+ * @constant
+ */
+ type: "openai_image_generation";
+ };
/**
* OrphanedModelInfo
* @description Information about an orphaned model directory.
@@ -26589,6 +27189,9 @@ export type components = {
* @default false
*/
is_installed?: boolean;
+ capabilities?: components["schemas"]["ExternalModelCapabilities"] | null;
+ default_settings?: components["schemas"]["ExternalApiModelDefaultSettings"] | null;
+ panel_schema?: components["schemas"]["ExternalModelPanelSchema"] | null;
/**
* Previous Names
* @default []
@@ -26631,6 +27234,9 @@ export type components = {
* @default false
*/
is_installed?: boolean;
+ capabilities?: components["schemas"]["ExternalModelCapabilities"] | null;
+ default_settings?: components["schemas"]["ExternalApiModelDefaultSettings"] | null;
+ panel_schema?: components["schemas"]["ExternalModelPanelSchema"] | null;
/**
* Previous Names
* @default []
@@ -30988,7 +31594,7 @@ export interface operations {
[name: string]: unknown;
};
content: {
- "application/json": components["schemas"]["Main_Diffusers_SD1_Config"] | components["schemas"]["Main_Diffusers_SD2_Config"] | components["schemas"]["Main_Diffusers_SDXL_Config"] | components["schemas"]["Main_Diffusers_SDXLRefiner_Config"] | components["schemas"]["Main_Diffusers_SD3_Config"] | components["schemas"]["Main_Diffusers_FLUX_Config"] | components["schemas"]["Main_Diffusers_Flux2_Config"] | components["schemas"]["Main_Diffusers_CogView4_Config"] | components["schemas"]["Main_Diffusers_QwenImage_Config"] | components["schemas"]["Main_Diffusers_ZImage_Config"] | components["schemas"]["Main_Checkpoint_SD1_Config"] | components["schemas"]["Main_Checkpoint_SD2_Config"] | components["schemas"]["Main_Checkpoint_SDXL_Config"] | components["schemas"]["Main_Checkpoint_SDXLRefiner_Config"] | components["schemas"]["Main_Checkpoint_Flux2_Config"] | components["schemas"]["Main_Checkpoint_FLUX_Config"] | components["schemas"]["Main_Checkpoint_ZImage_Config"] | components["schemas"]["Main_Checkpoint_Anima_Config"] | components["schemas"]["Main_BnBNF4_FLUX_Config"] | components["schemas"]["Main_GGUF_Flux2_Config"] | components["schemas"]["Main_GGUF_FLUX_Config"] | components["schemas"]["Main_GGUF_QwenImage_Config"] | components["schemas"]["Main_GGUF_ZImage_Config"] | components["schemas"]["VAE_Checkpoint_SD1_Config"] | components["schemas"]["VAE_Checkpoint_SD2_Config"] | components["schemas"]["VAE_Checkpoint_SDXL_Config"] | components["schemas"]["VAE_Checkpoint_FLUX_Config"] | components["schemas"]["VAE_Checkpoint_Flux2_Config"] | components["schemas"]["VAE_Checkpoint_Anima_Config"] | components["schemas"]["VAE_Diffusers_SD1_Config"] | components["schemas"]["VAE_Diffusers_SDXL_Config"] | components["schemas"]["VAE_Diffusers_Flux2_Config"] | components["schemas"]["ControlNet_Checkpoint_SD1_Config"] | components["schemas"]["ControlNet_Checkpoint_SD2_Config"] | components["schemas"]["ControlNet_Checkpoint_SDXL_Config"] | components["schemas"]["ControlNet_Checkpoint_FLUX_Config"] | components["schemas"]["ControlNet_Checkpoint_ZImage_Config"] | components["schemas"]["ControlNet_Diffusers_SD1_Config"] | components["schemas"]["ControlNet_Diffusers_SD2_Config"] | components["schemas"]["ControlNet_Diffusers_SDXL_Config"] | components["schemas"]["ControlNet_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_SD1_Config"] | components["schemas"]["LoRA_LyCORIS_SD2_Config"] | components["schemas"]["LoRA_LyCORIS_SDXL_Config"] | components["schemas"]["LoRA_LyCORIS_Flux2_Config"] | components["schemas"]["LoRA_LyCORIS_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_ZImage_Config"] | components["schemas"]["LoRA_LyCORIS_QwenImage_Config"] | components["schemas"]["LoRA_LyCORIS_Anima_Config"] | components["schemas"]["LoRA_OMI_SDXL_Config"] | components["schemas"]["LoRA_OMI_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_SD1_Config"] | components["schemas"]["LoRA_Diffusers_SD2_Config"] | components["schemas"]["LoRA_Diffusers_SDXL_Config"] | components["schemas"]["LoRA_Diffusers_Flux2_Config"] | components["schemas"]["LoRA_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_ZImage_Config"] | components["schemas"]["ControlLoRA_LyCORIS_FLUX_Config"] | components["schemas"]["T5Encoder_T5Encoder_Config"] | components["schemas"]["T5Encoder_BnBLLMint8_Config"] | components["schemas"]["Qwen3Encoder_Qwen3Encoder_Config"] | components["schemas"]["Qwen3Encoder_Checkpoint_Config"] | components["schemas"]["Qwen3Encoder_GGUF_Config"] | components["schemas"]["TI_File_SD1_Config"] | components["schemas"]["TI_File_SD2_Config"] | components["schemas"]["TI_File_SDXL_Config"] | components["schemas"]["TI_Folder_SD1_Config"] | components["schemas"]["TI_Folder_SD2_Config"] | components["schemas"]["TI_Folder_SDXL_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD1_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD2_Config"] | components["schemas"]["IPAdapter_InvokeAI_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD1_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD2_Config"] | components["schemas"]["IPAdapter_Checkpoint_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_FLUX_Config"] | components["schemas"]["T2IAdapter_Diffusers_SD1_Config"] | components["schemas"]["T2IAdapter_Diffusers_SDXL_Config"] | components["schemas"]["Spandrel_Checkpoint_Config"] | components["schemas"]["CLIPEmbed_Diffusers_G_Config"] | components["schemas"]["CLIPEmbed_Diffusers_L_Config"] | components["schemas"]["CLIPVision_Diffusers_Config"] | components["schemas"]["SigLIP_Diffusers_Config"] | components["schemas"]["FLUXRedux_Checkpoint_Config"] | components["schemas"]["LlavaOnevision_Diffusers_Config"] | components["schemas"]["Unknown_Config"];
+ "application/json": components["schemas"]["Main_Diffusers_SD1_Config"] | components["schemas"]["Main_Diffusers_SD2_Config"] | components["schemas"]["Main_Diffusers_SDXL_Config"] | components["schemas"]["Main_Diffusers_SDXLRefiner_Config"] | components["schemas"]["Main_Diffusers_SD3_Config"] | components["schemas"]["Main_Diffusers_FLUX_Config"] | components["schemas"]["Main_Diffusers_Flux2_Config"] | components["schemas"]["Main_Diffusers_CogView4_Config"] | components["schemas"]["Main_Diffusers_QwenImage_Config"] | components["schemas"]["Main_Diffusers_ZImage_Config"] | components["schemas"]["Main_Checkpoint_SD1_Config"] | components["schemas"]["Main_Checkpoint_SD2_Config"] | components["schemas"]["Main_Checkpoint_SDXL_Config"] | components["schemas"]["Main_Checkpoint_SDXLRefiner_Config"] | components["schemas"]["Main_Checkpoint_Flux2_Config"] | components["schemas"]["Main_Checkpoint_FLUX_Config"] | components["schemas"]["Main_Checkpoint_ZImage_Config"] | components["schemas"]["Main_Checkpoint_Anima_Config"] | components["schemas"]["Main_BnBNF4_FLUX_Config"] | components["schemas"]["Main_GGUF_Flux2_Config"] | components["schemas"]["Main_GGUF_FLUX_Config"] | components["schemas"]["Main_GGUF_QwenImage_Config"] | components["schemas"]["Main_GGUF_ZImage_Config"] | components["schemas"]["VAE_Checkpoint_SD1_Config"] | components["schemas"]["VAE_Checkpoint_SD2_Config"] | components["schemas"]["VAE_Checkpoint_SDXL_Config"] | components["schemas"]["VAE_Checkpoint_FLUX_Config"] | components["schemas"]["VAE_Checkpoint_Flux2_Config"] | components["schemas"]["VAE_Checkpoint_Anima_Config"] | components["schemas"]["VAE_Diffusers_SD1_Config"] | components["schemas"]["VAE_Diffusers_SDXL_Config"] | components["schemas"]["VAE_Diffusers_Flux2_Config"] | components["schemas"]["ControlNet_Checkpoint_SD1_Config"] | components["schemas"]["ControlNet_Checkpoint_SD2_Config"] | components["schemas"]["ControlNet_Checkpoint_SDXL_Config"] | components["schemas"]["ControlNet_Checkpoint_FLUX_Config"] | components["schemas"]["ControlNet_Checkpoint_ZImage_Config"] | components["schemas"]["ControlNet_Diffusers_SD1_Config"] | components["schemas"]["ControlNet_Diffusers_SD2_Config"] | components["schemas"]["ControlNet_Diffusers_SDXL_Config"] | components["schemas"]["ControlNet_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_SD1_Config"] | components["schemas"]["LoRA_LyCORIS_SD2_Config"] | components["schemas"]["LoRA_LyCORIS_SDXL_Config"] | components["schemas"]["LoRA_LyCORIS_Flux2_Config"] | components["schemas"]["LoRA_LyCORIS_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_ZImage_Config"] | components["schemas"]["LoRA_LyCORIS_QwenImage_Config"] | components["schemas"]["LoRA_LyCORIS_Anima_Config"] | components["schemas"]["LoRA_OMI_SDXL_Config"] | components["schemas"]["LoRA_OMI_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_SD1_Config"] | components["schemas"]["LoRA_Diffusers_SD2_Config"] | components["schemas"]["LoRA_Diffusers_SDXL_Config"] | components["schemas"]["LoRA_Diffusers_Flux2_Config"] | components["schemas"]["LoRA_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_ZImage_Config"] | components["schemas"]["ControlLoRA_LyCORIS_FLUX_Config"] | components["schemas"]["T5Encoder_T5Encoder_Config"] | components["schemas"]["T5Encoder_BnBLLMint8_Config"] | components["schemas"]["Qwen3Encoder_Qwen3Encoder_Config"] | components["schemas"]["Qwen3Encoder_Checkpoint_Config"] | components["schemas"]["Qwen3Encoder_GGUF_Config"] | components["schemas"]["TI_File_SD1_Config"] | components["schemas"]["TI_File_SD2_Config"] | components["schemas"]["TI_File_SDXL_Config"] | components["schemas"]["TI_Folder_SD1_Config"] | components["schemas"]["TI_Folder_SD2_Config"] | components["schemas"]["TI_Folder_SDXL_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD1_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD2_Config"] | components["schemas"]["IPAdapter_InvokeAI_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD1_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD2_Config"] | components["schemas"]["IPAdapter_Checkpoint_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_FLUX_Config"] | components["schemas"]["T2IAdapter_Diffusers_SD1_Config"] | components["schemas"]["T2IAdapter_Diffusers_SDXL_Config"] | components["schemas"]["Spandrel_Checkpoint_Config"] | components["schemas"]["CLIPEmbed_Diffusers_G_Config"] | components["schemas"]["CLIPEmbed_Diffusers_L_Config"] | components["schemas"]["CLIPVision_Diffusers_Config"] | components["schemas"]["SigLIP_Diffusers_Config"] | components["schemas"]["FLUXRedux_Checkpoint_Config"] | components["schemas"]["LlavaOnevision_Diffusers_Config"] | components["schemas"]["ExternalApiModelConfig"] | components["schemas"]["Unknown_Config"];
};
};
/** @description Validation Error */
@@ -31020,7 +31626,7 @@ export interface operations {
[name: string]: unknown;
};
content: {
- "application/json": components["schemas"]["Main_Diffusers_SD1_Config"] | components["schemas"]["Main_Diffusers_SD2_Config"] | components["schemas"]["Main_Diffusers_SDXL_Config"] | components["schemas"]["Main_Diffusers_SDXLRefiner_Config"] | components["schemas"]["Main_Diffusers_SD3_Config"] | components["schemas"]["Main_Diffusers_FLUX_Config"] | components["schemas"]["Main_Diffusers_Flux2_Config"] | components["schemas"]["Main_Diffusers_CogView4_Config"] | components["schemas"]["Main_Diffusers_QwenImage_Config"] | components["schemas"]["Main_Diffusers_ZImage_Config"] | components["schemas"]["Main_Checkpoint_SD1_Config"] | components["schemas"]["Main_Checkpoint_SD2_Config"] | components["schemas"]["Main_Checkpoint_SDXL_Config"] | components["schemas"]["Main_Checkpoint_SDXLRefiner_Config"] | components["schemas"]["Main_Checkpoint_Flux2_Config"] | components["schemas"]["Main_Checkpoint_FLUX_Config"] | components["schemas"]["Main_Checkpoint_ZImage_Config"] | components["schemas"]["Main_Checkpoint_Anima_Config"] | components["schemas"]["Main_BnBNF4_FLUX_Config"] | components["schemas"]["Main_GGUF_Flux2_Config"] | components["schemas"]["Main_GGUF_FLUX_Config"] | components["schemas"]["Main_GGUF_QwenImage_Config"] | components["schemas"]["Main_GGUF_ZImage_Config"] | components["schemas"]["VAE_Checkpoint_SD1_Config"] | components["schemas"]["VAE_Checkpoint_SD2_Config"] | components["schemas"]["VAE_Checkpoint_SDXL_Config"] | components["schemas"]["VAE_Checkpoint_FLUX_Config"] | components["schemas"]["VAE_Checkpoint_Flux2_Config"] | components["schemas"]["VAE_Checkpoint_Anima_Config"] | components["schemas"]["VAE_Diffusers_SD1_Config"] | components["schemas"]["VAE_Diffusers_SDXL_Config"] | components["schemas"]["VAE_Diffusers_Flux2_Config"] | components["schemas"]["ControlNet_Checkpoint_SD1_Config"] | components["schemas"]["ControlNet_Checkpoint_SD2_Config"] | components["schemas"]["ControlNet_Checkpoint_SDXL_Config"] | components["schemas"]["ControlNet_Checkpoint_FLUX_Config"] | components["schemas"]["ControlNet_Checkpoint_ZImage_Config"] | components["schemas"]["ControlNet_Diffusers_SD1_Config"] | components["schemas"]["ControlNet_Diffusers_SD2_Config"] | components["schemas"]["ControlNet_Diffusers_SDXL_Config"] | components["schemas"]["ControlNet_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_SD1_Config"] | components["schemas"]["LoRA_LyCORIS_SD2_Config"] | components["schemas"]["LoRA_LyCORIS_SDXL_Config"] | components["schemas"]["LoRA_LyCORIS_Flux2_Config"] | components["schemas"]["LoRA_LyCORIS_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_ZImage_Config"] | components["schemas"]["LoRA_LyCORIS_QwenImage_Config"] | components["schemas"]["LoRA_LyCORIS_Anima_Config"] | components["schemas"]["LoRA_OMI_SDXL_Config"] | components["schemas"]["LoRA_OMI_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_SD1_Config"] | components["schemas"]["LoRA_Diffusers_SD2_Config"] | components["schemas"]["LoRA_Diffusers_SDXL_Config"] | components["schemas"]["LoRA_Diffusers_Flux2_Config"] | components["schemas"]["LoRA_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_ZImage_Config"] | components["schemas"]["ControlLoRA_LyCORIS_FLUX_Config"] | components["schemas"]["T5Encoder_T5Encoder_Config"] | components["schemas"]["T5Encoder_BnBLLMint8_Config"] | components["schemas"]["Qwen3Encoder_Qwen3Encoder_Config"] | components["schemas"]["Qwen3Encoder_Checkpoint_Config"] | components["schemas"]["Qwen3Encoder_GGUF_Config"] | components["schemas"]["TI_File_SD1_Config"] | components["schemas"]["TI_File_SD2_Config"] | components["schemas"]["TI_File_SDXL_Config"] | components["schemas"]["TI_Folder_SD1_Config"] | components["schemas"]["TI_Folder_SD2_Config"] | components["schemas"]["TI_Folder_SDXL_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD1_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD2_Config"] | components["schemas"]["IPAdapter_InvokeAI_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD1_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD2_Config"] | components["schemas"]["IPAdapter_Checkpoint_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_FLUX_Config"] | components["schemas"]["T2IAdapter_Diffusers_SD1_Config"] | components["schemas"]["T2IAdapter_Diffusers_SDXL_Config"] | components["schemas"]["Spandrel_Checkpoint_Config"] | components["schemas"]["CLIPEmbed_Diffusers_G_Config"] | components["schemas"]["CLIPEmbed_Diffusers_L_Config"] | components["schemas"]["CLIPVision_Diffusers_Config"] | components["schemas"]["SigLIP_Diffusers_Config"] | components["schemas"]["FLUXRedux_Checkpoint_Config"] | components["schemas"]["LlavaOnevision_Diffusers_Config"] | components["schemas"]["Unknown_Config"];
+ "application/json": components["schemas"]["Main_Diffusers_SD1_Config"] | components["schemas"]["Main_Diffusers_SD2_Config"] | components["schemas"]["Main_Diffusers_SDXL_Config"] | components["schemas"]["Main_Diffusers_SDXLRefiner_Config"] | components["schemas"]["Main_Diffusers_SD3_Config"] | components["schemas"]["Main_Diffusers_FLUX_Config"] | components["schemas"]["Main_Diffusers_Flux2_Config"] | components["schemas"]["Main_Diffusers_CogView4_Config"] | components["schemas"]["Main_Diffusers_QwenImage_Config"] | components["schemas"]["Main_Diffusers_ZImage_Config"] | components["schemas"]["Main_Checkpoint_SD1_Config"] | components["schemas"]["Main_Checkpoint_SD2_Config"] | components["schemas"]["Main_Checkpoint_SDXL_Config"] | components["schemas"]["Main_Checkpoint_SDXLRefiner_Config"] | components["schemas"]["Main_Checkpoint_Flux2_Config"] | components["schemas"]["Main_Checkpoint_FLUX_Config"] | components["schemas"]["Main_Checkpoint_ZImage_Config"] | components["schemas"]["Main_Checkpoint_Anima_Config"] | components["schemas"]["Main_BnBNF4_FLUX_Config"] | components["schemas"]["Main_GGUF_Flux2_Config"] | components["schemas"]["Main_GGUF_FLUX_Config"] | components["schemas"]["Main_GGUF_QwenImage_Config"] | components["schemas"]["Main_GGUF_ZImage_Config"] | components["schemas"]["VAE_Checkpoint_SD1_Config"] | components["schemas"]["VAE_Checkpoint_SD2_Config"] | components["schemas"]["VAE_Checkpoint_SDXL_Config"] | components["schemas"]["VAE_Checkpoint_FLUX_Config"] | components["schemas"]["VAE_Checkpoint_Flux2_Config"] | components["schemas"]["VAE_Checkpoint_Anima_Config"] | components["schemas"]["VAE_Diffusers_SD1_Config"] | components["schemas"]["VAE_Diffusers_SDXL_Config"] | components["schemas"]["VAE_Diffusers_Flux2_Config"] | components["schemas"]["ControlNet_Checkpoint_SD1_Config"] | components["schemas"]["ControlNet_Checkpoint_SD2_Config"] | components["schemas"]["ControlNet_Checkpoint_SDXL_Config"] | components["schemas"]["ControlNet_Checkpoint_FLUX_Config"] | components["schemas"]["ControlNet_Checkpoint_ZImage_Config"] | components["schemas"]["ControlNet_Diffusers_SD1_Config"] | components["schemas"]["ControlNet_Diffusers_SD2_Config"] | components["schemas"]["ControlNet_Diffusers_SDXL_Config"] | components["schemas"]["ControlNet_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_SD1_Config"] | components["schemas"]["LoRA_LyCORIS_SD2_Config"] | components["schemas"]["LoRA_LyCORIS_SDXL_Config"] | components["schemas"]["LoRA_LyCORIS_Flux2_Config"] | components["schemas"]["LoRA_LyCORIS_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_ZImage_Config"] | components["schemas"]["LoRA_LyCORIS_QwenImage_Config"] | components["schemas"]["LoRA_LyCORIS_Anima_Config"] | components["schemas"]["LoRA_OMI_SDXL_Config"] | components["schemas"]["LoRA_OMI_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_SD1_Config"] | components["schemas"]["LoRA_Diffusers_SD2_Config"] | components["schemas"]["LoRA_Diffusers_SDXL_Config"] | components["schemas"]["LoRA_Diffusers_Flux2_Config"] | components["schemas"]["LoRA_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_ZImage_Config"] | components["schemas"]["ControlLoRA_LyCORIS_FLUX_Config"] | components["schemas"]["T5Encoder_T5Encoder_Config"] | components["schemas"]["T5Encoder_BnBLLMint8_Config"] | components["schemas"]["Qwen3Encoder_Qwen3Encoder_Config"] | components["schemas"]["Qwen3Encoder_Checkpoint_Config"] | components["schemas"]["Qwen3Encoder_GGUF_Config"] | components["schemas"]["TI_File_SD1_Config"] | components["schemas"]["TI_File_SD2_Config"] | components["schemas"]["TI_File_SDXL_Config"] | components["schemas"]["TI_Folder_SD1_Config"] | components["schemas"]["TI_Folder_SD2_Config"] | components["schemas"]["TI_Folder_SDXL_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD1_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD2_Config"] | components["schemas"]["IPAdapter_InvokeAI_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD1_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD2_Config"] | components["schemas"]["IPAdapter_Checkpoint_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_FLUX_Config"] | components["schemas"]["T2IAdapter_Diffusers_SD1_Config"] | components["schemas"]["T2IAdapter_Diffusers_SDXL_Config"] | components["schemas"]["Spandrel_Checkpoint_Config"] | components["schemas"]["CLIPEmbed_Diffusers_G_Config"] | components["schemas"]["CLIPEmbed_Diffusers_L_Config"] | components["schemas"]["CLIPVision_Diffusers_Config"] | components["schemas"]["SigLIP_Diffusers_Config"] | components["schemas"]["FLUXRedux_Checkpoint_Config"] | components["schemas"]["LlavaOnevision_Diffusers_Config"] | components["schemas"]["ExternalApiModelConfig"] | components["schemas"]["Unknown_Config"];
};
};
/** @description Validation Error */
@@ -31070,7 +31676,7 @@ export interface operations {
* "repo_variant": "fp16",
* "upcast_attention": false
* } */
- "application/json": components["schemas"]["Main_Diffusers_SD1_Config"] | components["schemas"]["Main_Diffusers_SD2_Config"] | components["schemas"]["Main_Diffusers_SDXL_Config"] | components["schemas"]["Main_Diffusers_SDXLRefiner_Config"] | components["schemas"]["Main_Diffusers_SD3_Config"] | components["schemas"]["Main_Diffusers_FLUX_Config"] | components["schemas"]["Main_Diffusers_Flux2_Config"] | components["schemas"]["Main_Diffusers_CogView4_Config"] | components["schemas"]["Main_Diffusers_QwenImage_Config"] | components["schemas"]["Main_Diffusers_ZImage_Config"] | components["schemas"]["Main_Checkpoint_SD1_Config"] | components["schemas"]["Main_Checkpoint_SD2_Config"] | components["schemas"]["Main_Checkpoint_SDXL_Config"] | components["schemas"]["Main_Checkpoint_SDXLRefiner_Config"] | components["schemas"]["Main_Checkpoint_Flux2_Config"] | components["schemas"]["Main_Checkpoint_FLUX_Config"] | components["schemas"]["Main_Checkpoint_ZImage_Config"] | components["schemas"]["Main_Checkpoint_Anima_Config"] | components["schemas"]["Main_BnBNF4_FLUX_Config"] | components["schemas"]["Main_GGUF_Flux2_Config"] | components["schemas"]["Main_GGUF_FLUX_Config"] | components["schemas"]["Main_GGUF_QwenImage_Config"] | components["schemas"]["Main_GGUF_ZImage_Config"] | components["schemas"]["VAE_Checkpoint_SD1_Config"] | components["schemas"]["VAE_Checkpoint_SD2_Config"] | components["schemas"]["VAE_Checkpoint_SDXL_Config"] | components["schemas"]["VAE_Checkpoint_FLUX_Config"] | components["schemas"]["VAE_Checkpoint_Flux2_Config"] | components["schemas"]["VAE_Checkpoint_Anima_Config"] | components["schemas"]["VAE_Diffusers_SD1_Config"] | components["schemas"]["VAE_Diffusers_SDXL_Config"] | components["schemas"]["VAE_Diffusers_Flux2_Config"] | components["schemas"]["ControlNet_Checkpoint_SD1_Config"] | components["schemas"]["ControlNet_Checkpoint_SD2_Config"] | components["schemas"]["ControlNet_Checkpoint_SDXL_Config"] | components["schemas"]["ControlNet_Checkpoint_FLUX_Config"] | components["schemas"]["ControlNet_Checkpoint_ZImage_Config"] | components["schemas"]["ControlNet_Diffusers_SD1_Config"] | components["schemas"]["ControlNet_Diffusers_SD2_Config"] | components["schemas"]["ControlNet_Diffusers_SDXL_Config"] | components["schemas"]["ControlNet_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_SD1_Config"] | components["schemas"]["LoRA_LyCORIS_SD2_Config"] | components["schemas"]["LoRA_LyCORIS_SDXL_Config"] | components["schemas"]["LoRA_LyCORIS_Flux2_Config"] | components["schemas"]["LoRA_LyCORIS_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_ZImage_Config"] | components["schemas"]["LoRA_LyCORIS_QwenImage_Config"] | components["schemas"]["LoRA_LyCORIS_Anima_Config"] | components["schemas"]["LoRA_OMI_SDXL_Config"] | components["schemas"]["LoRA_OMI_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_SD1_Config"] | components["schemas"]["LoRA_Diffusers_SD2_Config"] | components["schemas"]["LoRA_Diffusers_SDXL_Config"] | components["schemas"]["LoRA_Diffusers_Flux2_Config"] | components["schemas"]["LoRA_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_ZImage_Config"] | components["schemas"]["ControlLoRA_LyCORIS_FLUX_Config"] | components["schemas"]["T5Encoder_T5Encoder_Config"] | components["schemas"]["T5Encoder_BnBLLMint8_Config"] | components["schemas"]["Qwen3Encoder_Qwen3Encoder_Config"] | components["schemas"]["Qwen3Encoder_Checkpoint_Config"] | components["schemas"]["Qwen3Encoder_GGUF_Config"] | components["schemas"]["TI_File_SD1_Config"] | components["schemas"]["TI_File_SD2_Config"] | components["schemas"]["TI_File_SDXL_Config"] | components["schemas"]["TI_Folder_SD1_Config"] | components["schemas"]["TI_Folder_SD2_Config"] | components["schemas"]["TI_Folder_SDXL_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD1_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD2_Config"] | components["schemas"]["IPAdapter_InvokeAI_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD1_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD2_Config"] | components["schemas"]["IPAdapter_Checkpoint_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_FLUX_Config"] | components["schemas"]["T2IAdapter_Diffusers_SD1_Config"] | components["schemas"]["T2IAdapter_Diffusers_SDXL_Config"] | components["schemas"]["Spandrel_Checkpoint_Config"] | components["schemas"]["CLIPEmbed_Diffusers_G_Config"] | components["schemas"]["CLIPEmbed_Diffusers_L_Config"] | components["schemas"]["CLIPVision_Diffusers_Config"] | components["schemas"]["SigLIP_Diffusers_Config"] | components["schemas"]["FLUXRedux_Checkpoint_Config"] | components["schemas"]["LlavaOnevision_Diffusers_Config"] | components["schemas"]["Unknown_Config"];
+ "application/json": components["schemas"]["Main_Diffusers_SD1_Config"] | components["schemas"]["Main_Diffusers_SD2_Config"] | components["schemas"]["Main_Diffusers_SDXL_Config"] | components["schemas"]["Main_Diffusers_SDXLRefiner_Config"] | components["schemas"]["Main_Diffusers_SD3_Config"] | components["schemas"]["Main_Diffusers_FLUX_Config"] | components["schemas"]["Main_Diffusers_Flux2_Config"] | components["schemas"]["Main_Diffusers_CogView4_Config"] | components["schemas"]["Main_Diffusers_QwenImage_Config"] | components["schemas"]["Main_Diffusers_ZImage_Config"] | components["schemas"]["Main_Checkpoint_SD1_Config"] | components["schemas"]["Main_Checkpoint_SD2_Config"] | components["schemas"]["Main_Checkpoint_SDXL_Config"] | components["schemas"]["Main_Checkpoint_SDXLRefiner_Config"] | components["schemas"]["Main_Checkpoint_Flux2_Config"] | components["schemas"]["Main_Checkpoint_FLUX_Config"] | components["schemas"]["Main_Checkpoint_ZImage_Config"] | components["schemas"]["Main_Checkpoint_Anima_Config"] | components["schemas"]["Main_BnBNF4_FLUX_Config"] | components["schemas"]["Main_GGUF_Flux2_Config"] | components["schemas"]["Main_GGUF_FLUX_Config"] | components["schemas"]["Main_GGUF_QwenImage_Config"] | components["schemas"]["Main_GGUF_ZImage_Config"] | components["schemas"]["VAE_Checkpoint_SD1_Config"] | components["schemas"]["VAE_Checkpoint_SD2_Config"] | components["schemas"]["VAE_Checkpoint_SDXL_Config"] | components["schemas"]["VAE_Checkpoint_FLUX_Config"] | components["schemas"]["VAE_Checkpoint_Flux2_Config"] | components["schemas"]["VAE_Checkpoint_Anima_Config"] | components["schemas"]["VAE_Diffusers_SD1_Config"] | components["schemas"]["VAE_Diffusers_SDXL_Config"] | components["schemas"]["VAE_Diffusers_Flux2_Config"] | components["schemas"]["ControlNet_Checkpoint_SD1_Config"] | components["schemas"]["ControlNet_Checkpoint_SD2_Config"] | components["schemas"]["ControlNet_Checkpoint_SDXL_Config"] | components["schemas"]["ControlNet_Checkpoint_FLUX_Config"] | components["schemas"]["ControlNet_Checkpoint_ZImage_Config"] | components["schemas"]["ControlNet_Diffusers_SD1_Config"] | components["schemas"]["ControlNet_Diffusers_SD2_Config"] | components["schemas"]["ControlNet_Diffusers_SDXL_Config"] | components["schemas"]["ControlNet_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_SD1_Config"] | components["schemas"]["LoRA_LyCORIS_SD2_Config"] | components["schemas"]["LoRA_LyCORIS_SDXL_Config"] | components["schemas"]["LoRA_LyCORIS_Flux2_Config"] | components["schemas"]["LoRA_LyCORIS_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_ZImage_Config"] | components["schemas"]["LoRA_LyCORIS_QwenImage_Config"] | components["schemas"]["LoRA_LyCORIS_Anima_Config"] | components["schemas"]["LoRA_OMI_SDXL_Config"] | components["schemas"]["LoRA_OMI_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_SD1_Config"] | components["schemas"]["LoRA_Diffusers_SD2_Config"] | components["schemas"]["LoRA_Diffusers_SDXL_Config"] | components["schemas"]["LoRA_Diffusers_Flux2_Config"] | components["schemas"]["LoRA_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_ZImage_Config"] | components["schemas"]["ControlLoRA_LyCORIS_FLUX_Config"] | components["schemas"]["T5Encoder_T5Encoder_Config"] | components["schemas"]["T5Encoder_BnBLLMint8_Config"] | components["schemas"]["Qwen3Encoder_Qwen3Encoder_Config"] | components["schemas"]["Qwen3Encoder_Checkpoint_Config"] | components["schemas"]["Qwen3Encoder_GGUF_Config"] | components["schemas"]["TI_File_SD1_Config"] | components["schemas"]["TI_File_SD2_Config"] | components["schemas"]["TI_File_SDXL_Config"] | components["schemas"]["TI_Folder_SD1_Config"] | components["schemas"]["TI_Folder_SD2_Config"] | components["schemas"]["TI_Folder_SDXL_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD1_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD2_Config"] | components["schemas"]["IPAdapter_InvokeAI_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD1_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD2_Config"] | components["schemas"]["IPAdapter_Checkpoint_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_FLUX_Config"] | components["schemas"]["T2IAdapter_Diffusers_SD1_Config"] | components["schemas"]["T2IAdapter_Diffusers_SDXL_Config"] | components["schemas"]["Spandrel_Checkpoint_Config"] | components["schemas"]["CLIPEmbed_Diffusers_G_Config"] | components["schemas"]["CLIPEmbed_Diffusers_L_Config"] | components["schemas"]["CLIPVision_Diffusers_Config"] | components["schemas"]["SigLIP_Diffusers_Config"] | components["schemas"]["FLUXRedux_Checkpoint_Config"] | components["schemas"]["LlavaOnevision_Diffusers_Config"] | components["schemas"]["ExternalApiModelConfig"] | components["schemas"]["Unknown_Config"];
};
};
/** @description Bad request */
@@ -31175,7 +31781,7 @@ export interface operations {
* "repo_variant": "fp16",
* "upcast_attention": false
* } */
- "application/json": components["schemas"]["Main_Diffusers_SD1_Config"] | components["schemas"]["Main_Diffusers_SD2_Config"] | components["schemas"]["Main_Diffusers_SDXL_Config"] | components["schemas"]["Main_Diffusers_SDXLRefiner_Config"] | components["schemas"]["Main_Diffusers_SD3_Config"] | components["schemas"]["Main_Diffusers_FLUX_Config"] | components["schemas"]["Main_Diffusers_Flux2_Config"] | components["schemas"]["Main_Diffusers_CogView4_Config"] | components["schemas"]["Main_Diffusers_QwenImage_Config"] | components["schemas"]["Main_Diffusers_ZImage_Config"] | components["schemas"]["Main_Checkpoint_SD1_Config"] | components["schemas"]["Main_Checkpoint_SD2_Config"] | components["schemas"]["Main_Checkpoint_SDXL_Config"] | components["schemas"]["Main_Checkpoint_SDXLRefiner_Config"] | components["schemas"]["Main_Checkpoint_Flux2_Config"] | components["schemas"]["Main_Checkpoint_FLUX_Config"] | components["schemas"]["Main_Checkpoint_ZImage_Config"] | components["schemas"]["Main_Checkpoint_Anima_Config"] | components["schemas"]["Main_BnBNF4_FLUX_Config"] | components["schemas"]["Main_GGUF_Flux2_Config"] | components["schemas"]["Main_GGUF_FLUX_Config"] | components["schemas"]["Main_GGUF_QwenImage_Config"] | components["schemas"]["Main_GGUF_ZImage_Config"] | components["schemas"]["VAE_Checkpoint_SD1_Config"] | components["schemas"]["VAE_Checkpoint_SD2_Config"] | components["schemas"]["VAE_Checkpoint_SDXL_Config"] | components["schemas"]["VAE_Checkpoint_FLUX_Config"] | components["schemas"]["VAE_Checkpoint_Flux2_Config"] | components["schemas"]["VAE_Checkpoint_Anima_Config"] | components["schemas"]["VAE_Diffusers_SD1_Config"] | components["schemas"]["VAE_Diffusers_SDXL_Config"] | components["schemas"]["VAE_Diffusers_Flux2_Config"] | components["schemas"]["ControlNet_Checkpoint_SD1_Config"] | components["schemas"]["ControlNet_Checkpoint_SD2_Config"] | components["schemas"]["ControlNet_Checkpoint_SDXL_Config"] | components["schemas"]["ControlNet_Checkpoint_FLUX_Config"] | components["schemas"]["ControlNet_Checkpoint_ZImage_Config"] | components["schemas"]["ControlNet_Diffusers_SD1_Config"] | components["schemas"]["ControlNet_Diffusers_SD2_Config"] | components["schemas"]["ControlNet_Diffusers_SDXL_Config"] | components["schemas"]["ControlNet_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_SD1_Config"] | components["schemas"]["LoRA_LyCORIS_SD2_Config"] | components["schemas"]["LoRA_LyCORIS_SDXL_Config"] | components["schemas"]["LoRA_LyCORIS_Flux2_Config"] | components["schemas"]["LoRA_LyCORIS_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_ZImage_Config"] | components["schemas"]["LoRA_LyCORIS_QwenImage_Config"] | components["schemas"]["LoRA_LyCORIS_Anima_Config"] | components["schemas"]["LoRA_OMI_SDXL_Config"] | components["schemas"]["LoRA_OMI_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_SD1_Config"] | components["schemas"]["LoRA_Diffusers_SD2_Config"] | components["schemas"]["LoRA_Diffusers_SDXL_Config"] | components["schemas"]["LoRA_Diffusers_Flux2_Config"] | components["schemas"]["LoRA_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_ZImage_Config"] | components["schemas"]["ControlLoRA_LyCORIS_FLUX_Config"] | components["schemas"]["T5Encoder_T5Encoder_Config"] | components["schemas"]["T5Encoder_BnBLLMint8_Config"] | components["schemas"]["Qwen3Encoder_Qwen3Encoder_Config"] | components["schemas"]["Qwen3Encoder_Checkpoint_Config"] | components["schemas"]["Qwen3Encoder_GGUF_Config"] | components["schemas"]["TI_File_SD1_Config"] | components["schemas"]["TI_File_SD2_Config"] | components["schemas"]["TI_File_SDXL_Config"] | components["schemas"]["TI_Folder_SD1_Config"] | components["schemas"]["TI_Folder_SD2_Config"] | components["schemas"]["TI_Folder_SDXL_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD1_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD2_Config"] | components["schemas"]["IPAdapter_InvokeAI_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD1_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD2_Config"] | components["schemas"]["IPAdapter_Checkpoint_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_FLUX_Config"] | components["schemas"]["T2IAdapter_Diffusers_SD1_Config"] | components["schemas"]["T2IAdapter_Diffusers_SDXL_Config"] | components["schemas"]["Spandrel_Checkpoint_Config"] | components["schemas"]["CLIPEmbed_Diffusers_G_Config"] | components["schemas"]["CLIPEmbed_Diffusers_L_Config"] | components["schemas"]["CLIPVision_Diffusers_Config"] | components["schemas"]["SigLIP_Diffusers_Config"] | components["schemas"]["FLUXRedux_Checkpoint_Config"] | components["schemas"]["LlavaOnevision_Diffusers_Config"] | components["schemas"]["Unknown_Config"];
+ "application/json": components["schemas"]["Main_Diffusers_SD1_Config"] | components["schemas"]["Main_Diffusers_SD2_Config"] | components["schemas"]["Main_Diffusers_SDXL_Config"] | components["schemas"]["Main_Diffusers_SDXLRefiner_Config"] | components["schemas"]["Main_Diffusers_SD3_Config"] | components["schemas"]["Main_Diffusers_FLUX_Config"] | components["schemas"]["Main_Diffusers_Flux2_Config"] | components["schemas"]["Main_Diffusers_CogView4_Config"] | components["schemas"]["Main_Diffusers_QwenImage_Config"] | components["schemas"]["Main_Diffusers_ZImage_Config"] | components["schemas"]["Main_Checkpoint_SD1_Config"] | components["schemas"]["Main_Checkpoint_SD2_Config"] | components["schemas"]["Main_Checkpoint_SDXL_Config"] | components["schemas"]["Main_Checkpoint_SDXLRefiner_Config"] | components["schemas"]["Main_Checkpoint_Flux2_Config"] | components["schemas"]["Main_Checkpoint_FLUX_Config"] | components["schemas"]["Main_Checkpoint_ZImage_Config"] | components["schemas"]["Main_Checkpoint_Anima_Config"] | components["schemas"]["Main_BnBNF4_FLUX_Config"] | components["schemas"]["Main_GGUF_Flux2_Config"] | components["schemas"]["Main_GGUF_FLUX_Config"] | components["schemas"]["Main_GGUF_QwenImage_Config"] | components["schemas"]["Main_GGUF_ZImage_Config"] | components["schemas"]["VAE_Checkpoint_SD1_Config"] | components["schemas"]["VAE_Checkpoint_SD2_Config"] | components["schemas"]["VAE_Checkpoint_SDXL_Config"] | components["schemas"]["VAE_Checkpoint_FLUX_Config"] | components["schemas"]["VAE_Checkpoint_Flux2_Config"] | components["schemas"]["VAE_Checkpoint_Anima_Config"] | components["schemas"]["VAE_Diffusers_SD1_Config"] | components["schemas"]["VAE_Diffusers_SDXL_Config"] | components["schemas"]["VAE_Diffusers_Flux2_Config"] | components["schemas"]["ControlNet_Checkpoint_SD1_Config"] | components["schemas"]["ControlNet_Checkpoint_SD2_Config"] | components["schemas"]["ControlNet_Checkpoint_SDXL_Config"] | components["schemas"]["ControlNet_Checkpoint_FLUX_Config"] | components["schemas"]["ControlNet_Checkpoint_ZImage_Config"] | components["schemas"]["ControlNet_Diffusers_SD1_Config"] | components["schemas"]["ControlNet_Diffusers_SD2_Config"] | components["schemas"]["ControlNet_Diffusers_SDXL_Config"] | components["schemas"]["ControlNet_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_SD1_Config"] | components["schemas"]["LoRA_LyCORIS_SD2_Config"] | components["schemas"]["LoRA_LyCORIS_SDXL_Config"] | components["schemas"]["LoRA_LyCORIS_Flux2_Config"] | components["schemas"]["LoRA_LyCORIS_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_ZImage_Config"] | components["schemas"]["LoRA_LyCORIS_QwenImage_Config"] | components["schemas"]["LoRA_LyCORIS_Anima_Config"] | components["schemas"]["LoRA_OMI_SDXL_Config"] | components["schemas"]["LoRA_OMI_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_SD1_Config"] | components["schemas"]["LoRA_Diffusers_SD2_Config"] | components["schemas"]["LoRA_Diffusers_SDXL_Config"] | components["schemas"]["LoRA_Diffusers_Flux2_Config"] | components["schemas"]["LoRA_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_ZImage_Config"] | components["schemas"]["ControlLoRA_LyCORIS_FLUX_Config"] | components["schemas"]["T5Encoder_T5Encoder_Config"] | components["schemas"]["T5Encoder_BnBLLMint8_Config"] | components["schemas"]["Qwen3Encoder_Qwen3Encoder_Config"] | components["schemas"]["Qwen3Encoder_Checkpoint_Config"] | components["schemas"]["Qwen3Encoder_GGUF_Config"] | components["schemas"]["TI_File_SD1_Config"] | components["schemas"]["TI_File_SD2_Config"] | components["schemas"]["TI_File_SDXL_Config"] | components["schemas"]["TI_Folder_SD1_Config"] | components["schemas"]["TI_Folder_SD2_Config"] | components["schemas"]["TI_Folder_SDXL_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD1_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD2_Config"] | components["schemas"]["IPAdapter_InvokeAI_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD1_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD2_Config"] | components["schemas"]["IPAdapter_Checkpoint_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_FLUX_Config"] | components["schemas"]["T2IAdapter_Diffusers_SD1_Config"] | components["schemas"]["T2IAdapter_Diffusers_SDXL_Config"] | components["schemas"]["Spandrel_Checkpoint_Config"] | components["schemas"]["CLIPEmbed_Diffusers_G_Config"] | components["schemas"]["CLIPEmbed_Diffusers_L_Config"] | components["schemas"]["CLIPVision_Diffusers_Config"] | components["schemas"]["SigLIP_Diffusers_Config"] | components["schemas"]["FLUXRedux_Checkpoint_Config"] | components["schemas"]["LlavaOnevision_Diffusers_Config"] | components["schemas"]["ExternalApiModelConfig"] | components["schemas"]["Unknown_Config"];
};
};
/** @description Bad request */
@@ -31246,7 +31852,7 @@ export interface operations {
* "repo_variant": "fp16",
* "upcast_attention": false
* } */
- "application/json": components["schemas"]["Main_Diffusers_SD1_Config"] | components["schemas"]["Main_Diffusers_SD2_Config"] | components["schemas"]["Main_Diffusers_SDXL_Config"] | components["schemas"]["Main_Diffusers_SDXLRefiner_Config"] | components["schemas"]["Main_Diffusers_SD3_Config"] | components["schemas"]["Main_Diffusers_FLUX_Config"] | components["schemas"]["Main_Diffusers_Flux2_Config"] | components["schemas"]["Main_Diffusers_CogView4_Config"] | components["schemas"]["Main_Diffusers_QwenImage_Config"] | components["schemas"]["Main_Diffusers_ZImage_Config"] | components["schemas"]["Main_Checkpoint_SD1_Config"] | components["schemas"]["Main_Checkpoint_SD2_Config"] | components["schemas"]["Main_Checkpoint_SDXL_Config"] | components["schemas"]["Main_Checkpoint_SDXLRefiner_Config"] | components["schemas"]["Main_Checkpoint_Flux2_Config"] | components["schemas"]["Main_Checkpoint_FLUX_Config"] | components["schemas"]["Main_Checkpoint_ZImage_Config"] | components["schemas"]["Main_Checkpoint_Anima_Config"] | components["schemas"]["Main_BnBNF4_FLUX_Config"] | components["schemas"]["Main_GGUF_Flux2_Config"] | components["schemas"]["Main_GGUF_FLUX_Config"] | components["schemas"]["Main_GGUF_QwenImage_Config"] | components["schemas"]["Main_GGUF_ZImage_Config"] | components["schemas"]["VAE_Checkpoint_SD1_Config"] | components["schemas"]["VAE_Checkpoint_SD2_Config"] | components["schemas"]["VAE_Checkpoint_SDXL_Config"] | components["schemas"]["VAE_Checkpoint_FLUX_Config"] | components["schemas"]["VAE_Checkpoint_Flux2_Config"] | components["schemas"]["VAE_Checkpoint_Anima_Config"] | components["schemas"]["VAE_Diffusers_SD1_Config"] | components["schemas"]["VAE_Diffusers_SDXL_Config"] | components["schemas"]["VAE_Diffusers_Flux2_Config"] | components["schemas"]["ControlNet_Checkpoint_SD1_Config"] | components["schemas"]["ControlNet_Checkpoint_SD2_Config"] | components["schemas"]["ControlNet_Checkpoint_SDXL_Config"] | components["schemas"]["ControlNet_Checkpoint_FLUX_Config"] | components["schemas"]["ControlNet_Checkpoint_ZImage_Config"] | components["schemas"]["ControlNet_Diffusers_SD1_Config"] | components["schemas"]["ControlNet_Diffusers_SD2_Config"] | components["schemas"]["ControlNet_Diffusers_SDXL_Config"] | components["schemas"]["ControlNet_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_SD1_Config"] | components["schemas"]["LoRA_LyCORIS_SD2_Config"] | components["schemas"]["LoRA_LyCORIS_SDXL_Config"] | components["schemas"]["LoRA_LyCORIS_Flux2_Config"] | components["schemas"]["LoRA_LyCORIS_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_ZImage_Config"] | components["schemas"]["LoRA_LyCORIS_QwenImage_Config"] | components["schemas"]["LoRA_LyCORIS_Anima_Config"] | components["schemas"]["LoRA_OMI_SDXL_Config"] | components["schemas"]["LoRA_OMI_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_SD1_Config"] | components["schemas"]["LoRA_Diffusers_SD2_Config"] | components["schemas"]["LoRA_Diffusers_SDXL_Config"] | components["schemas"]["LoRA_Diffusers_Flux2_Config"] | components["schemas"]["LoRA_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_ZImage_Config"] | components["schemas"]["ControlLoRA_LyCORIS_FLUX_Config"] | components["schemas"]["T5Encoder_T5Encoder_Config"] | components["schemas"]["T5Encoder_BnBLLMint8_Config"] | components["schemas"]["Qwen3Encoder_Qwen3Encoder_Config"] | components["schemas"]["Qwen3Encoder_Checkpoint_Config"] | components["schemas"]["Qwen3Encoder_GGUF_Config"] | components["schemas"]["TI_File_SD1_Config"] | components["schemas"]["TI_File_SD2_Config"] | components["schemas"]["TI_File_SDXL_Config"] | components["schemas"]["TI_Folder_SD1_Config"] | components["schemas"]["TI_Folder_SD2_Config"] | components["schemas"]["TI_Folder_SDXL_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD1_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD2_Config"] | components["schemas"]["IPAdapter_InvokeAI_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD1_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD2_Config"] | components["schemas"]["IPAdapter_Checkpoint_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_FLUX_Config"] | components["schemas"]["T2IAdapter_Diffusers_SD1_Config"] | components["schemas"]["T2IAdapter_Diffusers_SDXL_Config"] | components["schemas"]["Spandrel_Checkpoint_Config"] | components["schemas"]["CLIPEmbed_Diffusers_G_Config"] | components["schemas"]["CLIPEmbed_Diffusers_L_Config"] | components["schemas"]["CLIPVision_Diffusers_Config"] | components["schemas"]["SigLIP_Diffusers_Config"] | components["schemas"]["FLUXRedux_Checkpoint_Config"] | components["schemas"]["LlavaOnevision_Diffusers_Config"] | components["schemas"]["Unknown_Config"];
+ "application/json": components["schemas"]["Main_Diffusers_SD1_Config"] | components["schemas"]["Main_Diffusers_SD2_Config"] | components["schemas"]["Main_Diffusers_SDXL_Config"] | components["schemas"]["Main_Diffusers_SDXLRefiner_Config"] | components["schemas"]["Main_Diffusers_SD3_Config"] | components["schemas"]["Main_Diffusers_FLUX_Config"] | components["schemas"]["Main_Diffusers_Flux2_Config"] | components["schemas"]["Main_Diffusers_CogView4_Config"] | components["schemas"]["Main_Diffusers_QwenImage_Config"] | components["schemas"]["Main_Diffusers_ZImage_Config"] | components["schemas"]["Main_Checkpoint_SD1_Config"] | components["schemas"]["Main_Checkpoint_SD2_Config"] | components["schemas"]["Main_Checkpoint_SDXL_Config"] | components["schemas"]["Main_Checkpoint_SDXLRefiner_Config"] | components["schemas"]["Main_Checkpoint_Flux2_Config"] | components["schemas"]["Main_Checkpoint_FLUX_Config"] | components["schemas"]["Main_Checkpoint_ZImage_Config"] | components["schemas"]["Main_Checkpoint_Anima_Config"] | components["schemas"]["Main_BnBNF4_FLUX_Config"] | components["schemas"]["Main_GGUF_Flux2_Config"] | components["schemas"]["Main_GGUF_FLUX_Config"] | components["schemas"]["Main_GGUF_QwenImage_Config"] | components["schemas"]["Main_GGUF_ZImage_Config"] | components["schemas"]["VAE_Checkpoint_SD1_Config"] | components["schemas"]["VAE_Checkpoint_SD2_Config"] | components["schemas"]["VAE_Checkpoint_SDXL_Config"] | components["schemas"]["VAE_Checkpoint_FLUX_Config"] | components["schemas"]["VAE_Checkpoint_Flux2_Config"] | components["schemas"]["VAE_Checkpoint_Anima_Config"] | components["schemas"]["VAE_Diffusers_SD1_Config"] | components["schemas"]["VAE_Diffusers_SDXL_Config"] | components["schemas"]["VAE_Diffusers_Flux2_Config"] | components["schemas"]["ControlNet_Checkpoint_SD1_Config"] | components["schemas"]["ControlNet_Checkpoint_SD2_Config"] | components["schemas"]["ControlNet_Checkpoint_SDXL_Config"] | components["schemas"]["ControlNet_Checkpoint_FLUX_Config"] | components["schemas"]["ControlNet_Checkpoint_ZImage_Config"] | components["schemas"]["ControlNet_Diffusers_SD1_Config"] | components["schemas"]["ControlNet_Diffusers_SD2_Config"] | components["schemas"]["ControlNet_Diffusers_SDXL_Config"] | components["schemas"]["ControlNet_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_SD1_Config"] | components["schemas"]["LoRA_LyCORIS_SD2_Config"] | components["schemas"]["LoRA_LyCORIS_SDXL_Config"] | components["schemas"]["LoRA_LyCORIS_Flux2_Config"] | components["schemas"]["LoRA_LyCORIS_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_ZImage_Config"] | components["schemas"]["LoRA_LyCORIS_QwenImage_Config"] | components["schemas"]["LoRA_LyCORIS_Anima_Config"] | components["schemas"]["LoRA_OMI_SDXL_Config"] | components["schemas"]["LoRA_OMI_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_SD1_Config"] | components["schemas"]["LoRA_Diffusers_SD2_Config"] | components["schemas"]["LoRA_Diffusers_SDXL_Config"] | components["schemas"]["LoRA_Diffusers_Flux2_Config"] | components["schemas"]["LoRA_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_ZImage_Config"] | components["schemas"]["ControlLoRA_LyCORIS_FLUX_Config"] | components["schemas"]["T5Encoder_T5Encoder_Config"] | components["schemas"]["T5Encoder_BnBLLMint8_Config"] | components["schemas"]["Qwen3Encoder_Qwen3Encoder_Config"] | components["schemas"]["Qwen3Encoder_Checkpoint_Config"] | components["schemas"]["Qwen3Encoder_GGUF_Config"] | components["schemas"]["TI_File_SD1_Config"] | components["schemas"]["TI_File_SD2_Config"] | components["schemas"]["TI_File_SDXL_Config"] | components["schemas"]["TI_Folder_SD1_Config"] | components["schemas"]["TI_Folder_SD2_Config"] | components["schemas"]["TI_Folder_SDXL_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD1_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD2_Config"] | components["schemas"]["IPAdapter_InvokeAI_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD1_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD2_Config"] | components["schemas"]["IPAdapter_Checkpoint_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_FLUX_Config"] | components["schemas"]["T2IAdapter_Diffusers_SD1_Config"] | components["schemas"]["T2IAdapter_Diffusers_SDXL_Config"] | components["schemas"]["Spandrel_Checkpoint_Config"] | components["schemas"]["CLIPEmbed_Diffusers_G_Config"] | components["schemas"]["CLIPEmbed_Diffusers_L_Config"] | components["schemas"]["CLIPVision_Diffusers_Config"] | components["schemas"]["SigLIP_Diffusers_Config"] | components["schemas"]["FLUXRedux_Checkpoint_Config"] | components["schemas"]["LlavaOnevision_Diffusers_Config"] | components["schemas"]["ExternalApiModelConfig"] | components["schemas"]["Unknown_Config"];
};
};
/** @description Bad request */
@@ -31979,7 +32585,7 @@ export interface operations {
* "repo_variant": "fp16",
* "upcast_attention": false
* } */
- "application/json": components["schemas"]["Main_Diffusers_SD1_Config"] | components["schemas"]["Main_Diffusers_SD2_Config"] | components["schemas"]["Main_Diffusers_SDXL_Config"] | components["schemas"]["Main_Diffusers_SDXLRefiner_Config"] | components["schemas"]["Main_Diffusers_SD3_Config"] | components["schemas"]["Main_Diffusers_FLUX_Config"] | components["schemas"]["Main_Diffusers_Flux2_Config"] | components["schemas"]["Main_Diffusers_CogView4_Config"] | components["schemas"]["Main_Diffusers_QwenImage_Config"] | components["schemas"]["Main_Diffusers_ZImage_Config"] | components["schemas"]["Main_Checkpoint_SD1_Config"] | components["schemas"]["Main_Checkpoint_SD2_Config"] | components["schemas"]["Main_Checkpoint_SDXL_Config"] | components["schemas"]["Main_Checkpoint_SDXLRefiner_Config"] | components["schemas"]["Main_Checkpoint_Flux2_Config"] | components["schemas"]["Main_Checkpoint_FLUX_Config"] | components["schemas"]["Main_Checkpoint_ZImage_Config"] | components["schemas"]["Main_Checkpoint_Anima_Config"] | components["schemas"]["Main_BnBNF4_FLUX_Config"] | components["schemas"]["Main_GGUF_Flux2_Config"] | components["schemas"]["Main_GGUF_FLUX_Config"] | components["schemas"]["Main_GGUF_QwenImage_Config"] | components["schemas"]["Main_GGUF_ZImage_Config"] | components["schemas"]["VAE_Checkpoint_SD1_Config"] | components["schemas"]["VAE_Checkpoint_SD2_Config"] | components["schemas"]["VAE_Checkpoint_SDXL_Config"] | components["schemas"]["VAE_Checkpoint_FLUX_Config"] | components["schemas"]["VAE_Checkpoint_Flux2_Config"] | components["schemas"]["VAE_Checkpoint_Anima_Config"] | components["schemas"]["VAE_Diffusers_SD1_Config"] | components["schemas"]["VAE_Diffusers_SDXL_Config"] | components["schemas"]["VAE_Diffusers_Flux2_Config"] | components["schemas"]["ControlNet_Checkpoint_SD1_Config"] | components["schemas"]["ControlNet_Checkpoint_SD2_Config"] | components["schemas"]["ControlNet_Checkpoint_SDXL_Config"] | components["schemas"]["ControlNet_Checkpoint_FLUX_Config"] | components["schemas"]["ControlNet_Checkpoint_ZImage_Config"] | components["schemas"]["ControlNet_Diffusers_SD1_Config"] | components["schemas"]["ControlNet_Diffusers_SD2_Config"] | components["schemas"]["ControlNet_Diffusers_SDXL_Config"] | components["schemas"]["ControlNet_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_SD1_Config"] | components["schemas"]["LoRA_LyCORIS_SD2_Config"] | components["schemas"]["LoRA_LyCORIS_SDXL_Config"] | components["schemas"]["LoRA_LyCORIS_Flux2_Config"] | components["schemas"]["LoRA_LyCORIS_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_ZImage_Config"] | components["schemas"]["LoRA_LyCORIS_QwenImage_Config"] | components["schemas"]["LoRA_LyCORIS_Anima_Config"] | components["schemas"]["LoRA_OMI_SDXL_Config"] | components["schemas"]["LoRA_OMI_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_SD1_Config"] | components["schemas"]["LoRA_Diffusers_SD2_Config"] | components["schemas"]["LoRA_Diffusers_SDXL_Config"] | components["schemas"]["LoRA_Diffusers_Flux2_Config"] | components["schemas"]["LoRA_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_ZImage_Config"] | components["schemas"]["ControlLoRA_LyCORIS_FLUX_Config"] | components["schemas"]["T5Encoder_T5Encoder_Config"] | components["schemas"]["T5Encoder_BnBLLMint8_Config"] | components["schemas"]["Qwen3Encoder_Qwen3Encoder_Config"] | components["schemas"]["Qwen3Encoder_Checkpoint_Config"] | components["schemas"]["Qwen3Encoder_GGUF_Config"] | components["schemas"]["TI_File_SD1_Config"] | components["schemas"]["TI_File_SD2_Config"] | components["schemas"]["TI_File_SDXL_Config"] | components["schemas"]["TI_Folder_SD1_Config"] | components["schemas"]["TI_Folder_SD2_Config"] | components["schemas"]["TI_Folder_SDXL_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD1_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD2_Config"] | components["schemas"]["IPAdapter_InvokeAI_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD1_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD2_Config"] | components["schemas"]["IPAdapter_Checkpoint_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_FLUX_Config"] | components["schemas"]["T2IAdapter_Diffusers_SD1_Config"] | components["schemas"]["T2IAdapter_Diffusers_SDXL_Config"] | components["schemas"]["Spandrel_Checkpoint_Config"] | components["schemas"]["CLIPEmbed_Diffusers_G_Config"] | components["schemas"]["CLIPEmbed_Diffusers_L_Config"] | components["schemas"]["CLIPVision_Diffusers_Config"] | components["schemas"]["SigLIP_Diffusers_Config"] | components["schemas"]["FLUXRedux_Checkpoint_Config"] | components["schemas"]["LlavaOnevision_Diffusers_Config"] | components["schemas"]["Unknown_Config"];
+ "application/json": components["schemas"]["Main_Diffusers_SD1_Config"] | components["schemas"]["Main_Diffusers_SD2_Config"] | components["schemas"]["Main_Diffusers_SDXL_Config"] | components["schemas"]["Main_Diffusers_SDXLRefiner_Config"] | components["schemas"]["Main_Diffusers_SD3_Config"] | components["schemas"]["Main_Diffusers_FLUX_Config"] | components["schemas"]["Main_Diffusers_Flux2_Config"] | components["schemas"]["Main_Diffusers_CogView4_Config"] | components["schemas"]["Main_Diffusers_QwenImage_Config"] | components["schemas"]["Main_Diffusers_ZImage_Config"] | components["schemas"]["Main_Checkpoint_SD1_Config"] | components["schemas"]["Main_Checkpoint_SD2_Config"] | components["schemas"]["Main_Checkpoint_SDXL_Config"] | components["schemas"]["Main_Checkpoint_SDXLRefiner_Config"] | components["schemas"]["Main_Checkpoint_Flux2_Config"] | components["schemas"]["Main_Checkpoint_FLUX_Config"] | components["schemas"]["Main_Checkpoint_ZImage_Config"] | components["schemas"]["Main_Checkpoint_Anima_Config"] | components["schemas"]["Main_BnBNF4_FLUX_Config"] | components["schemas"]["Main_GGUF_Flux2_Config"] | components["schemas"]["Main_GGUF_FLUX_Config"] | components["schemas"]["Main_GGUF_QwenImage_Config"] | components["schemas"]["Main_GGUF_ZImage_Config"] | components["schemas"]["VAE_Checkpoint_SD1_Config"] | components["schemas"]["VAE_Checkpoint_SD2_Config"] | components["schemas"]["VAE_Checkpoint_SDXL_Config"] | components["schemas"]["VAE_Checkpoint_FLUX_Config"] | components["schemas"]["VAE_Checkpoint_Flux2_Config"] | components["schemas"]["VAE_Checkpoint_Anima_Config"] | components["schemas"]["VAE_Diffusers_SD1_Config"] | components["schemas"]["VAE_Diffusers_SDXL_Config"] | components["schemas"]["VAE_Diffusers_Flux2_Config"] | components["schemas"]["ControlNet_Checkpoint_SD1_Config"] | components["schemas"]["ControlNet_Checkpoint_SD2_Config"] | components["schemas"]["ControlNet_Checkpoint_SDXL_Config"] | components["schemas"]["ControlNet_Checkpoint_FLUX_Config"] | components["schemas"]["ControlNet_Checkpoint_ZImage_Config"] | components["schemas"]["ControlNet_Diffusers_SD1_Config"] | components["schemas"]["ControlNet_Diffusers_SD2_Config"] | components["schemas"]["ControlNet_Diffusers_SDXL_Config"] | components["schemas"]["ControlNet_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_SD1_Config"] | components["schemas"]["LoRA_LyCORIS_SD2_Config"] | components["schemas"]["LoRA_LyCORIS_SDXL_Config"] | components["schemas"]["LoRA_LyCORIS_Flux2_Config"] | components["schemas"]["LoRA_LyCORIS_FLUX_Config"] | components["schemas"]["LoRA_LyCORIS_ZImage_Config"] | components["schemas"]["LoRA_LyCORIS_QwenImage_Config"] | components["schemas"]["LoRA_LyCORIS_Anima_Config"] | components["schemas"]["LoRA_OMI_SDXL_Config"] | components["schemas"]["LoRA_OMI_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_SD1_Config"] | components["schemas"]["LoRA_Diffusers_SD2_Config"] | components["schemas"]["LoRA_Diffusers_SDXL_Config"] | components["schemas"]["LoRA_Diffusers_Flux2_Config"] | components["schemas"]["LoRA_Diffusers_FLUX_Config"] | components["schemas"]["LoRA_Diffusers_ZImage_Config"] | components["schemas"]["ControlLoRA_LyCORIS_FLUX_Config"] | components["schemas"]["T5Encoder_T5Encoder_Config"] | components["schemas"]["T5Encoder_BnBLLMint8_Config"] | components["schemas"]["Qwen3Encoder_Qwen3Encoder_Config"] | components["schemas"]["Qwen3Encoder_Checkpoint_Config"] | components["schemas"]["Qwen3Encoder_GGUF_Config"] | components["schemas"]["TI_File_SD1_Config"] | components["schemas"]["TI_File_SD2_Config"] | components["schemas"]["TI_File_SDXL_Config"] | components["schemas"]["TI_Folder_SD1_Config"] | components["schemas"]["TI_Folder_SD2_Config"] | components["schemas"]["TI_Folder_SDXL_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD1_Config"] | components["schemas"]["IPAdapter_InvokeAI_SD2_Config"] | components["schemas"]["IPAdapter_InvokeAI_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD1_Config"] | components["schemas"]["IPAdapter_Checkpoint_SD2_Config"] | components["schemas"]["IPAdapter_Checkpoint_SDXL_Config"] | components["schemas"]["IPAdapter_Checkpoint_FLUX_Config"] | components["schemas"]["T2IAdapter_Diffusers_SD1_Config"] | components["schemas"]["T2IAdapter_Diffusers_SDXL_Config"] | components["schemas"]["Spandrel_Checkpoint_Config"] | components["schemas"]["CLIPEmbed_Diffusers_G_Config"] | components["schemas"]["CLIPEmbed_Diffusers_L_Config"] | components["schemas"]["CLIPVision_Diffusers_Config"] | components["schemas"]["SigLIP_Diffusers_Config"] | components["schemas"]["FLUXRedux_Checkpoint_Config"] | components["schemas"]["LlavaOnevision_Diffusers_Config"] | components["schemas"]["ExternalApiModelConfig"] | components["schemas"]["Unknown_Config"];
};
};
/** @description Bad request */
@@ -33802,6 +34408,114 @@ export interface operations {
};
};
};
+ get_external_provider_statuses: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description Successful Response */
+ 200: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["ExternalProviderStatusModel"][];
+ };
+ };
+ };
+ };
+ get_external_provider_configs: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description Successful Response */
+ 200: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["ExternalProviderConfigModel"][];
+ };
+ };
+ };
+ };
+ set_external_provider_config: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path: {
+ /** @description The external provider identifier */
+ provider_id: string;
+ };
+ cookie?: never;
+ };
+ requestBody: {
+ content: {
+ "application/json": components["schemas"]["ExternalProviderConfigUpdate"];
+ };
+ };
+ responses: {
+ /** @description Successful Response */
+ 200: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["ExternalProviderConfigModel"];
+ };
+ };
+ /** @description Validation Error */
+ 422: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["HTTPValidationError"];
+ };
+ };
+ };
+ };
+ reset_external_provider_config: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path: {
+ /** @description The external provider identifier */
+ provider_id: string;
+ };
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description Successful Response */
+ 200: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["ExternalProviderConfigModel"];
+ };
+ };
+ /** @description Validation Error */
+ 422: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["HTTPValidationError"];
+ };
+ };
+ };
+ };
get_log_level: {
parameters: {
query?: never;
diff --git a/invokeai/frontend/web/src/services/api/types.ts b/invokeai/frontend/web/src/services/api/types.ts
index f4561cad97..3624d7ef6a 100644
--- a/invokeai/frontend/web/src/services/api/types.ts
+++ b/invokeai/frontend/web/src/services/api/types.ts
@@ -43,6 +43,22 @@ export type InvocationJSONSchemaExtra = S['UIConfigBase'];
// App Info
export type AppVersion = S['AppVersion'];
+export type ExternalProviderStatus = {
+ provider_id: string;
+ configured: boolean;
+ message?: string | null;
+};
+export type ExternalProviderConfig = {
+ provider_id: string;
+ api_key_configured: boolean;
+ base_url?: string | null;
+ message?: string | null;
+};
+export type ExternalProviderConfigUpdate = {
+ api_key?: string;
+ base_url?: string | null;
+};
+export type UpdateModelBody = paths['/api/v2/models/i/{key}']['patch']['requestBody']['content']['application/json'];
const zResourceOrigin = z.enum(['internal', 'external']);
type ResourceOrigin = z.infer<typeof zResourceOrigin>;
@@ -77,39 +93,128 @@ export type BoardDTO = S['BoardDTO'];
export type OffsetPaginatedResults_ImageDTO_ = S['OffsetPaginatedResults_ImageDTO_'];
// Model Configs
-export type AnyModelConfig = S['AnyModelConfig'];
-export type MainModelConfig = Extract<S['AnyModelConfig'], { type: 'main' }>;
-type FLUXModelConfig = Extract<S['AnyModelConfig'], { type: 'main'; base: 'flux' }>;
-type FLUX2ModelConfig = Extract<S['AnyModelConfig'], { type: 'main'; base: 'flux2' }>;
+type InternalAnyModelConfig = S['AnyModelConfig'];
+export type MainModelConfig = Extract<InternalAnyModelConfig, { type: 'main' }>;
+type FLUXModelConfig = Extract<InternalAnyModelConfig, { type: 'main'; base: 'flux' }>;
+type FLUX2ModelConfig = Extract<InternalAnyModelConfig, { type: 'main'; base: 'flux2' }>;
export type AnyFLUXModelConfig = FLUXModelConfig | FLUX2ModelConfig;
-export type ControlLoRAModelConfig = Extract<S['AnyModelConfig'], { type: 'control_lora' }>;
-export type LoRAModelConfig = Extract<S['AnyModelConfig'], { type: 'lora' }>;
-export type VAEModelConfig = Extract<S['AnyModelConfig'], { type: 'vae' }>;
-export type ControlNetModelConfig = Extract<S['AnyModelConfig'], { type: 'controlnet' }>;
-export type IPAdapterModelConfig = Extract<S['AnyModelConfig'], { type: 'ip_adapter' }>;
-export type T2IAdapterModelConfig = Extract<S['AnyModelConfig'], { type: 't2i_adapter' }>;
-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' }>;
-export type LlavaOnevisionModelConfig = Extract<S['AnyModelConfig'], { type: 'llava_onevision' }>;
-export type T5EncoderModelConfig = Extract<S['AnyModelConfig'], { type: 't5_encoder' }>;
+export type ControlLoRAModelConfig = Extract<InternalAnyModelConfig, { type: 'control_lora' }>;
+export type LoRAModelConfig = Extract<InternalAnyModelConfig, { type: 'lora' }>;
+export type VAEModelConfig = Extract<InternalAnyModelConfig, { type: 'vae' }>;
+export type ControlNetModelConfig = Extract<InternalAnyModelConfig, { type: 'controlnet' }>;
+export type IPAdapterModelConfig = Extract<InternalAnyModelConfig, { type: 'ip_adapter' }>;
+export type T2IAdapterModelConfig = Extract<InternalAnyModelConfig, { type: 't2i_adapter' }>;
+export type CLIPLEmbedModelConfig = Extract<InternalAnyModelConfig, { type: 'clip_embed'; variant: 'large' }>;
+export type CLIPGEmbedModelConfig = Extract<InternalAnyModelConfig, { type: 'clip_embed'; variant: 'gigantic' }>;
+export type CLIPEmbedModelConfig = Extract<InternalAnyModelConfig, { type: 'clip_embed' }>;
+export type LlavaOnevisionModelConfig = Extract<InternalAnyModelConfig, { type: 'llava_onevision' }>;
+export type T5EncoderModelConfig = Extract<InternalAnyModelConfig, { type: 't5_encoder' }>;
export type T5EncoderBnbQuantizedLlmInt8bModelConfig = Extract<
- S['AnyModelConfig'],
+ InternalAnyModelConfig,
{ type: 't5_encoder'; format: 'bnb_quantized_int8b' }
>;
-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' }>;
-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' }>;
+export type Qwen3EncoderModelConfig = Extract<InternalAnyModelConfig, { type: 'qwen3_encoder' }>;
+export type SpandrelImageToImageModelConfig = Extract<InternalAnyModelConfig, { type: 'spandrel_image_to_image' }>;
+export type CheckpointModelConfig = Extract<InternalAnyModelConfig, { type: 'main'; format: 'checkpoint' }>;
+export type CLIPVisionModelConfig = Extract<InternalAnyModelConfig, { type: 'clip_vision' }>;
+export type SigLIPModelConfig = Extract<InternalAnyModelConfig, { type: 'siglip' }>;
+export type FLUXReduxModelConfig = Extract<InternalAnyModelConfig, { type: 'flux_redux' }>;
+type ApiModelConfig = Extract<InternalAnyModelConfig, { format: 'api' }>;
+type UnknownModelConfig = Extract<InternalAnyModelConfig, { type: 'unknown' }>;
export type FLUXKontextModelConfig = MainModelConfig;
export type ChatGPT4oModelConfig = ApiModelConfig;
export type Gemini2_5ModelConfig = ApiModelConfig;
type SubmodelDefinition = S['SubmodelDefinition'];
+export type ExternalImageSize = {
+ width: number;
+ height: number;
+};
+
+type ExternalResolutionPreset = {
+ label: string;
+ aspect_ratio: string;
+ image_size: string;
+ width: number;
+ height: number;
+};
+
+export type ExternalModelCapabilities = {
+ modes: ('txt2img' | 'img2img' | 'inpaint')[];
+ supports_reference_images?: boolean;
+ supports_negative_prompt?: boolean;
+ supports_seed?: boolean;
+ supports_guidance?: boolean;
+ supports_steps?: boolean;
+ max_images_per_request?: number | null;
+ max_image_size?: ExternalImageSize | null;
+ allowed_aspect_ratios?: string[] | null;
+ aspect_ratio_sizes?: Record<string, ExternalImageSize> | null;
+ resolution_presets?: ExternalResolutionPreset[] | null;
+ max_reference_images?: number | null;
+ mask_format?: 'alpha' | 'binary' | 'none';
+ input_image_required_for?: ('txt2img' | 'img2img' | 'inpaint')[] | null;
+};
+
+export type ExternalApiModelDefaultSettings = {
+ width?: number | null;
+ height?: number | null;
+ steps?: number | null;
+ guidance?: number | null;
+ num_images?: number | null;
+};
+
+export type ExternalPanelControlName =
+ | 'negative_prompt'
+ | 'reference_images'
+ | 'dimensions'
+ | 'seed'
+ | 'steps'
+ | 'guidance';
+
+export type ExternalModelPanelControl = {
+ name: ExternalPanelControlName;
+ slider_min?: number | null;
+ slider_max?: number | null;
+ number_input_min?: number | null;
+ number_input_max?: number | null;
+ fine_step?: number | null;
+ coarse_step?: number | null;
+ marks?: number[] | null;
+};
+
+export type ExternalModelPanelSchema = {
+ prompts: ExternalModelPanelControl[];
+ image: ExternalModelPanelControl[];
+ generation: ExternalModelPanelControl[];
+};
+
+export type ExternalApiModelConfig = {
+ key: string;
+ hash: string;
+ path: string;
+ file_size: number;
+ name: string;
+ description: string | null;
+ source: string;
+ source_type: string;
+ source_api_response: JsonObject | null;
+ cover_image: string | null;
+ base: 'external';
+ type: 'external_image_generator';
+ format: 'external_api';
+ provider_id: string;
+ provider_model_id: string;
+ capabilities: ExternalModelCapabilities;
+ default_settings?: ExternalApiModelDefaultSettings | null;
+ panel_schema?: ExternalModelPanelSchema | null;
+ tags?: string[] | null;
+ is_default?: boolean;
+};
+export type AnyModelConfig = InternalAnyModelConfig;
+export type AnyModelConfigWithExternal = AnyModelConfig | ExternalApiModelConfig;
+export type MainOrExternalModelConfig = MainModelConfig | ExternalApiModelConfig;
+
/**
* Checks if a list of submodels contains any that match a given variant or type
* @param submodels The list of submodels to check
@@ -301,6 +406,12 @@ export const isFluxReduxModelConfig = (config: AnyModelConfig): config is FLUXRe
return config.type === 'flux_redux';
};
+export const isExternalApiModelConfig = (
+ config: AnyModelConfigWithExternal | null | undefined
+): config is ExternalApiModelConfig => {
+ return !!config && (config as { format?: string }).format === 'external_api';
+};
+
export const isUnknownModelConfig = (config: AnyModelConfig): config is UnknownModelConfig => {
return config.type === 'unknown';
};
@@ -313,6 +424,15 @@ export const isNonRefinerMainModelConfig = (config: AnyModelConfig): config is M
return config.type === 'main' && config.base !== 'sdxl-refiner';
};
+export const isMainOrExternalModelConfig = (
+ config: AnyModelConfigWithExternal
+): config is MainOrExternalModelConfig => {
+ if (isExternalApiModelConfig(config)) {
+ return true;
+ }
+ return isNonRefinerMainModelConfig(config);
+};
+
export const isRefinerMainModelModelConfig = (config: AnyModelConfig): config is MainModelConfig => {
return config.type === 'main' && config.base === 'sdxl-refiner';
};
@@ -345,7 +465,15 @@ export const isTIModelConfig = (config: AnyModelConfig): config is MainModelConf
return config.type === 'embedding';
};
-export type ModelInstallJob = S['ModelInstallJob'];
+type ExternalModelInstallSource = {
+ type: 'external';
+ provider_id: string;
+ provider_model_id: string;
+};
+type ModelInstallSource = S['ModelInstallJob']['source'] | ExternalModelInstallSource;
+export type ModelInstallJob = Omit<S['ModelInstallJob'], 'source'> & {
+ source: ModelInstallSource;
+};
export type ModelInstallStatus = S['InstallStatus'];
// Graphs
diff --git a/mkdocs.yml b/mkdocs.yml
index ea54b12e91..0fdd965973 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -141,6 +141,10 @@ nav:
- Database: 'features/database.md'
- Gallery: 'features/gallery.md'
- Hot Keys: 'features/hotkeys.md'
+ - External Models:
+ - Overview: 'features/external-models/index.md'
+ - Google Gemini: 'features/external-models/gemini.md'
+ - OpenAI: 'features/external-models/openai.md'
- Multi-User Mode:
- User Guide: 'multiuser/user_guide.md'
- Administrator Guide: 'multiuser/admin_guide.md'
diff --git a/tests/app/invocations/test_external_image_generation.py b/tests/app/invocations/test_external_image_generation.py
new file mode 100644
index 0000000000..4247a36687
--- /dev/null
+++ b/tests/app/invocations/test_external_image_generation.py
@@ -0,0 +1,111 @@
+from types import SimpleNamespace
+from unittest.mock import MagicMock
+
+import pytest
+from PIL import Image
+
+from invokeai.app.invocations.external_image_generation import OpenAIImageGenerationInvocation
+from invokeai.app.invocations.fields import ImageField
+from invokeai.app.invocations.model import ModelIdentifierField
+from invokeai.app.services.external_generation.external_generation_common import (
+ ExternalGeneratedImage,
+ ExternalGenerationResult,
+)
+from invokeai.app.services.shared.graph import Graph, GraphExecutionState
+from invokeai.backend.model_manager.configs.external_api import ExternalApiModelConfig, ExternalModelCapabilities
+
+
+def _build_model() -> ExternalApiModelConfig:
+ return ExternalApiModelConfig(
+ key="external_test",
+ name="External Test",
+ provider_id="openai",
+ provider_model_id="gpt-image-1",
+ capabilities=ExternalModelCapabilities(
+ modes=["txt2img"],
+ supports_reference_images=True,
+ supports_seed=True,
+ ),
+ )
+
+
+def _build_context(model_config: ExternalApiModelConfig, generated_image: Image.Image) -> MagicMock:
+ context = MagicMock()
+ context.models.get_config.return_value = model_config
+ context.images.get_pil.return_value = generated_image
+ context.images.save.return_value = SimpleNamespace(image_name="result.png")
+ context._services.external_generation.generate.return_value = ExternalGenerationResult(
+ images=[ExternalGeneratedImage(image=generated_image, seed=42)],
+ provider_request_id="req-123",
+ provider_metadata={"model": model_config.provider_model_id},
+ )
+ return context
+
+
+def test_external_invocation_builds_request_and_outputs() -> None:
+ model_config = _build_model()
+ model_field = ModelIdentifierField.from_config(model_config)
+ generated_image = Image.new("RGB", (16, 16), color="black")
+ context = _build_context(model_config, generated_image)
+
+ invocation = OpenAIImageGenerationInvocation(
+ id="external_node",
+ model=model_field,
+ mode="txt2img",
+ prompt="A prompt",
+ seed=123,
+ num_images=1,
+ width=512,
+ height=512,
+ reference_images=[ImageField(image_name="ref.png")],
+ )
+
+ output = invocation.invoke(context)
+
+ request = context._services.external_generation.generate.call_args[0][0]
+ assert request.prompt == "A prompt"
+ assert request.seed == 123
+ assert len(request.reference_images) == 1
+ assert output.collection[0].image_name == "result.png"
+
+
+def test_provider_specific_external_invocation_rejects_wrong_provider() -> None:
+ model_config = _build_model().model_copy(update={"provider_id": "gemini"})
+ model_field = ModelIdentifierField.from_config(model_config)
+ generated_image = Image.new("RGB", (16, 16), color="black")
+ context = _build_context(model_config, generated_image)
+
+ invocation = OpenAIImageGenerationInvocation(
+ id="external_node",
+ model=model_field,
+ mode="txt2img",
+ prompt="A prompt",
+ )
+
+ with pytest.raises(ValueError, match="does not match node provider"):
+ invocation.invoke(context)
+
+
+def test_external_graph_execution_state_runs_node() -> None:
+ model_config = _build_model()
+ model_field = ModelIdentifierField.from_config(model_config)
+ generated_image = Image.new("RGB", (16, 16), color="black")
+ context = _build_context(model_config, generated_image)
+
+ invocation = OpenAIImageGenerationInvocation(
+ id="external_node",
+ model=model_field,
+ mode="txt2img",
+ prompt="A prompt",
+ )
+
+ graph = Graph()
+ graph.add_node(invocation)
+
+ session = GraphExecutionState(graph=graph)
+ node = session.next()
+ assert node is not None
+ output = node.invoke(context)
+ session.complete(node.id, output)
+
+ assert session.results[node.id] == output
diff --git a/tests/app/routers/test_app_info.py b/tests/app/routers/test_app_info.py
new file mode 100644
index 0000000000..afc7115cfc
--- /dev/null
+++ b/tests/app/routers/test_app_info.py
@@ -0,0 +1,181 @@
+import os
+from pathlib import Path
+from typing import Any
+from unittest.mock import Mock
+
+import pytest
+from fastapi.testclient import TestClient
+
+from invokeai.app.api.dependencies import ApiDependencies
+from invokeai.app.api_app import app
+from invokeai.app.services.config.config_default import get_config, load_and_migrate_config, load_external_api_keys
+from invokeai.app.services.external_generation.external_generation_common import ExternalProviderStatus
+from invokeai.app.services.invoker import Invoker
+from invokeai.backend.model_manager.configs.external_api import ExternalApiModelConfig, ExternalModelCapabilities
+from invokeai.backend.model_manager.taxonomy import BaseModelType, ModelType
+
+
[email protected](autouse=True, scope="module")
+def client(invokeai_root_dir: Path) -> TestClient:
+ os.environ["INVOKEAI_ROOT"] = invokeai_root_dir.as_posix()
+ return TestClient(app)
+
+
+class MockApiDependencies(ApiDependencies):
+ invoker: Invoker
+
+ def __init__(self, invoker: Invoker) -> None:
+ self.invoker = invoker
+
+
+def test_get_external_provider_statuses(monkeypatch: Any, mock_invoker: Invoker, client: TestClient) -> None:
+ statuses = {
+ "gemini": ExternalProviderStatus(provider_id="gemini", configured=True, message=None),
+ "openai": ExternalProviderStatus(provider_id="openai", configured=False, message="Missing key"),
+ }
+
+ monkeypatch.setattr("invokeai.app.api.routers.app_info.ApiDependencies", MockApiDependencies(mock_invoker))
+ monkeypatch.setattr(mock_invoker.services.external_generation, "get_provider_statuses", lambda: statuses)
+
+ response = client.get("/api/v1/app/external_providers/status")
+
+ assert response.status_code == 200
+ payload = sorted(response.json(), key=lambda item: item["provider_id"])
+ assert payload == [
+ {"provider_id": "gemini", "configured": True, "message": None},
+ {"provider_id": "openai", "configured": False, "message": "Missing key"},
+ ]
+
+
+def test_external_provider_config_update_and_reset(monkeypatch: Any, mock_invoker: Invoker, client: TestClient) -> None:
+ mock_store = Mock()
+ mock_store.search_by_attr.return_value = []
+ mock_install = Mock()
+ mock_model_manager = Mock()
+ mock_model_manager.store = mock_store
+ mock_model_manager.install = mock_install
+ mock_invoker.services.model_manager = mock_model_manager
+ monkeypatch.setattr("invokeai.app.api.routers.app_info.ApiDependencies", MockApiDependencies(mock_invoker))
+
+ for provider_id in ("gemini", "openai"):
+ response = client.delete(f"/api/v1/app/external_providers/config/{provider_id}")
+ assert response.status_code == 200
+
+ response = client.get("/api/v1/app/external_providers/config")
+ assert response.status_code == 200
+ payload = response.json()
+ openai_config = _get_provider_config(payload, "openai")
+ assert openai_config["api_key_configured"] is False
+ assert openai_config["base_url"] is None
+
+ response = client.post(
+ "/api/v1/app/external_providers/config/openai",
+ json={"api_key": "openai-key", "base_url": "https://api.openai.test"},
+ )
+ assert response.status_code == 200
+ payload = response.json()
+ assert payload["api_key_configured"] is True
+ assert payload["base_url"] == "https://api.openai.test"
+
+ response = client.get("/api/v1/app/external_providers/config")
+ assert response.status_code == 200
+ payload = response.json()
+ openai_config = _get_provider_config(payload, "openai")
+ assert openai_config["api_key_configured"] is True
+ assert openai_config["base_url"] == "https://api.openai.test"
+
+ config_path = get_config().config_file_path
+ api_keys_path = get_config().api_keys_file_path
+ file_config = load_and_migrate_config(config_path)
+ assert file_config.external_openai_api_key is None
+ assert file_config.external_openai_base_url is None
+ assert "external_openai_api_key" not in config_path.read_text()
+ assert "external_openai_base_url" not in config_path.read_text()
+ api_keys = load_external_api_keys(api_keys_path)
+ assert api_keys["external_openai_api_key"] == "openai-key"
+ assert api_keys["external_openai_base_url"] == "https://api.openai.test"
+
+ response = client.delete("/api/v1/app/external_providers/config/openai")
+ assert response.status_code == 200
+ payload = response.json()
+ assert payload["api_key_configured"] is False
+ assert payload["base_url"] is None
+
+ file_config = load_and_migrate_config(config_path)
+ api_keys = load_external_api_keys(api_keys_path)
+ assert file_config.external_openai_api_key is None
+ assert file_config.external_openai_base_url is None
+ assert "external_openai_api_key" not in config_path.read_text()
+ assert "external_openai_api_key" not in api_keys
+ assert "external_openai_base_url" not in api_keys
+
+
+def test_reset_external_provider_config_removes_provider_models(
+ monkeypatch: Any, mock_invoker: Invoker, client: TestClient
+) -> None:
+ openai_model = ExternalApiModelConfig(
+ key="openai_model",
+ name="OpenAI Model",
+ provider_id="openai",
+ provider_model_id="gpt-image-1",
+ capabilities=ExternalModelCapabilities(modes=["txt2img"]),
+ )
+ gemini_model = ExternalApiModelConfig(
+ key="gemini_model",
+ name="Gemini Model",
+ provider_id="gemini",
+ provider_model_id="gemini-2.5-flash-image",
+ capabilities=ExternalModelCapabilities(modes=["txt2img"]),
+ )
+ mock_store = Mock()
+ mock_store.search_by_attr.return_value = [openai_model, gemini_model]
+ mock_install = Mock()
+ mock_model_manager = Mock()
+ mock_model_manager.store = mock_store
+ mock_model_manager.install = mock_install
+ mock_invoker.services.model_manager = mock_model_manager
+
+ monkeypatch.setattr("invokeai.app.api.routers.app_info.ApiDependencies", MockApiDependencies(mock_invoker))
+
+ response = client.delete("/api/v1/app/external_providers/config/openai")
+
+ assert response.status_code == 200
+ mock_store.search_by_attr.assert_called_once_with(
+ base_model=BaseModelType.External,
+ model_type=ModelType.ExternalImageGenerator,
+ )
+ mock_install.delete.assert_called_once_with("openai_model")
+
+
+def test_set_external_provider_config_clears_provider_models_when_api_key_removed(
+ monkeypatch: Any, mock_invoker: Invoker, client: TestClient
+) -> None:
+ openai_model = ExternalApiModelConfig(
+ key="openai_model",
+ name="OpenAI Model",
+ provider_id="openai",
+ provider_model_id="gpt-image-1",
+ capabilities=ExternalModelCapabilities(modes=["txt2img"]),
+ )
+ mock_store = Mock()
+ mock_store.search_by_attr.return_value = [openai_model]
+ mock_install = Mock()
+ mock_model_manager = Mock()
+ mock_model_manager.store = mock_store
+ mock_model_manager.install = mock_install
+ mock_invoker.services.model_manager = mock_model_manager
+
+ monkeypatch.setattr("invokeai.app.api.routers.app_info.ApiDependencies", MockApiDependencies(mock_invoker))
+
+ response = client.post("/api/v1/app/external_providers/config/openai", json={"api_key": " "})
+
+ assert response.status_code == 200
+ mock_store.search_by_attr.assert_called_once_with(
+ base_model=BaseModelType.External,
+ model_type=ModelType.ExternalImageGenerator,
+ )
+ mock_install.delete.assert_called_once_with("openai_model")
+
+
+def _get_provider_config(payload: list[dict[str, Any]], provider_id: str) -> dict[str, Any]:
+ return next(item for item in payload if item["provider_id"] == provider_id)
diff --git a/tests/app/routers/test_model_manager.py b/tests/app/routers/test_model_manager.py
new file mode 100644
index 0000000000..3260b539bb
--- /dev/null
+++ b/tests/app/routers/test_model_manager.py
@@ -0,0 +1,185 @@
+import os
+from pathlib import Path
+from typing import Any
+
+import pytest
+from fastapi.testclient import TestClient
+
+from invokeai.app.api.dependencies import ApiDependencies
+from invokeai.app.api_app import app
+from invokeai.backend.model_manager.configs.external_api import (
+ ExternalApiModelConfig,
+ ExternalModelCapabilities,
+ ExternalModelPanelSchema,
+)
+from invokeai.backend.model_manager.taxonomy import ModelType
+
+
[email protected](autouse=True, scope="module")
+def client(invokeai_root_dir: Path) -> TestClient:
+ os.environ["INVOKEAI_ROOT"] = invokeai_root_dir.as_posix()
+ return TestClient(app)
+
+
+class DummyModelImages:
+ def get_url(self, key: str) -> str:
+ return f"https://example.com/models/{key}.png"
+
+
+class DummyInvoker:
+ def __init__(self, services: Any) -> None:
+ self.services = services
+
+
+class MockApiDependencies(ApiDependencies):
+ invoker: DummyInvoker
+
+ def __init__(self, invoker: DummyInvoker) -> None:
+ self.invoker = invoker
+
+
+def test_model_manager_external_config_round_trip(
+ monkeypatch: Any, client: TestClient, mm2_model_manager: Any, mm2_app_config: Any
+) -> None:
+ config = ExternalApiModelConfig(
+ key="external_test",
+ name="External Test",
+ provider_id="openai",
+ provider_model_id="gpt-image-1",
+ capabilities=ExternalModelCapabilities(modes=["txt2img"]),
+ )
+ mm2_model_manager.store.add_model(config)
+
+ services = type("Services", (), {})()
+ services.model_manager = mm2_model_manager
+ services.model_images = DummyModelImages()
+ services.configuration = mm2_app_config
+
+ invoker = DummyInvoker(services)
+ monkeypatch.setattr("invokeai.app.api.routers.model_manager.ApiDependencies", MockApiDependencies(invoker))
+
+ response = client.get("/api/v2/models/", params={"model_type": ModelType.ExternalImageGenerator.value})
+
+ assert response.status_code == 200
+ payload = response.json()
+ assert len(payload["models"]) == 1
+ assert payload["models"][0]["key"] == "external_test"
+ assert payload["models"][0]["provider_id"] == "openai"
+ assert payload["models"][0]["cover_image"] == "https://example.com/models/external_test.png"
+
+ get_response = client.get("/api/v2/models/i/external_test")
+
+ assert get_response.status_code == 200
+ model_payload = get_response.json()
+ assert model_payload["provider_model_id"] == "gpt-image-1"
+ assert model_payload["cover_image"] == "https://example.com/models/external_test.png"
+
+
+def test_model_manager_external_config_preserves_custom_panel_schema(
+ monkeypatch: Any, client: TestClient, mm2_model_manager: Any, mm2_app_config: Any
+) -> None:
+ config = ExternalApiModelConfig(
+ key="external_custom_schema",
+ name="External Custom Schema",
+ provider_id="custom",
+ provider_model_id="custom-model",
+ capabilities=ExternalModelCapabilities(modes=["txt2img"]),
+ panel_schema=ExternalModelPanelSchema(
+ prompts=[{"name": "reference_images"}],
+ image=[{"name": "dimensions"}],
+ ),
+ source="external://custom/custom-model",
+ )
+ mm2_model_manager.store.add_model(config)
+
+ services = type("Services", (), {})()
+ services.model_manager = mm2_model_manager
+ services.model_images = DummyModelImages()
+ services.configuration = mm2_app_config
+
+ invoker = DummyInvoker(services)
+ monkeypatch.setattr("invokeai.app.api.routers.model_manager.ApiDependencies", MockApiDependencies(invoker))
+
+ response = client.get("/api/v2/models/i/external_custom_schema")
+
+ assert response.status_code == 200
+ payload = response.json()
+ assert [control["name"] for control in payload["panel_schema"]["prompts"]] == ["reference_images"]
+ assert [control["name"] for control in payload["panel_schema"]["image"]] == ["dimensions"]
+
+
+def test_model_manager_external_starter_model_applies_panel_schema_overrides(
+ monkeypatch: Any, client: TestClient, mm2_model_manager: Any, mm2_app_config: Any
+) -> None:
+ config = ExternalApiModelConfig(
+ key="external_starter_schema",
+ name="Starter Schema Test",
+ provider_id="openai",
+ provider_model_id="gpt-image-1",
+ capabilities=ExternalModelCapabilities(
+ modes=["txt2img"],
+ supports_reference_images=False,
+ ),
+ )
+ mm2_model_manager.store.add_model(config)
+
+ services = type("Services", (), {})()
+ services.model_manager = mm2_model_manager
+ services.model_images = DummyModelImages()
+ services.configuration = mm2_app_config
+
+ invoker = DummyInvoker(services)
+ monkeypatch.setattr("invokeai.app.api.routers.model_manager.ApiDependencies", MockApiDependencies(invoker))
+
+ response = client.get("/api/v2/models/i/external_starter_schema")
+
+ assert response.status_code == 200
+ payload = response.json()
+ assert [control["name"] for control in payload["panel_schema"]["prompts"]] == ["reference_images"]
+ assert [control["name"] for control in payload["panel_schema"]["image"]] == ["dimensions"]
+ assert payload["panel_schema"]["generation"] == []
+
+
+def test_model_manager_gemini_starter_model_applies_reference_and_resolution_overrides(
+ monkeypatch: Any, client: TestClient, mm2_model_manager: Any, mm2_app_config: Any
+) -> None:
+ config = ExternalApiModelConfig(
+ key="external_gemini_schema",
+ name="Gemini Starter Schema Test",
+ provider_id="gemini",
+ provider_model_id="gemini-3.1-flash-image-preview",
+ capabilities=ExternalModelCapabilities(modes=["txt2img"]),
+ source="external://gemini/gemini-3.1-flash-image-preview",
+ )
+ mm2_model_manager.store.add_model(config)
+
+ services = type("Services", (), {})()
+ services.model_manager = mm2_model_manager
+ services.model_images = DummyModelImages()
+ services.configuration = mm2_app_config
+
+ invoker = DummyInvoker(services)
+ monkeypatch.setattr("invokeai.app.api.routers.model_manager.ApiDependencies", MockApiDependencies(invoker))
+
+ response = client.get("/api/v2/models/i/external_gemini_schema")
+
+ assert response.status_code == 200
+ payload = response.json()
+ assert payload["capabilities"]["max_reference_images"] == 14
+ assert payload["capabilities"]["max_image_size"] == {"width": 4096, "height": 4096}
+ assert payload["capabilities"]["allowed_aspect_ratios"] == [
+ "1:1",
+ "1:4",
+ "1:8",
+ "2:3",
+ "3:2",
+ "3:4",
+ "4:1",
+ "4:3",
+ "4:5",
+ "5:4",
+ "8:1",
+ "9:16",
+ "16:9",
+ "21:9",
+ ]
diff --git a/tests/app/routers/test_multiuser_authorization.py b/tests/app/routers/test_multiuser_authorization.py
index e9efae7034..85354c6a57 100644
--- a/tests/app/routers/test_multiuser_authorization.py
+++ b/tests/app/routers/test_multiuser_authorization.py
@@ -115,6 +115,7 @@ def mock_services() -> InvocationServices:
model_relationships=None, # type: ignore
client_state_persistence=ClientStatePersistenceSqlite(db=db),
users=UserService(db),
+ external_generation=None, # type: ignore
)
diff --git a/tests/app/routers/test_workflows_multiuser.py b/tests/app/routers/test_workflows_multiuser.py
index fee3953dbb..a1fa5ed5ad 100644
--- a/tests/app/routers/test_workflows_multiuser.py
+++ b/tests/app/routers/test_workflows_multiuser.py
@@ -106,6 +106,7 @@ def mock_services() -> InvocationServices:
model_relationships=None, # type: ignore
client_state_persistence=ClientStatePersistenceSqlite(db=db),
users=UserService(db),
+ external_generation=None, # type: ignore
)
diff --git a/tests/app/services/external_generation/test_external_generation_service.py b/tests/app/services/external_generation/test_external_generation_service.py
new file mode 100644
index 0000000000..89c1a6db31
--- /dev/null
+++ b/tests/app/services/external_generation/test_external_generation_service.py
@@ -0,0 +1,250 @@
+import logging
+
+import pytest
+from PIL import Image
+
+from invokeai.app.services.config.config_default import InvokeAIAppConfig
+from invokeai.app.services.external_generation.errors import (
+ ExternalProviderCapabilityError,
+ ExternalProviderNotConfiguredError,
+ ExternalProviderNotFoundError,
+)
+from invokeai.app.services.external_generation.external_generation_base import ExternalProvider
+from invokeai.app.services.external_generation.external_generation_common import (
+ ExternalGeneratedImage,
+ ExternalGenerationRequest,
+ ExternalGenerationResult,
+ ExternalReferenceImage,
+)
+from invokeai.app.services.external_generation.external_generation_default import ExternalGenerationService
+from invokeai.backend.model_manager.configs.external_api import (
+ ExternalApiModelConfig,
+ ExternalImageSize,
+ ExternalModelCapabilities,
+)
+
+
+class DummyProvider(ExternalProvider):
+ def __init__(self, provider_id: str, configured: bool, result: ExternalGenerationResult | None = None) -> None:
+ super().__init__(InvokeAIAppConfig(), logging.getLogger("test"))
+ self.provider_id = provider_id
+ self._configured = configured
+ self._result = result
+ self.last_request: ExternalGenerationRequest | None = None
+
+ def is_configured(self) -> bool:
+ return self._configured
+
+ def generate(self, request: ExternalGenerationRequest) -> ExternalGenerationResult:
+ self.last_request = request
+ assert self._result is not None
+ return self._result
+
+
+def _build_model(capabilities: ExternalModelCapabilities) -> ExternalApiModelConfig:
+ return ExternalApiModelConfig(
+ key="external_test",
+ name="External Test",
+ provider_id="openai",
+ provider_model_id="gpt-image-1",
+ capabilities=capabilities,
+ )
+
+
+def _build_request(
+ *,
+ model: ExternalApiModelConfig,
+ mode: str = "txt2img",
+ seed: int | None = None,
+ num_images: int = 1,
+ width: int = 64,
+ height: int = 64,
+ init_image: Image.Image | None = None,
+ mask_image: Image.Image | None = None,
+ reference_images: list[ExternalReferenceImage] | None = None,
+) -> ExternalGenerationRequest:
+ return ExternalGenerationRequest(
+ model=model,
+ mode=mode, # type: ignore[arg-type]
+ prompt="A test prompt",
+ seed=seed,
+ num_images=num_images,
+ width=width,
+ height=height,
+ image_size=None,
+ init_image=init_image,
+ mask_image=mask_image,
+ reference_images=reference_images or [],
+ metadata=None,
+ )
+
+
+def _make_image() -> Image.Image:
+ return Image.new("RGB", (64, 64), color="black")
+
+
+def test_generate_requires_registered_provider() -> None:
+ model = _build_model(ExternalModelCapabilities(modes=["txt2img"]))
+ request = _build_request(model=model)
+ service = ExternalGenerationService({}, logging.getLogger("test"))
+
+ with pytest.raises(ExternalProviderNotFoundError):
+ service.generate(request)
+
+
+def test_generate_requires_configured_provider() -> None:
+ model = _build_model(ExternalModelCapabilities(modes=["txt2img"]))
+ request = _build_request(model=model)
+ provider = DummyProvider("openai", configured=False)
+ service = ExternalGenerationService({"openai": provider}, logging.getLogger("test"))
+
+ with pytest.raises(ExternalProviderNotConfiguredError):
+ service.generate(request)
+
+
+def test_generate_validates_mode_support() -> None:
+ model = _build_model(ExternalModelCapabilities(modes=["txt2img"]))
+ request = _build_request(model=model, mode="img2img", init_image=_make_image())
+ provider = DummyProvider("openai", configured=True, result=ExternalGenerationResult(images=[]))
+ service = ExternalGenerationService({"openai": provider}, logging.getLogger("test"))
+
+ with pytest.raises(ExternalProviderCapabilityError, match="Mode 'img2img'"):
+ service.generate(request)
+
+
+def test_generate_requires_init_image_for_img2img() -> None:
+ model = _build_model(ExternalModelCapabilities(modes=["img2img"]))
+ request = _build_request(model=model, mode="img2img")
+ provider = DummyProvider("openai", configured=True, result=ExternalGenerationResult(images=[]))
+ service = ExternalGenerationService({"openai": provider}, logging.getLogger("test"))
+
+ with pytest.raises(ExternalProviderCapabilityError, match="requires an init image"):
+ service.generate(request)
+
+
+def test_generate_requires_mask_for_inpaint() -> None:
+ model = _build_model(ExternalModelCapabilities(modes=["inpaint"]))
+ request = _build_request(model=model, mode="inpaint", init_image=_make_image())
+ provider = DummyProvider("openai", configured=True, result=ExternalGenerationResult(images=[]))
+ service = ExternalGenerationService({"openai": provider}, logging.getLogger("test"))
+
+ with pytest.raises(ExternalProviderCapabilityError, match="requires a mask"):
+ service.generate(request)
+
+
+def test_generate_validates_reference_images() -> None:
+ model = _build_model(ExternalModelCapabilities(modes=["txt2img"], supports_reference_images=False))
+ request = _build_request(
+ model=model,
+ reference_images=[ExternalReferenceImage(image=_make_image())],
+ )
+ provider = DummyProvider("openai", configured=True, result=ExternalGenerationResult(images=[]))
+ service = ExternalGenerationService({"openai": provider}, logging.getLogger("test"))
+
+ with pytest.raises(ExternalProviderCapabilityError, match="Reference images"):
+ service.generate(request)
+
+
+def test_generate_validates_limits() -> None:
+ model = _build_model(
+ ExternalModelCapabilities(
+ modes=["txt2img"],
+ supports_reference_images=True,
+ max_reference_images=1,
+ max_images_per_request=1,
+ )
+ )
+ request = _build_request(
+ model=model,
+ num_images=2,
+ reference_images=[
+ ExternalReferenceImage(image=_make_image()),
+ ExternalReferenceImage(image=_make_image()),
+ ],
+ )
+ provider = DummyProvider("openai", configured=True, result=ExternalGenerationResult(images=[]))
+ service = ExternalGenerationService({"openai": provider}, logging.getLogger("test"))
+
+ with pytest.raises(ExternalProviderCapabilityError, match="supports at most"):
+ service.generate(request)
+
+
+def test_generate_validates_allowed_aspect_ratios() -> None:
+ model = _build_model(
+ ExternalModelCapabilities(
+ modes=["txt2img"],
+ allowed_aspect_ratios=["1:1", "16:9"],
+ aspect_ratio_sizes={
+ "1:1": ExternalImageSize(width=1024, height=1024),
+ "16:9": ExternalImageSize(width=1344, height=768),
+ },
+ )
+ )
+ request = _build_request(model=model)
+ provider = DummyProvider("openai", configured=True, result=ExternalGenerationResult(images=[]))
+ service = ExternalGenerationService({"openai": provider}, logging.getLogger("test"))
+
+ response = service.generate(request)
+ assert response.images == []
+ assert provider.last_request is not None
+ assert provider.last_request.width == 1024
+ assert provider.last_request.height == 1024
+
+
+def test_generate_validates_allowed_aspect_ratios_with_bucket_sizes() -> None:
+ model = _build_model(
+ ExternalModelCapabilities(
+ modes=["txt2img"],
+ allowed_aspect_ratios=["1:1", "16:9"],
+ aspect_ratio_sizes={
+ "1:1": ExternalImageSize(width=1024, height=1024),
+ "16:9": ExternalImageSize(width=1344, height=768),
+ },
+ )
+ )
+ request = _build_request(model=model, width=160, height=90)
+ provider = DummyProvider("openai", configured=True, result=ExternalGenerationResult(images=[]))
+ service = ExternalGenerationService({"openai": provider}, logging.getLogger("test"))
+
+ response = service.generate(request)
+
+ assert response.images == []
+ assert provider.last_request is not None
+ assert provider.last_request.width == 1344
+ assert provider.last_request.height == 768
+
+
+def test_generate_happy_path() -> None:
+ model = _build_model(ExternalModelCapabilities(modes=["txt2img"], supports_seed=True))
+ request = _build_request(model=model, seed=42)
+ result = ExternalGenerationResult(images=[ExternalGeneratedImage(image=_make_image(), seed=42)])
+ provider = DummyProvider("openai", configured=True, result=result)
+ service = ExternalGenerationService({"openai": provider}, logging.getLogger("test"))
+
+ response = service.generate(request)
+
+ assert response is result
+ assert provider.last_request == request
+
+
+def test_generate_resizes_inpaint_result_to_original_init_size() -> None:
+ model = _build_model(ExternalModelCapabilities(modes=["inpaint"]))
+ request = _build_request(
+ model=model,
+ mode="inpaint",
+ width=128,
+ height=128,
+ init_image=_make_image(),
+ mask_image=_make_image(),
+ )
+ generated_large = Image.new("RGB", (128, 128), color="black")
+ result = ExternalGenerationResult(images=[ExternalGeneratedImage(image=generated_large, seed=1)])
+ provider = DummyProvider("openai", configured=True, result=result)
+ service = ExternalGenerationService({"openai": provider}, logging.getLogger("test"))
+
+ response = service.generate(request)
+
+ assert request.init_image is not None
+ assert response.images[0].image.width == request.init_image.width
+ assert response.images[0].image.height == request.init_image.height
+ assert response.images[0].seed == 1
diff --git a/tests/app/services/external_generation/test_external_provider_adapters.py b/tests/app/services/external_generation/test_external_provider_adapters.py
new file mode 100644
index 0000000000..a64f197b4d
--- /dev/null
+++ b/tests/app/services/external_generation/test_external_provider_adapters.py
@@ -0,0 +1,393 @@
+import io
+import logging
+
+import pytest
+from PIL import Image
+
+from invokeai.app.services.config.config_default import InvokeAIAppConfig
+from invokeai.app.services.external_generation.errors import ExternalProviderRequestError
+from invokeai.app.services.external_generation.external_generation_common import (
+ ExternalGenerationRequest,
+ ExternalReferenceImage,
+)
+from invokeai.app.services.external_generation.image_utils import decode_image_base64, encode_image_base64
+from invokeai.app.services.external_generation.providers.gemini import GeminiProvider
+from invokeai.app.services.external_generation.providers.openai import OpenAIProvider
+from invokeai.backend.model_manager.configs.external_api import ExternalApiModelConfig, ExternalModelCapabilities
+
+
+class DummyResponse:
+ def __init__(self, ok: bool, status_code: int = 200, json_data: dict | None = None, text: str = "") -> None:
+ self.ok = ok
+ self.status_code = status_code
+ self._json_data = json_data or {}
+ self.text = text
+ self.headers: dict[str, str] = {}
+
+ def json(self) -> dict:
+ return self._json_data
+
+
+def _make_image(color: str = "black") -> Image.Image:
+ return Image.new("RGB", (32, 32), color=color)
+
+
+def _build_model(provider_id: str, provider_model_id: str) -> ExternalApiModelConfig:
+ return ExternalApiModelConfig(
+ key=f"{provider_id}_test",
+ name=f"{provider_id.title()} Test",
+ provider_id=provider_id,
+ provider_model_id=provider_model_id,
+ capabilities=ExternalModelCapabilities(
+ modes=["txt2img", "img2img", "inpaint"],
+ supports_reference_images=True,
+ supports_seed=True,
+ ),
+ )
+
+
+def _build_request(
+ model: ExternalApiModelConfig,
+ mode: str = "txt2img",
+ init_image: Image.Image | None = None,
+ mask_image: Image.Image | None = None,
+ reference_images: list[ExternalReferenceImage] | None = None,
+) -> ExternalGenerationRequest:
+ return ExternalGenerationRequest(
+ model=model,
+ mode=mode, # type: ignore[arg-type]
+ prompt="A test prompt",
+ seed=123,
+ num_images=1,
+ width=256,
+ height=256,
+ image_size=None,
+ init_image=init_image,
+ mask_image=mask_image,
+ reference_images=reference_images or [],
+ metadata=None,
+ )
+
+
+def test_gemini_generate_success(monkeypatch: pytest.MonkeyPatch) -> None:
+ api_key = "gemini-key"
+ config = InvokeAIAppConfig(external_gemini_api_key=api_key)
+ provider = GeminiProvider(config, logging.getLogger("test"))
+ model = _build_model("gemini", "gemini-2.5-flash-image")
+ init_image = _make_image("blue")
+ ref_image = _make_image("red")
+ request = _build_request(
+ model,
+ init_image=init_image,
+ reference_images=[ExternalReferenceImage(image=ref_image)],
+ )
+ encoded = encode_image_base64(_make_image("green"))
+ captured: dict[str, object] = {}
+
+ def fake_post(url: str, params: dict, json: dict, timeout: int) -> DummyResponse:
+ captured["url"] = url
+ captured["params"] = params
+ captured["json"] = json
+ captured["timeout"] = timeout
+ return DummyResponse(
+ ok=True,
+ json_data={
+ "candidates": [
+ {"content": {"parts": [{"inlineData": {"data": encoded}}]}},
+ ]
+ },
+ )
+
+ monkeypatch.setattr("requests.post", fake_post)
+
+ result = provider.generate(request)
+
+ assert (
+ captured["url"]
+ == "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash-image:generateContent"
+ )
+ assert captured["params"] == {"key": api_key}
+ payload = captured["json"]
+ assert isinstance(payload, dict)
+ system_instruction = payload.get("systemInstruction")
+ assert isinstance(system_instruction, dict)
+ system_parts = system_instruction.get("parts")
+ assert isinstance(system_parts, list)
+ system_text = str(system_parts[0]).lower()
+ assert "image" in system_text
+ generation_config = payload.get("generationConfig")
+ assert isinstance(generation_config, dict)
+ assert generation_config["candidateCount"] == 1
+ assert generation_config["responseModalities"] == ["IMAGE"]
+ contents = payload.get("contents")
+ assert isinstance(contents, list)
+ first_content = contents[0]
+ assert isinstance(first_content, dict)
+ parts = first_content.get("parts")
+ assert isinstance(parts, list)
+ assert len(parts) >= 3
+ part0 = parts[0]
+ part1 = parts[1]
+ part2 = parts[2]
+ assert isinstance(part0, dict)
+ assert isinstance(part1, dict)
+ assert isinstance(part2, dict)
+ inline0 = part0.get("inlineData")
+ assert isinstance(inline0, dict)
+ assert part1["text"] == request.prompt
+ inline1 = part2.get("inlineData")
+ assert isinstance(inline1, dict)
+ assert inline0["data"] == encode_image_base64(init_image)
+ assert inline1["data"] == encode_image_base64(ref_image)
+ assert result.images[0].seed == request.seed
+ assert result.provider_metadata == {"model": request.model.provider_model_id}
+
+
+def test_gemini_generate_error_response(monkeypatch: pytest.MonkeyPatch) -> None:
+ config = InvokeAIAppConfig(external_gemini_api_key="gemini-key")
+ provider = GeminiProvider(config, logging.getLogger("test"))
+ model = _build_model("gemini", "gemini-2.5-flash-image")
+ request = _build_request(model)
+
+ def fake_post(url: str, params: dict, json: dict, timeout: int) -> DummyResponse:
+ return DummyResponse(ok=False, status_code=400, text="bad request")
+
+ monkeypatch.setattr("requests.post", fake_post)
+
+ with pytest.raises(ExternalProviderRequestError, match="Gemini request failed"):
+ provider.generate(request)
+
+
+def test_gemini_generate_uses_base_url(monkeypatch: pytest.MonkeyPatch) -> None:
+ config = InvokeAIAppConfig(
+ external_gemini_api_key="gemini-key",
+ external_gemini_base_url="https://proxy.gemini",
+ )
+ provider = GeminiProvider(config, logging.getLogger("test"))
+ model = _build_model("gemini", "gemini-2.5-flash-image")
+ request = _build_request(model)
+ encoded = encode_image_base64(_make_image("green"))
+ captured: dict[str, object] = {}
+
+ def fake_post(url: str, params: dict, json: dict, timeout: int) -> DummyResponse:
+ captured["url"] = url
+ return DummyResponse(
+ ok=True,
+ json_data={"candidates": [{"content": {"parts": [{"inlineData": {"data": encoded}}]}}]},
+ )
+
+ monkeypatch.setattr("requests.post", fake_post)
+
+ provider.generate(request)
+
+ assert captured["url"] == "https://proxy.gemini/v1beta/models/gemini-2.5-flash-image:generateContent"
+
+
+def test_gemini_generate_keeps_base_url_version(monkeypatch: pytest.MonkeyPatch) -> None:
+ config = InvokeAIAppConfig(
+ external_gemini_api_key="gemini-key",
+ external_gemini_base_url="https://proxy.gemini/v1",
+ )
+ provider = GeminiProvider(config, logging.getLogger("test"))
+ model = _build_model("gemini", "gemini-2.5-flash-image")
+ request = _build_request(model)
+ encoded = encode_image_base64(_make_image("green"))
+ captured: dict[str, object] = {}
+
+ def fake_post(url: str, params: dict, json: dict, timeout: int) -> DummyResponse:
+ captured["url"] = url
+ return DummyResponse(
+ ok=True,
+ json_data={"candidates": [{"content": {"parts": [{"inlineData": {"data": encoded}}]}}]},
+ )
+
+ monkeypatch.setattr("requests.post", fake_post)
+
+ provider.generate(request)
+
+ assert captured["url"] == "https://proxy.gemini/v1/models/gemini-2.5-flash-image:generateContent"
+
+
+def test_gemini_generate_strips_models_prefix(monkeypatch: pytest.MonkeyPatch) -> None:
+ config = InvokeAIAppConfig(external_gemini_api_key="gemini-key")
+ provider = GeminiProvider(config, logging.getLogger("test"))
+ model = _build_model("gemini", "models/gemini-2.5-flash-image")
+ request = _build_request(model)
+ encoded = encode_image_base64(_make_image("green"))
+ captured: dict[str, object] = {}
+
+ def fake_post(url: str, params: dict, json: dict, timeout: int) -> DummyResponse:
+ captured["url"] = url
+ return DummyResponse(
+ ok=True,
+ json_data={"candidates": [{"content": {"parts": [{"inlineData": {"data": encoded}}]}}]},
+ )
+
+ monkeypatch.setattr("requests.post", fake_post)
+
+ provider.generate(request)
+
+ assert (
+ captured["url"]
+ == "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash-image:generateContent"
+ )
+
+
+def test_openai_generate_txt2img_success(monkeypatch: pytest.MonkeyPatch) -> None:
+ api_key = "openai-key"
+ config = InvokeAIAppConfig(external_openai_api_key=api_key)
+ provider = OpenAIProvider(config, logging.getLogger("test"))
+ model = _build_model("openai", "gpt-image-1")
+ request = _build_request(model)
+ encoded = encode_image_base64(_make_image("purple"))
+ captured: dict[str, object] = {}
+
+ def fake_post(url: str, headers: dict, json: dict, timeout: int) -> DummyResponse:
+ captured["url"] = url
+ captured["headers"] = headers
+ captured["json"] = json
+ response = DummyResponse(ok=True, json_data={"data": [{"b64_json": encoded}]})
+ response.headers["x-request-id"] = "req-123"
+ return response
+
+ monkeypatch.setattr("requests.post", fake_post)
+
+ result = provider.generate(request)
+
+ assert captured["url"] == "https://api.openai.com/v1/images/generations"
+ headers = captured["headers"]
+ assert isinstance(headers, dict)
+ assert headers["Authorization"] == f"Bearer {api_key}"
+ json_payload = captured["json"]
+ assert isinstance(json_payload, dict)
+ assert json_payload["prompt"] == request.prompt
+ assert result.provider_request_id == "req-123"
+ assert result.images[0].seed == request.seed
+ assert decode_image_base64(encoded).size == result.images[0].image.size
+
+
+def test_openai_generate_uses_base_url(monkeypatch: pytest.MonkeyPatch) -> None:
+ config = InvokeAIAppConfig(
+ external_openai_api_key="openai-key",
+ external_openai_base_url="https://proxy.openai/",
+ )
+ provider = OpenAIProvider(config, logging.getLogger("test"))
+ model = _build_model("openai", "gpt-image-1")
+ request = _build_request(model)
+ encoded = encode_image_base64(_make_image("purple"))
+ captured: dict[str, object] = {}
+
+ def fake_post(url: str, headers: dict, json: dict, timeout: int) -> DummyResponse:
+ captured["url"] = url
+ return DummyResponse(ok=True, json_data={"data": [{"b64_json": encoded}]})
+
+ monkeypatch.setattr("requests.post", fake_post)
+
+ provider.generate(request)
+
+ assert captured["url"] == "https://proxy.openai/v1/images/generations"
+
+
+def test_openai_generate_txt2img_error_response(monkeypatch: pytest.MonkeyPatch) -> None:
+ config = InvokeAIAppConfig(external_openai_api_key="openai-key")
+ provider = OpenAIProvider(config, logging.getLogger("test"))
+ model = _build_model("openai", "gpt-image-1")
+ request = _build_request(model)
+
+ def fake_post(url: str, headers: dict, json: dict, timeout: int) -> DummyResponse:
+ return DummyResponse(ok=False, status_code=500, text="server error")
+
+ monkeypatch.setattr("requests.post", fake_post)
+
+ with pytest.raises(ExternalProviderRequestError, match="OpenAI request failed"):
+ provider.generate(request)
+
+
+def test_openai_generate_inpaint_uses_edit_endpoint(monkeypatch: pytest.MonkeyPatch) -> None:
+ config = InvokeAIAppConfig(external_openai_api_key="openai-key")
+ provider = OpenAIProvider(config, logging.getLogger("test"))
+ model = _build_model("openai", "gpt-image-1")
+ request = _build_request(
+ model,
+ mode="inpaint",
+ init_image=_make_image("white"),
+ mask_image=_make_image("black"),
+ )
+ encoded = encode_image_base64(_make_image("orange"))
+ captured: dict[str, object] = {}
+
+ def fake_post(
+ url: str,
+ headers: dict,
+ data: dict,
+ files: list[tuple[str, tuple[str, io.BytesIO, str]]],
+ timeout: int,
+ ) -> DummyResponse:
+ captured["url"] = url
+ captured["data"] = data
+ captured["files"] = files
+ response = DummyResponse(ok=True, json_data={"data": [{"b64_json": encoded}]})
+ return response
+
+ monkeypatch.setattr("requests.post", fake_post)
+
+ result = provider.generate(request)
+
+ assert captured["url"] == "https://api.openai.com/v1/images/edits"
+ data_payload = captured["data"]
+ assert isinstance(data_payload, dict)
+ assert data_payload["prompt"] == request.prompt
+ files = captured["files"]
+ assert isinstance(files, list)
+ image_file = next((file for file in files if file[0] == "image"), None)
+ mask_file = next((file for file in files if file[0] == "mask"), None)
+ assert image_file is not None
+ assert mask_file is not None
+ image_tuple = image_file[1]
+ assert isinstance(image_tuple, tuple)
+ assert image_tuple[0] == "image_0.png"
+ assert isinstance(image_tuple[1], io.BytesIO)
+ assert result.images
+
+
+def test_openai_generate_txt2img_with_references_uses_edit_endpoint(monkeypatch: pytest.MonkeyPatch) -> None:
+ config = InvokeAIAppConfig(external_openai_api_key="openai-key")
+ provider = OpenAIProvider(config, logging.getLogger("test"))
+ model = _build_model("openai", "gpt-image-1")
+ request = _build_request(
+ model,
+ reference_images=[
+ ExternalReferenceImage(image=_make_image("red")),
+ ExternalReferenceImage(image=_make_image("blue")),
+ ],
+ )
+ encoded = encode_image_base64(_make_image("orange"))
+ captured: dict[str, object] = {}
+
+ def fake_post(
+ url: str,
+ headers: dict,
+ data: dict,
+ files: list[tuple[str, tuple[str, io.BytesIO, str]]],
+ timeout: int,
+ ) -> DummyResponse:
+ captured["url"] = url
+ captured["data"] = data
+ captured["files"] = files
+ return DummyResponse(ok=True, json_data={"data": [{"b64_json": encoded}]})
+
+ monkeypatch.setattr("requests.post", fake_post)
+
+ result = provider.generate(request)
+
+ assert captured["url"] == "https://api.openai.com/v1/images/edits"
+ data_payload = captured["data"]
+ assert isinstance(data_payload, dict)
+ assert data_payload["prompt"] == request.prompt
+ files = captured["files"]
+ assert isinstance(files, list)
+ image_files = [file for file in files if file[0] == "image[]"]
+ assert len(image_files) == 2
+ assert image_files[0][1][0] == "image_0.png"
+ assert image_files[1][1][0] == "image_1.png"
+ assert result.images
diff --git a/tests/app/services/external_generation/test_startup.py b/tests/app/services/external_generation/test_startup.py
new file mode 100644
index 0000000000..a2eef392f5
--- /dev/null
+++ b/tests/app/services/external_generation/test_startup.py
@@ -0,0 +1,56 @@
+from unittest.mock import MagicMock
+
+from invokeai.app.services.external_generation.startup import sync_configured_external_starter_models
+from invokeai.backend.model_manager.configs.external_api import ExternalApiModelConfig, ExternalModelCapabilities
+
+
+def _build_installed_model(source: str) -> ExternalApiModelConfig:
+ provider_id, provider_model_id = source.removeprefix("external://").split("/", 1)
+ return ExternalApiModelConfig(
+ key=f"{provider_id}-{provider_model_id}",
+ name=provider_model_id,
+ source=source,
+ provider_id=provider_id,
+ provider_model_id=provider_model_id,
+ capabilities=ExternalModelCapabilities(modes=["txt2img"]),
+ )
+
+
+def test_sync_configured_external_starter_models_queues_missing_models_for_configured_providers() -> None:
+ model_manager = MagicMock()
+ model_manager.store.search_by_attr.return_value = [
+ _build_installed_model("external://openai/gpt-image-1"),
+ ]
+ logger = MagicMock()
+
+ queued_sources = sync_configured_external_starter_models(
+ configured_provider_ids={"gemini", "openai"},
+ model_manager=model_manager,
+ logger=logger,
+ )
+
+ assert "external://openai/gpt-image-1" not in queued_sources
+ assert "external://gemini/gemini-2.5-flash-image" in queued_sources
+ assert "external://gemini/gemini-3.1-flash-image-preview" in queued_sources
+ assert "external://gemini/gemini-3-pro-image-preview" in queued_sources
+
+ install_calls = [call.args[0] for call in model_manager.install.heuristic_import.call_args_list]
+ assert "external://openai/gpt-image-1" not in install_calls
+ assert "external://gemini/gemini-2.5-flash-image" in install_calls
+ assert "external://gemini/gemini-3.1-flash-image-preview" in install_calls
+ assert "external://gemini/gemini-3-pro-image-preview" in install_calls
+
+
+def test_sync_configured_external_starter_models_skips_when_no_provider_is_configured() -> None:
+ model_manager = MagicMock()
+ logger = MagicMock()
+
+ queued_sources = sync_configured_external_starter_models(
+ configured_provider_ids=set(),
+ model_manager=model_manager,
+ logger=logger,
+ )
+
+ assert queued_sources == []
+ model_manager.store.search_by_attr.assert_not_called()
+ model_manager.install.heuristic_import.assert_not_called()
diff --git a/tests/app/services/model_install/test_model_install.py b/tests/app/services/model_install/test_model_install.py
index 9a7cc6aaaa..de001178ad 100644
--- a/tests/app/services/model_install/test_model_install.py
+++ b/tests/app/services/model_install/test_model_install.py
@@ -35,10 +35,12 @@ from invokeai.app.services.model_install.model_install_common import (
URLModelSource,
)
from invokeai.app.services.model_records import ModelRecordChanges, UnknownModelException
+from invokeai.backend.model_manager.configs.external_api import ExternalApiModelConfig
from invokeai.backend.model_manager.taxonomy import (
BaseModelType,
ModelFormat,
ModelRepoVariant,
+ ModelSourceType,
ModelType,
)
from tests.backend.model_manager.model_manager_fixtures import * # noqa F403
@@ -215,6 +217,50 @@ def test_inplace_install(
assert Path(job.config_out.path).exists()
+def test_external_install(mm2_installer: ModelInstallServiceBase) -> None:
+ config = ModelRecordChanges(name="ChatGPT Image", description="External model", key="chatgpt_image")
+ job = mm2_installer.heuristic_import("external://openai/gpt-image-1", config=config)
+
+ mm2_installer.wait_for_installs()
+
+ assert job.status == InstallStatus.COMPLETED
+ assert job.config_out is not None
+ assert isinstance(job.config_out, ExternalApiModelConfig)
+ assert job.config_out.provider_id == "openai"
+ assert job.config_out.provider_model_id == "gpt-image-1"
+ assert job.config_out.base == BaseModelType.External
+ assert job.config_out.type == ModelType.ExternalImageGenerator
+ assert job.config_out.source_type == ModelSourceType.External
+
+
+def test_external_install_is_idempotent(mm2_installer: ModelInstallServiceBase) -> None:
+ first_job = mm2_installer.heuristic_import(
+ "external://openai/gpt-image-1",
+ config=ModelRecordChanges(name="Initial name"),
+ )
+ mm2_installer.wait_for_installs()
+
+ second_job = mm2_installer.heuristic_import(
+ "external://openai/gpt-image-1",
+ config=ModelRecordChanges(name="Updated name"),
+ )
+ mm2_installer.wait_for_installs()
+
+ assert first_job.status == InstallStatus.COMPLETED
+ assert second_job.status == InstallStatus.COMPLETED
+ assert first_job.config_out is not None
+ assert second_job.config_out is not None
+ assert first_job.config_out.key == second_job.config_out.key
+
+ external_models = mm2_installer.record_store.search_by_attr(
+ base_model=BaseModelType.External,
+ model_type=ModelType.ExternalImageGenerator,
+ )
+ assert len(external_models) == 1
+ assert isinstance(external_models[0], ExternalApiModelConfig)
+ assert external_models[0].name == "Updated name"
+
+
def test_delete_install(
mm2_installer: ModelInstallServiceBase, embedding_file: Path, mm2_app_config: InvokeAIAppConfig
) -> None:
diff --git a/tests/app/services/model_load/test_load_api.py b/tests/app/services/model_load/test_load_api.py
index c0760cd3ca..8f7f844972 100644
--- a/tests/app/services/model_load/test_load_api.py
+++ b/tests/app/services/model_load/test_load_api.py
@@ -4,6 +4,7 @@ import pytest
import torch
from diffusers import AutoencoderTiny
+from invokeai.app.invocations.model import ModelIdentifierField
from invokeai.app.services.invocation_services import InvocationServices
from invokeai.app.services.model_manager import ModelManagerServiceBase
from invokeai.app.services.shared.invocation_context import (
@@ -11,6 +12,7 @@ from invokeai.app.services.shared.invocation_context import (
InvocationContextData,
build_invocation_context,
)
+from invokeai.backend.model_manager.configs.external_api import ExternalApiModelConfig, ExternalModelCapabilities
from invokeai.backend.model_manager.load.load_base import LoadedModelWithoutConfig
from tests.backend.model_manager.model_manager_fixtures import * # noqa F403
@@ -78,6 +80,27 @@ def test_download_and_load(mock_context: InvocationContext) -> None:
assert loaded_model_1.model is loaded_model_2.model # should be cached copy
+def test_external_model_load_raises(
+ mock_context: InvocationContext, mm2_model_manager: ModelManagerServiceBase
+) -> None:
+ config = ExternalApiModelConfig(
+ key="external_test",
+ name="External Test",
+ provider_id="openai",
+ provider_model_id="gpt-image-1",
+ capabilities=ExternalModelCapabilities(modes=["txt2img"]),
+ )
+ mm2_model_manager.store.add_model(config)
+
+ model_field = ModelIdentifierField.from_config(config)
+
+ with pytest.raises(ValueError, match="External API models"):
+ mock_context.models.load(model_field)
+
+ with pytest.raises(ValueError, match="External API models"):
+ mock_context.models.load_by_attrs(name=config.name, base=config.base, type=config.type)
+
+
def test_download_diffusers(mock_context: InvocationContext) -> None:
model_path = mock_context.models.download_and_cache_model("stabilityai/sdxl-turbo")
assert (model_path / "model_index.json").exists()
diff --git a/tests/backend/model_manager/test_external_api_config.py b/tests/backend/model_manager/test_external_api_config.py
new file mode 100644
index 0000000000..943a5a7991
--- /dev/null
+++ b/tests/backend/model_manager/test_external_api_config.py
@@ -0,0 +1,54 @@
+import pytest
+from pydantic import ValidationError
+
+from invokeai.backend.model_manager.configs.external_api import (
+ ExternalApiModelConfig,
+ ExternalApiModelDefaultSettings,
+ ExternalImageSize,
+ ExternalModelCapabilities,
+)
+
+
+def test_external_api_model_config_defaults() -> None:
+ capabilities = ExternalModelCapabilities(modes=["txt2img"], supports_seed=True)
+
+ config = ExternalApiModelConfig(
+ name="Test External",
+ provider_id="openai",
+ provider_model_id="gpt-image-1",
+ capabilities=capabilities,
+ )
+
+ assert config.path == "external://openai/gpt-image-1"
+ assert config.source == "external://openai/gpt-image-1"
+ assert config.hash == "external:openai:gpt-image-1"
+ assert config.file_size == 0
+ assert config.default_settings is None
+ assert config.capabilities.supports_seed is True
+
+
+def test_external_api_model_capabilities_allows_aspect_ratio_sizes() -> None:
+ capabilities = ExternalModelCapabilities(
+ modes=["txt2img"],
+ allowed_aspect_ratios=["1:1"],
+ aspect_ratio_sizes={"1:1": ExternalImageSize(width=1024, height=1024)},
+ )
+
+ assert capabilities.aspect_ratio_sizes is not None
+ assert capabilities.aspect_ratio_sizes["1:1"].width == 1024
+
+
+def test_external_api_model_config_rejects_extra_fields() -> None:
+ with pytest.raises(ValidationError):
+ ExternalModelCapabilities(modes=["txt2img"], supports_seed=True, extra_field=True) # type: ignore
+
+ with pytest.raises(ValidationError):
+ ExternalApiModelDefaultSettings(width=512, extra_field=True) # type: ignore
+
+
+def test_external_api_model_config_validates_limits() -> None:
+ with pytest.raises(ValidationError):
+ ExternalModelCapabilities(modes=["txt2img"], max_images_per_request=0)
+
+ with pytest.raises(ValidationError):
+ ExternalApiModelDefaultSettings(width=0)
diff --git a/tests/conftest.py b/tests/conftest.py
index 980a99611a..92f42375ed 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -16,6 +16,7 @@ from invokeai.app.services.boards.boards_default import BoardService
from invokeai.app.services.bulk_download.bulk_download_default import BulkDownloadService
from invokeai.app.services.client_state_persistence.client_state_persistence_sqlite import ClientStatePersistenceSqlite
from invokeai.app.services.config.config_default import InvokeAIAppConfig
+from invokeai.app.services.external_generation.external_generation_default import ExternalGenerationService
from invokeai.app.services.image_records.image_records_sqlite import SqliteImageRecordStorage
from invokeai.app.services.images.images_default import ImageService
from invokeai.app.services.invocation_cache.invocation_cache_memory import MemoryInvocationCache
@@ -52,6 +53,7 @@ def mock_services() -> InvocationServices:
model_images=None, # type: ignore
model_manager=None, # type: ignore
download_queue=None, # type: ignore
+ external_generation=ExternalGenerationService({}, logger),
names=None, # type: ignore
performance_statistics=InvocationStatsService(),
session_processor=None, # type: ignore
diff --git a/tests/test_config.py b/tests/test_config.py
index 610162c075..960727b180 100644
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -266,6 +266,41 @@ def test_get_config_writing(patch_rootdir: None, monkeypatch: pytest.MonkeyPatch
InvokeAIArgs.did_parse = False
+def test_get_config_reads_external_api_keys_file(patch_rootdir: None, monkeypatch: pytest.MonkeyPatch, tmp_path: Path):
+ """Test that API keys are loaded from the dedicated api_keys.yaml file."""
+ InvokeAIArgs.did_parse = True
+ monkeypatch.setenv("INVOKEAI_ROOT", str(tmp_path))
+ (tmp_path / "invokeai.yaml").write_text("schema_version: 4.0.2\n")
+ (tmp_path / "api_keys.yaml").write_text("external_openai_api_key: openai-key\n")
+
+ get_config.cache_clear()
+ config = get_config()
+ get_config.cache_clear()
+
+ assert config.external_openai_api_key == "openai-key"
+
+ InvokeAIArgs.did_parse = False
+
+
+def test_get_config_env_vars_override_external_api_keys_file(
+ patch_rootdir: None, monkeypatch: pytest.MonkeyPatch, tmp_path: Path
+):
+ """Test that environment variables override values from api_keys.yaml."""
+ InvokeAIArgs.did_parse = True
+ monkeypatch.setenv("INVOKEAI_ROOT", str(tmp_path))
+ monkeypatch.setenv("INVOKEAI_EXTERNAL_OPENAI_API_KEY", "env-openai-key")
+ (tmp_path / "invokeai.yaml").write_text("schema_version: 4.0.2\n")
+ (tmp_path / "api_keys.yaml").write_text("external_openai_api_key: file-openai-key\n")
+
+ get_config.cache_clear()
+ config = get_config()
+ get_config.cache_clear()
+
+ assert config.external_openai_api_key == "env-openai-key"
+
+ InvokeAIArgs.did_parse = False
+
+
def test_deny_nodes(patch_rootdir):
# Allow integer, string and float, but explicitly deny float
conf = get_config()