Commit graph

1 commit

Author SHA1 Message Date
alt-glitch
80d1400ce6 feat(image_generate): support image input for image-to-image / editing
image_generate was text-to-image only. Add an optional `image_urls` param
(string or list of: http(s) URL, data: URI, or local file path) that routes
to the active FAL model's sibling edit endpoint when it has one.

- Each edit-capable catalog model declares an `edit` block with the edit
  endpoint id, the native image key, single-vs-multi cardinality, max images,
  and the endpoint's OWN accepted-param whitelist. Edit and generate endpoints
  diverge (e.g. flux-2-pro/edit rejects num_inference_steps/guidance_scale),
  so edit payloads are built from the edit whitelist, not inherited from
  generate — every generated payload is a strict subset of the real FAL
  OpenAPI schema.
- Edits never force an output size (FAL infers it from the input) and never
  chain the upscaler.
- Local paths are encoded to base64 data URIs via the vision pipeline's
  size+dimension-aware encoder before submission (FAL can't read host files).
- Models without an edit endpoint return a `note` in the result instead of
  silently generating from scratch; a configured non-FAL plugin provider is
  noted when image input forces the in-tree FAL edit path.

Wired endpoints (verified against FAL OpenAPI): flux-2/klein/9b/edit,
flux-2-pro/edit, nano-banana-pro/edit, gpt-image-1.5/edit, openai/gpt-image-2/edit,
qwen-image-edit (single-image, singular image_url key).

Text-to-image path is unchanged when image_urls is omitted.
2026-06-15 16:31:26 +05:30