Skip to content

docs: add docs for image editing and image variations#1653

Open
Radheshg04 wants to merge 1 commit intomainfrom
02-14-docs_add_docs_for_image_editing_and_image_variations
Open

docs: add docs for image editing and image variations#1653
Radheshg04 wants to merge 1 commit intomainfrom
02-14-docs_add_docs_for_image_editing_and_image_variations

Conversation

@Radheshg04
Copy link
Contributor

@Radheshg04 Radheshg04 commented Feb 14, 2026

Summary

Added support for Image Edit and Image Variation operations in the provider compatibility documentation, with detailed implementation for Replicate's Image Edit functionality.

Changes

  • Added "Image Edit" and "Image Variation" columns to the provider compatibility table
  • Updated the provider compatibility status for various providers to reflect support for these operations
  • Added detailed documentation for Replicate's Image Edit API implementation, including:
    • Parameter mapping between Bifrost and Replicate
    • Field mapping by model type
    • Request/response examples
    • Streaming behavior

Type of change

  • Bug fix
  • Feature
  • Refactor
  • Documentation
  • Chore/CI

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Plugins
  • UI (Next.js)
  • Docs

How to test

Test the Image Edit functionality with Replicate:

# Test image edit with Replicate
curl -X POST http://localhost:8080/v1/images/edits \
  -H "Content-Type: application/json" \
  -d '{
    "model": "replicate/black-forest-labs/flux-fill-pro",
    "input": {
      "prompt": "Replace the sky with a starry night",
      "images": [
        { "image": "<base64-or-data-uri>" }
      ]
    },
    "output_format": "webp",
    "num_inference_steps": 28
  }'

Breaking changes

  • No

Related issues

N/A

Security considerations

No new security implications.

Checklist

  • I read docs/contributing/README.md and followed the guidelines
  • I added/updated tests where appropriate
  • I updated documentation where needed
  • I verified builds succeed (Go and UI)
  • I verified the CI pipeline passes locally if applicable

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 14, 2026

📝 Walkthrough

Summary by CodeRabbit

  • Documentation
    • Expanded provider capability matrix with Image Edit and Image Variation API columns across all supported providers
    • Added comprehensive Image Edit operation documentation for Replicate with endpoint details, parameter mapping, and code examples
    • Updated notes section defining new image-related capabilities

Walkthrough

Documentation expanded to include image editing and variation capabilities across the provider matrix. Added new columns for Image Edit and Image Variation to the capability overview. Replicate provider documentation updated with comprehensive Image Edit section, replacing the Files API section and adjusting subsequent section numbering.

Changes

Cohort / File(s) Summary
Provider Capability Matrix
docs/providers/supported-providers/overview.mdx
Added Image Edit and Image Variation columns (including streaming variants) to provider capability matrix. Updated all provider rows with new capability indicators. Expanded notes section with definitions and explanations of image-related endpoints.
Replicate Provider Documentation
docs/providers/supported-providers/replicate.mdx
Replaced Files API section with comprehensive Image Edit section including endpoint details, parameter mapping, field mapping, examples (gateway and SDK), response format, and streaming behavior. Adjusted section numbering for subsequent sections (List Models now section 7 instead of 6).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Images now dance in edit's gentle gleam,
New columns bloom across the provider's theme,
From Files we shift to variations bright,
Documentation serves the code just right!

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main changes: adding documentation for image editing and image variation support across providers.
Description check ✅ Passed The description follows the required template with all key sections completed: summary, changes, type of change, affected areas, how to test, breaking changes, and checklist items marked appropriately.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 02-14-docs_add_docs_for_image_editing_and_image_variations

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions
Copy link
Contributor

🧪 Test Suite Available

This PR can be tested by a repository admin.

Run tests for PR #1653

@Radheshg04 Radheshg04 marked this pull request as ready for review February 14, 2026 13:57
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In `@docs/providers/supported-providers/overview.mdx`:
- Around line 18-38: The overview table is missing a row for Replicate; add a
new row for Replicate (`replicate/<model>`) to the providers matrix and populate
each column to match the capabilities documented in replicate.mdx (e.g., enable
✅ for Models, Text, Chat, Responses, Images, Image Edit/Image Variation,
Files/List Models where replicate.mdx shows support and use ❌ for features not
supported or streaming not present); ensure the row uses the same pipe-delimited
format as the other provider rows and mirrors the exact support state from
replicate.mdx for every column (Text (stream), Chat (stream), Responses
(stream), Images (stream), Image Edit (stream), Embeddings, TTS/STT, Batch,
Count tokens, etc.).

In `@docs/providers/supported-providers/replicate.mdx`:
- Around line 470-475: The table under the Image Generation section uses
abbreviated model names; update every model entry to the full Replicate
identifier format (owner/model) for consistency and clarity—e.g., replace
occurrences like `flux-1.1-pro-ultra`, `flux-kontext-pro`, `flux-kontext-max`,
`flux-dev`, `flux-fill-pro`, `flux-dev-lora`, `flux-krea-dev`, etc. with their
fully qualified forms (for example `black-forest-labs/flux-1.1-pro-ultra`,
`black-forest-labs/flux-kontext-pro`, `black-forest-labs/flux-kontext-max`,
`black-forest-labs/flux-dev`, etc.) so the table rows for `image_prompt`,
`input_image`, `image`, and `input_images` use owner/model identifiers
consistently.
- Around line 525-535: The documentation uses event type names
"image_edit.partial_image" and "image_edit.completed" but the code
(core/schemas/images.go) defines events as "n.partial_image" and "n.completed";
update the docs to use the exact event type strings "n.partial_image" for
partial chunks and "n.completed" for completion so the documentation matches the
implementation (ensure references in the Response/Streaming sections and any
examples are changed accordingly).
🧹 Nitpick comments (3)
docs/providers/supported-providers/overview.mdx (1)

18-18: Missing "Image Variation (stream)" column in the provider matrix.

The table includes both non-streaming and streaming columns for Image Edit (Image Edit / Image Edit (stream)) but only a non-streaming column for Image Variation. For consistency — and to future-proof the table if any provider adds streaming support for variations — consider adding an Image Variation (stream) column (all for now), or add a note explaining why the streaming column is intentionally omitted.

docs/providers/supported-providers/replicate.mdx (2)

486-499: Curl example nests images inside input but places output_format and num_inference_steps at the top level.

This is consistent with the Image Generation curl example (line 368), so the gateway API apparently accepts a flat structure for params. However, the parameter mapping table (lines 453-464) prefixes these with params.* (e.g., params.output_format), which could confuse readers about where these fields go in a raw HTTP request vs. the Go SDK.

Consider adding a brief note (similar to what's done in the Chat Completions section) clarifying that for the gateway/curl interface, parameters are passed at the top level of the JSON body, while the params.* notation in the mapping table reflects the Go SDK structure.


445-447: Anchor link #field-mapping-by-model-1 in the introductory paragraph may be fragile.

Line 447 links to #field-mapping-by-model-1 (the auto-generated suffix for the second "Field Mapping by Model" heading). If any heading is added or reordered above this section, the numeric suffix will change and break the link. Consider giving the Image Edit field mapping heading a unique name (e.g., ### Image Edit Field Mapping by Model) or using an explicit anchor/id to make the link resilient.

Comment on lines +18 to +38
| Provider | Models | Text | Text (stream) | Chat | Chat (stream) | Responses | Responses (stream) | Images | Images (stream) | Image Edit | Image Edit (stream) | Image Variation | Embeddings | TTS | TTS (stream) | STT | STT (stream) | Files | Batch | Count tokens |
|----------|--------|------|----------------|------|---------------|-----------|--------------------|--------|-----------------|------------|---------------------|-----------------|------------|-----|-------------|-----|--------------|-------|-------|--------------|
| Anthropic (`anthropic/<model>`) | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ✅ | ✅ |
| Azure (`azure/<model>`) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ❌ |
| Bedrock (`bedrock/<model>`) | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ✅ | ✅ | ❌ |
| Cerebras (`cerebras/<model>`) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| Cohere (`cohere/<model>`) | ✅ | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ |
| Elevenlabs (`elevenlabs/<model>`) | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
| Gemini (`gemini/<model>`) | ✅ | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| Groq (`groq/<model>`) | ✅ | 🟡 | 🟡 | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| Hugging Face (`huggingface/<model>`) | ✅ | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ |
| Mistral (`mistral/<model>`) | ✅ | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ❌ | ✅ | ✅ | ❌ | ❌ | ❌ |
| Nebius (`nebius/<model>`) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| Ollama (`ollama/<model>`) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| OpenAI (`openai/<model>`) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| OpenRouter (`openrouter/<model>`) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| Parasail (`parasail/<model>`) | ✅ | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| Perplexity (`perplexity/<model>`) | ✅ | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| SGL (`sgl/<model>`) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| Vertex AI (`vertex/<model>`) | ✅ | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ |
| xAI (`xai/<model>`) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Replicate is absent from the provider support matrix.

The replicate.mdx file documents multiple supported operations (Chat, Responses, Text, Image Generation, Image Edit, Files, List Models), yet Replicate does not appear as a row in the overview table. This may be a pre-existing gap, but since this PR adds Image Edit/Variation columns and Replicate is the first provider documented for Image Edit, it would be a good time to add a Replicate row.

#!/bin/bash
# Check if Replicate is mentioned anywhere in the overview file
rg -in 'replicate' docs/providers/supported-providers/overview.mdx
🤖 Prompt for AI Agents
In `@docs/providers/supported-providers/overview.mdx` around lines 18 - 38, The
overview table is missing a row for Replicate; add a new row for Replicate
(`replicate/<model>`) to the providers matrix and populate each column to match
the capabilities documented in replicate.mdx (e.g., enable ✅ for Models, Text,
Chat, Responses, Images, Image Edit/Image Variation, Files/List Models where
replicate.mdx shows support and use ❌ for features not supported or streaming
not present); ensure the row uses the same pipe-delimited format as the other
provider rows and mirrors the exact support state from replicate.mdx for every
column (Text (stream), Chat (stream), Responses (stream), Images (stream), Image
Edit (stream), Embeddings, TTS/STT, Batch, Count tokens, etc.).

Comment on lines +470 to +475
| Field | Models |
|-------|--------|
| `image_prompt` | `black-forest-labs/flux-1.1-pro`, `flux-1.1-pro-ultra`, `flux-pro`, `flux-1.1-pro-ultra-finetuned` |
| `input_image` | `black-forest-labs/flux-kontext-pro`, `flux-kontext-max`, `flux-kontext-dev` |
| `image` | `black-forest-labs/flux-dev`, `flux-fill-pro`, `flux-dev-lora`, `flux-krea-dev` |
| `input_images` | All other models (default) |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Inconsistent model name formatting in the field mapping table.

The Image Generation section (lines 351-355) uses fully qualified model names (e.g., black-forest-labs/flux-1.1-pro-ultra, black-forest-labs/flux-kontext-pro), but this table abbreviates them (e.g., flux-1.1-pro-ultra, flux-kontext-max). Since these are Replicate model identifiers, use the full owner/model format for consistency and to avoid ambiguity.

Proposed fix
 | Field | Models |
 |-------|--------|
-| `image_prompt` | `black-forest-labs/flux-1.1-pro`, `flux-1.1-pro-ultra`, `flux-pro`, `flux-1.1-pro-ultra-finetuned` |
-| `input_image` | `black-forest-labs/flux-kontext-pro`, `flux-kontext-max`, `flux-kontext-dev` |
-| `image` | `black-forest-labs/flux-dev`, `flux-fill-pro`, `flux-dev-lora`, `flux-krea-dev` |
+| `image_prompt` | `black-forest-labs/flux-1.1-pro`<br/>`black-forest-labs/flux-1.1-pro-ultra`<br/>`black-forest-labs/flux-pro`<br/>`black-forest-labs/flux-1.1-pro-ultra-finetuned` |
+| `input_image` | `black-forest-labs/flux-kontext-pro`<br/>`black-forest-labs/flux-kontext-max`<br/>`black-forest-labs/flux-kontext-dev` |
+| `image` | `black-forest-labs/flux-dev`<br/>`black-forest-labs/flux-fill-pro`<br/>`black-forest-labs/flux-dev-lora`<br/>`black-forest-labs/flux-krea-dev` |
 | `input_images` | All other models (default) |
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
| Field | Models |
|-------|--------|
| `image_prompt` | `black-forest-labs/flux-1.1-pro`, `flux-1.1-pro-ultra`, `flux-pro`, `flux-1.1-pro-ultra-finetuned` |
| `input_image` | `black-forest-labs/flux-kontext-pro`, `flux-kontext-max`, `flux-kontext-dev` |
| `image` | `black-forest-labs/flux-dev`, `flux-fill-pro`, `flux-dev-lora`, `flux-krea-dev` |
| `input_images` | All other models (default) |
| Field | Models |
|-------|--------|
| `image_prompt` | `black-forest-labs/flux-1.1-pro`<br/>`black-forest-labs/flux-1.1-pro-ultra`<br/>`black-forest-labs/flux-pro`<br/>`black-forest-labs/flux-1.1-pro-ultra-finetuned` |
| `input_image` | `black-forest-labs/flux-kontext-pro`<br/>`black-forest-labs/flux-kontext-max`<br/>`black-forest-labs/flux-kontext-dev` |
| `image` | `black-forest-labs/flux-dev`<br/>`black-forest-labs/flux-fill-pro`<br/>`black-forest-labs/flux-dev-lora`<br/>`black-forest-labs/flux-krea-dev` |
| `input_images` | All other models (default) |
🤖 Prompt for AI Agents
In `@docs/providers/supported-providers/replicate.mdx` around lines 470 - 475, The
table under the Image Generation section uses abbreviated model names; update
every model entry to the full Replicate identifier format (owner/model) for
consistency and clarity—e.g., replace occurrences like `flux-1.1-pro-ultra`,
`flux-kontext-pro`, `flux-kontext-max`, `flux-dev`, `flux-fill-pro`,
`flux-dev-lora`, `flux-krea-dev`, etc. with their fully qualified forms (for
example `black-forest-labs/flux-1.1-pro-ultra`,
`black-forest-labs/flux-kontext-pro`, `black-forest-labs/flux-kontext-max`,
`black-forest-labs/flux-dev`, etc.) so the table rows for `image_prompt`,
`input_image`, `image`, and `input_images` use owner/model identifiers
consistently.

Comment on lines +525 to +535
### Response

Same as Image Generation: single URL → `data[0].url`, array of URLs → `data[i].url`, or data URIs. Response shape is `BifrostImageGenerationResponse` with `data[].url` or `data[].b64_json`.

### Streaming

Image edit streaming is supported. Events use the same prediction log stream as image generation:

- **Partial chunks**: `type: "image_edit.partial_image"` with `b64_json` (or data URI) until completion.
- **Completed**: `type: "image_edit.completed"` with final image and usage.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# Search for image_edit event type strings in the codebase
rg -rn 'image_edit\.partial_image|image_edit\.completed' --type go

Repository: maximhq/bifrost

Length of output: 216


🏁 Script executed:

# Search for image_edit and prediction log references
rg -rn 'image_edit|prediction.log' --type go | head -50

Repository: maximhq/bifrost

Length of output: 526


🏁 Script executed:

# Search for event type definitions and streaming related code
rg -rn 'output.*done.*error|event.*type' --type go | head -50

Repository: maximhq/bifrost

Length of output: 3813


Documentation event types image_edit.partial_image and image_edit.completed do not match the codebase definitions.

The actual event types defined in core/schemas/images.go are n.partial_image and n.completed, not image_edit.partial_image and image_edit.completed. Update the documentation to use the correct event type names to match the implementation.

🤖 Prompt for AI Agents
In `@docs/providers/supported-providers/replicate.mdx` around lines 525 - 535, The
documentation uses event type names "image_edit.partial_image" and
"image_edit.completed" but the code (core/schemas/images.go) defines events as
"n.partial_image" and "n.completed"; update the docs to use the exact event type
strings "n.partial_image" for partial chunks and "n.completed" for completion so
the documentation matches the implementation (ensure references in the
Response/Streaming sections and any examples are changed accordingly).

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