mirror of
https://github.com/AventurasTeam/Aventuras.git
synced 2026-10-23 07:00:45 +00:00
## Summary
Every image backend now generates through the AI SDK's `generateImage`
(`sdkImage.ts`), with one request path for debug logging, abort and 429
retry. Before, Google went through the SDK while the rest used
hand-written requests, and ComfyUI ran on its own SDK plus a Tauri
WebSocket plugin.
- OpenAI, OpenAI Compatible, OpenRouter and Google use their SDK
providers. Pollinations and Z.AI reuse the OpenAI Compatible helper.
- NanoGPT, A1111 and ComfyUI have no usable SDK provider, so each gets a
small custom `ImageModelV4` (`nanogptImage.ts`, `a1111Image.ts`,
`comfyImage.ts`).
- ComfyUI now submits a workflow and polls `/api/jobs/{id}` over plain
HTTP, and sends a cancel for the job if the user aborts or the app gives
up. It needs ComfyUI 0.26.0 or later (`MIN_COMFYUI_VERSION`); older
servers are refused with a message, and a server that can't report its
version is let through.
- `@saintno/comfyui-sdk`, `@tauri-apps/plugin-websocket`,
`tauri-plugin-websocket` and `buffer` are removed.
## User-facing changes
- **Chutes image provider removed.** Chutes text generation is
unchanged.
- **New OpenAI Compatible image provider.** Base URL is required; API
key is optional.
- **Zhipu is now Z.AI** and defaults to `api.z.ai`.
- **Model discovery fails loudly.** A failed model list throws and the
settings form shows the error and clears the old list. Before, it
silently fell back to a built-in list.
- **Missing credentials are reported by kind** (profile, API key, base
URL) in portrait generation and in the image tools, instead of always
saying "API key required".
- **ComfyUI needs 0.26.0+.**
## Migration 042 (`042_image_profiles.sql`)
Runs in SQL and replaces `migrateImageProfileDefaults` in the settings
store. It does four things:
- Pins `zhipu` API profiles that have no base URL to `open.bigmodel.cn`,
the host they were already using.
- Builds image profiles from legacy image settings that name an API
profile and a model, only when no image profile exists yet.
- Moves `openai` profiles that point at a proxy to OpenAI Compatible.
- Moves every `chutes` image profile to OpenAI Compatible.
`src-tauri/src/image_profiles.rs` holds the Rust tests for it.
## Changes
**Transport**
- `createSdkFetch` and `createPollSdkFetch` (`sdkFetch.ts`): the Tauri
transport for SDK image models, with binary and multipart bodies, the
request guard, debug logging, and redirects returned to the SDK for it
to check. The poll variant keeps a ComfyUI generation's requests in one
debug entry.
- A1111 and ComfyUI send all requests through `createSdkFetch`.
- 429 retry for image models (`retryOn429ImageMiddleware`), with
`Retry-After` capped at `IMAGE_TIMEOUT_DEFAULT`.
- Header redaction (including the Gemini key) and base64 scrubbing in
debug logs.
**Providers and registry**
- `registry.ts` declares labels, API key mode and base URL mode once per
provider (`IMAGE_PROVIDER_LABELS`, `PROVIDER_API_KEY`,
`PROVIDER_BASE_URL`). The images settings tab and `missingCredential`
read them.
- NanoGPT sends the model the closest aspect ratio it lists.
- Model lists are validated with zod (`parseModelList.ts`).
**Docs**
- The Images section of `docs/architecture/overview.md` is rewritten for
the SDK path.
- `docs/development/testing.md` and `ios-build-target.md` are updated.
## Changes outside the main purpose
These touch code that was already on `master`:
- `fetch.ts` (`createTimeoutFetch`): the debug-log helpers move to
`sdk/providers/debugLog.ts` and are typed instead of `any`. Behaviour is
unchanged, and `debugLog` and the body-merge/usage-patch logic gain
tests.
- `sleep` moves from `retryMiddleware.ts` to `utils/async.ts`.
- The debug window replaces an entry in place when the store re-emits
it, instead of appending a duplicate.
- `supportsImageGeneration` uses `Object.hasOwn`, so an inherited key
like `constructor` is not a supported provider.
- `formatImageSize` returns a template-literal type, and the unused
`base64ImageMime` is removed.
## Test plan
- [x] `aubr check`, `aube test`, `aubr lint`
- [x] `cargo test` in `src-tauri` (migration 042 tests)
- [x] Generate an image with each provider you have access to, including
a reference image where the provider supports it.
- [ ] ComfyUI: generate, cancel mid-job and confirm the job is cancelled
on the server, and check that a pre-0.26.0 server is refused.
- [ ] Upgrade a database that has `openai` proxy, `chutes` and `zhipu`
image profiles and confirm each lands as described above.
- [ ] Android release build (not yet checked).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01Kz2WsAnqEzPZv9Sj8u9VG4
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **New Features**
* Added OpenAI-compatible image generation and expanded image-generation
support for ComfyUI, A1111, NanoGPT, and OpenRouter.
* Existing image-generation settings are migrated to image profiles,
with provider-specific defaults applied where needed.
* Image settings show the credential fields required by each provider,
and errors identify missing credentials.
* **Improvements**
* ComfyUI image generation requires version 0.26.0 or later; image
requests can run for up to five minutes.
* Debug logs update existing entries instead of duplicating them.
* **Changes**
* Chutes is no longer available for image generation.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| ci-caching.md | ||
| ios-background-generation.md | ||
| ios-build-target.md | ||
| platform-support.md | ||
| release.md | ||
| shadcn-svelte.md | ||
| testing.md | ||