Skip to content

fal i2i (FLUX.1 Kontext) — worker side#51

Open
mcarlson wants to merge 3 commits into
stagefrom
feat/studio-i2i-variations
Open

fal i2i (FLUX.1 Kontext) — worker side#51
mcarlson wants to merge 3 commits into
stagefrom
feat/studio-i2i-variations

Conversation

@mcarlson

Copy link
Copy Markdown
Collaborator

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
i2i variation (hidden in Part 1) produces a real re-imaged result.

Changes

  • flux-kontext-i2i model registered (fal-ai/flux-pro/kontext) with an
    inputImage flag; NormalizedImageInput gains imageUrl.
  • buildKontextInput (pure, unit-tested) — sends image_url + prompt
    (+ seed when ≥ 0), no image_size (Kontext output follows the source).
    submitImage routes to it when input.imageUrl is set, else buildFluxInput.
  • handleFalImageJob resolves source_dream_uuid → image URL via
    processImageForEndpoint for inputImage models; throws a clear error if the
    source is missing. Non-i2i image jobs are unchanged.

Tests / gates

  • Adds vitest as the worker's test runner; buildKontextInput is unit-tested
    (asserts the exact fal body: image_url, no image_size; seed omitted when < 0).
  • npm run build (tsc) clean.

Coordinated PRs (Part 2)

  • backend: feat/studio-i2i-variations — perImage pricing + MODEL_CATALOG + algorithm registration
  • frontend: #665 — enables the i2i variation method + Kontext payload

Live GPU run is deferred to post-merge on staging (a local run would race the
deployed stage worker on the shared falimage queue). Spec:
docs/superpowers/specs/2026-06-28-studio-i2i-variations-on-stage-design.md.

🤖 Generated with Claude Code

mcarlson and others added 3 commits June 30, 2026 14:58
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant