fal i2i (FLUX.1 Kontext) — worker side#51
Open
mcarlson wants to merge 3 commits into
Open
Conversation
Adds imageUrl to NormalizedImageInput and inputImage flag to ImageModelConfig for image-to-image models; registers the fal-ai/flux-pro/kontext endpoint. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
buildKontextInput sends image_url + prompt (no image_size); submitImage routes to it when input.imageUrl is set, else buildFluxInput. Adds vitest as the worker's test runner and unit-tests the pure builder. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
When the model has inputImage set, require source_dream_uuid and resolve it via processImageForEndpoint into input.imageUrl before submit. Non-i2i image jobs are unaffected (imageUrl stays undefined -> buildFluxInput). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fal i2i (FLUX.1 Kontext) — worker side (Part 2)
Adds the worker's image-to-image submit path for FLUX.1 Kontext so the studio
i2ivariation (hidden in Part 1) produces a real re-imaged result.Changes
flux-kontext-i2imodel registered (fal-ai/flux-pro/kontext) with aninputImageflag;NormalizedImageInputgainsimageUrl.buildKontextInput(pure, unit-tested) — sendsimage_url+prompt(+
seedwhen ≥ 0), noimage_size(Kontext output follows the source).submitImageroutes to it wheninput.imageUrlis set, elsebuildFluxInput.handleFalImageJobresolvessource_dream_uuid→ image URL viaprocessImageForEndpointforinputImagemodels; throws a clear error if thesource is missing. Non-i2i image jobs are unchanged.
Tests / gates
buildKontextInputis unit-tested(asserts the exact fal body:
image_url, noimage_size; seed omitted when< 0).npm run build(tsc) clean.Coordinated PRs (Part 2)
feat/studio-i2i-variations— perImage pricing + MODEL_CATALOG + algorithm registrationLive GPU run is deferred to post-merge on staging (a local run would race the
deployed
stageworker on the sharedfalimagequeue). Spec:docs/superpowers/specs/2026-06-28-studio-i2i-variations-on-stage-design.md.🤖 Generated with Claude Code