Skip to content

feat(external): add custom OpenAI Images-compatible provider#9156

Open
BMFreed wants to merge 1 commit into
invoke-ai:mainfrom
BMFreed:feature/custom-openai-connection
Open

feat(external): add custom OpenAI Images-compatible provider#9156
BMFreed wants to merge 1 commit into
invoke-ai:mainfrom
BMFreed:feature/custom-openai-connection

Conversation

@BMFreed
Copy link
Copy Markdown

@BMFreed BMFreed commented May 11, 2026

Summary

Feature PR.

Adds a Custom OpenAI Images-compatible external provider for image generation. This gives users a manual configuration path for third-party providers that expose OpenAI-compatible Images API endpoints but do not share a reliable model/capability discovery format.

The PR adds:

  • custom_openai_images external provider adapter
  • API key and base URL config fields
  • manual custom model create/list/delete endpoints
  • External Providers UI controls for adding/removing custom model IDs
  • custom_openai_images_generation invocation and frontend graph wiring
  • shared conservative OpenAI Images-compatible capabilities with Gemini-style resolution presets
  • GPT Image 2 as an OpenAI external starter model

The custom provider intentionally does not implement dynamic model or capability discovery. Users add provider model IDs manually, and unsupported provider/model parameters may still be rejected by the upstream API at request time.

Related Issues / Discussions

N/A

QA Instructions

Tested locally with:

.venv/bin/python -m ruff check invokeai/app/api/dependencies.py invokeai/app/api/routers/app_info.py invokeai/app/invocations/external_image_generation.py invokeai/app/services/config/config_default.py invokeai/app/services/external_generation/providers/__init__.py invokeai/app/services/external_generation/providers/custom_openai_images.py invokeai/app/services/external_generation/providers/openai.py invokeai/backend/model_manager/starter_models.py tests/app/services/external_generation/test_external_provider_adapters.py

.venv/bin/python -m pytest tests/app/services/external_generation/test_external_provider_adapters.py -q

pnpm lint

pnpm exec vitest run src/features/nodes/util/graph/generation/buildExternalGraph.test.ts

git diff --check

Manual QA:

  1. Configure the Custom OpenAI Images-compatible provider with an API key and base URL.
  2. Add a provider model ID manually.
  3. Select the custom external model in the generation UI.
  4. Generate an image through the configured OpenAI-compatible endpoint.
  5. Change the custom provider base URL and confirm the warning modal appears when saved custom models exist.
  6. Confirm custom models allow manual width/height editing and expose the expected resolution presets.

Merge Plan

No special merge handling expected.

This PR changes external provider config, frontend API types, generated settings docs, and generated OpenAPI TypeScript types. The branch has been rebased onto current main, and schema.ts was regenerated after the rebase.

Redux slice changes only adjust selector/default handling for external custom models; no persisted state migration is required.

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable)
  • ❗Changes to a redux slice have a corresponding migration
  • Documentation added / updated (if applicable)
  • Updated What's New copy (if doing a release after this PR)

@github-actions github-actions Bot added api python PRs that change python files invocations PRs that change invocations backend PRs that change backend files services PRs that change app services frontend PRs that change frontend files python-tests PRs that change python tests docs PRs that change docs labels May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api backend PRs that change backend files docs PRs that change docs frontend PRs that change frontend files invocations PRs that change invocations python PRs that change python files python-tests PRs that change python tests services PRs that change app services

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant