Skip to content

feat(external): add Atlas Cloud image provider - #9476

Open
binyangzhu000-sudo wants to merge 3 commits into
invoke-ai:mainfrom
binyangzhu000-sudo:codex/atlascloud-external-provider
Open

feat(external): add Atlas Cloud image provider#9476
binyangzhu000-sudo wants to merge 3 commits into
invoke-ai:mainfrom
binyangzhu000-sudo:codex/atlascloud-external-provider

Conversation

@binyangzhu000-sudo

Copy link
Copy Markdown

Summary

Adds Atlas Cloud as a first-class external image generation provider.

  • Implements the Atlas Cloud asynchronous submit, poll, and image download flow with rate-limit and response validation.
  • Adds API key/base URL configuration, dependency registration, and provider availability reporting.
  • Adds an Atlas Cloud image generation invocation and a FLUX.1 Schnell starter model.
  • Regenerates the frontend API schema and adds focused provider contract tests.

Related Issues / Discussions

None.

QA Instructions

  • uv tool run ruff@0.11.2 format --check <changed Python files>
  • uv tool run ruff@0.11.2 check <changed Python files>
  • python -m compileall <changed Python files>
  • pytest tests/app/services/external_generation/test_atlascloud_provider.py tests/app/services/external_generation/test_seedream_provider.py tests/app/services/external_generation/test_alibabacloud_provider.py tests/app/services/external_generation/test_external_provider_adapters.py -q (38 passed)
  • python scripts/generate_openapi_schema.py | pnpm typegen (deterministic on a second run)
  • pnpm lint:tsc
  • pnpm exec prettier --check src/services/api/schema.ts
  • python -m pip wheel . --no-deps (wheel built successfully)

Merge Plan

No special merge steps 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)

Signed-off-by: binyangzhu000-sudo <224954946+binyangzhu000-sudo@users.noreply.github.com>
@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 labels Aug 7, 2026
@lstein lstein self-assigned this Aug 8, 2026
@lstein lstein added the 7.0.0 label Aug 8, 2026
@lstein lstein moved this to 7.0 Theme: Tabbed Layout UI in Invoke - Community Roadmap Aug 8, 2026

@lstein lstein left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since Atlas Cloud supports many popular image generation models, why don't you add support for multiple models? It doesn't cost the user anything. Otherwise this PR is overkill for adding a single model.

…rnal-provider

# Conflicts:
#	invokeai/frontend/web/src/services/api/schema.ts
Atlas Cloud fronts many popular image models behind one endpoint, so ship a
set of them rather than a single model.

- Register 11 more text-to-image starter models across 8 vendors (FLUX.1 Dev,
  FLUX.2 Pro, Qwen Image 3.0, Z-Image Turbo, MAI-Image-2.5, Ideogram V4
  Turbo/Quality, Krea 2 Turbo, HiDream O1 1.5, Grok Imagine Image 2.0 and
  Nano Banana 2), each with the capabilities its upstream model reports.
- Record per-model request schemas in the provider: these models spell output
  dimensions as "size", "image_size" or "aspect_ratio", and batch size as
  "num_images", "n" or not at all, so a single payload shape does not fit them
  all. Unlisted models keep using the explicit-size schema, so custom installs
  via `external://atlascloud/<model_id>` are unaffected.
- Cover every request-schema variant with tests.
@binyangzhu000-sudo

Copy link
Copy Markdown
Author

Thanks for the review — that's a fair point, a single model didn't justify the provider. I pushed follow-up commit 81d2ffd which addresses it:

  • Registered 11 more text-to-image models across 8 vendors, so the provider now ships 12: FLUX.1 Schnell/Dev, FLUX.2 Pro, Qwen Image 3.0, Z-Image Turbo, MAI-Image-2.5, Ideogram V4 Turbo/Quality, Krea 2 Turbo, HiDream O1 1.5, Grok Imagine Image 2.0 and Nano Banana 2. Each entry declares the capabilities its upstream model actually reports (max batch size, seed support, size limits, allowed aspect ratios).
  • Recorded per-model request schemas in the provider. This turned out to be necessary rather than cosmetic: these models don't share one request shape. Output dimensions arrive as an explicit size string, a named image_size preset, or an aspect_ratio, and batch size is spelled num_images, n, or is unsupported. _build_payload now sends only the fields the target model accepts, so adding a model is a table entry. Models not in the table keep using the explicit-size schema, so custom installs via external://atlascloud/<model_id> are unaffected.
  • Merged main to clear the schema.ts conflict; the PR is mergeable again.

Validation:

  • pytest tests/app/services/external_generation/ — 78 passed (20 new tests, one per request-schema variant, plus the size-preset and aspect-ratio mapping cases).
  • ruff check and ruff format --check clean on the three changed files.
  • Cross-checked each registered model's generated payload against that model's published request schema (12 models × 7 different width/height inputs): no unknown fields, no missing required fields, and every enum-valued field within its allowed set. No paid generation calls were made — this compares against the published schemas, not live output.

Notes:

  • Aspect-ratio entries are limited to ratios already in lowest terms, because the capability check reduces the requested dimensions before comparing. That's why 21:9 isn't offered for Nano Banana 2 even though the upstream model accepts it — 21:9 reduces to 7:3 and would fail the check for the 2K/4K presets.
  • The img2img/inpaint modes remain unadvertised; every model here is registered as txt2img only, matching what I verified.

@binyangzhu000-sudo

Copy link
Copy Markdown
Author

Thanks for the review — that's a fair point, so I pushed follow-up commit 81d2ffd to ship a set of models instead of a single one.

Now 12 Atlas Cloud starter models across 8 vendors: FLUX.1 Schnell/Dev, FLUX.2 Pro, Qwen Image 3.0, Z-Image Turbo, MAI-Image-2.5, Ideogram V4 Turbo/Quality, Krea 2 Turbo, HiDream O1 1.5, Grok Imagine Image 2.0 and Nano Banana 2.

The models don't share one request shape, which is why this needed a bit more than extra table rows:

  • Output dimensions arrive as an explicit size string, a named image_size preset, or an aspect_ratio.
  • Batch size is spelled num_images, n, or isn't supported.
  • Seed support varies per model.

So the provider now records each model's request schema and builds the payload from it. Models not in that table fall back to the explicit-size schema, so custom external://atlascloud/<model_id> installs behave exactly as before. Each starter model's declared capabilities (seed support, max images, size limits, allowed aspect ratios) mirror what its upstream model actually reports.

This commit also merges current main, so the branch is no longer conflicting.

Validation

  • pytest tests/app/services/external_generation/ — 78 passed, including 20 new tests covering every request-schema variant.
  • ruff check and ruff format --check — clean.
  • Cross-checked each registered model's generated payload against Atlas Cloud's published per-model OpenAPI schemas over 7 different width/height inputs: no unknown fields, no missing required fields, no out-of-enum values.

One deliberate omission: I left out the 21:9 aspect ratio for Nano Banana 2. Invoke's capability check reduces the requested dimensions to lowest terms before comparing, which turns 21:9 into 7:3 and would reject the ratio; every listed ratio is already in lowest terms so the 1K/2K/4K presets all validate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

7.0.0 api backend PRs that change backend files 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

Status: 7.0 Theme: Tabbed Layout UI

Development

Successfully merging this pull request may close these issues.

2 participants