Repository navigation
fix(images): style transfer follow-ups from the cold read of #322 - #328
Conversation
A provider with no two-image call is refused before its key or base URL is looked for. A baseUrl, like an apiKey, needs a named provider: with none it reached the provider the environment picked, with that provider's key. FAL_BASE_URL sets Fal's base URL, as the other image providers' variables do theirs. A Fal status of COMPLETED that carries an error is the failure Fal reports, and fails with it. Replicate's and Fal's model lists name the FLUX.2 models and edit endpoints transferStyle runs on, and Flux Redux as a variation of one reference. The rule a custom base URL follows is stated per provider, and Fal's flux-2/edit defaults (PNG, no auto size) beside the other three endpoints'. Tests cover Replicate's failed predictions, Stability's fidelity and strength options and its 10 MiB sum, the global default, the provider prefix, Fal's edit completion and Replicate's pinned-version refusal.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reached
This review includes 9 billable files and costs up to $2.25.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 23 minutes for your next included review. View limit details
Comment |
Reviewer's GuideThis PR hardens style-transfer routing and validation, adds provider-specific base URL and model semantics, updates Replicate and Fal model/API handling, improves asynchronous failure reporting, and expands HTTP/provider tests and documentation for the corrected behavior. Sequence diagram for Fal style transfer failure handlingsequenceDiagram
participant Client
participant Fal as FalImageProvider
participant Queue as Fal Queue API
Client->>Fal: transferStyle()
Fal->>Queue: Submit two-image edit request
Queue-->>Fal: requestId
loop Poll status
Fal->>Queue: Get request status
Queue-->>Fal: IN_QUEUE or IN_PROGRESS
end
Queue-->>Fal: COMPLETED with error and error_type
Fal-->>Client: Throw Fal.ai request failed error
Flow diagram for style transfer routing and validationflowchart TD
A[transferStyle options] --> B{Named provider or prefixed model?}
B -- No --> C{Environment provider selected}
C --> D[Use provider environment base URL]
C --> E{baseUrl supplied?}
E -- Yes --> F[Refuse baseUrl without named provider]
E -- No --> G[Continue routing]
B -- Yes --> H[Resolve provider and model]
H --> I{Provider supports two-image transfer?}
I -- No --> J[Refuse before credentials and base URL]
I -- Yes --> K[Resolve apiKey and baseUrl]
D --> G
G --> L[Initialize provider]
K --> L
L --> M[Validate provider-specific model]
M --> N[Send source and reference images]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
PR Summary by QodoFix style transfer routing and Fal failure handling
AI Description
Diagram
High-Level Assessment
Files changed (9)
|
Code Review by Qodo
1. Listed Fal edit models fail to generate
|
## [0.13.62](v0.13.61...v0.13.62) (2026-10-12) ### fix * **images:** style transfer follow-ups from the cold read of #322 (#328) ([dc7fb4c](dc7fb4c))
Summary
A cold review of #322 (Opus 5.5) found no P0 to P2 and eight P3s. This takes seven of them. The eighth, Replicate data URLs over 1 MB, is recorded below, since it affects
editImageas much as style transfer.Refusal before credentials. A provider without a two-image call (BFL, MiniMax, OpenRouter, local Stable Diffusion) is now refused before its key or base URL is looked for. Before,
transferStyle({ provider: 'bfl' })said "No API key for bfl", and only once the key was set that bfl has no style transfer.baseUrlneeds a named provider, asapiKeydoes. With no provider named, abaseUrlreached the provider the environment picked, with that provider's key. WithREPLICATE_API_TOKENset,transferStyle({ baseUrl: 'https://gateway.example/v1', … })sent the Replicate token to that host.FAL_BASE_URLnow sets Fal's base URL, asREPLICATE_BASE_URL,STABILITY_BASE_URLandOPENAI_BASE_URLdo for theirs, so a provider picked from the environment can still be pointed elsewhere.Fal failures. Fal's queue status is
IN_QUEUE,IN_PROGRESSorCOMPLETED. A failed request completes, witherroranderror_type(https://fal.ai/docs/documentation/model-apis/inference/queue). ACOMPLETEDstatus that carries anerrornow fails with it, for every Fal call. The test answers in that shape, where the old case answeredFAILED, which Fal does not send.Model lists. Replicate's
listAvailableModelsnames the four FLUX.2 modelstransferStyleruns on, and Flux Redux as a variation of one reference. Fal's names the four FLUX.2 edit endpoints.Wording. The custom-endpoint rule is now stated per provider:
owner/name, never a pinned version;stable-image-style-transferalone.Fal's
flux-2/editdefaults (PNG, noautosize) are stated beside those of the other three endpoints.Tests. New cases in
transferStyle.http.test.ts:composition_fidelityandchange_strengthsent, and refused out of range;provider:prefix winning overprovider;/edit;baseUrlrefusal.Follow-up, not in this change: Replicate's guidance keeps data URLs under 1 MB (https://replicate.com/docs/topics/predictions/input-files). Uploading larger images through its files endpoint would apply to
editImage,upscaleImageandtransferStylealike.Linked issues
Follows #322.
Type of change
How this was verified
CI only; nothing was run on a workstation. The cases above run against the local server of
transferStyle.http.test.ts, which refuses any request outside it. The auto-order cases now point each provider at the server through its own base-URL variable.Migration notes
A
transferStyle()call that passedbaseUrlwith no provider named is now refused. Name the provider, or set the provider's base-URL variable.Summary by Sourcery
Harden image style transfer routing, validation, provider error handling, and documentation across supported providers.
Bug Fixes:
Enhancements:
Documentation:
Tests: