Skip to content

v0.7.0 — Content-Length Fix + Image-to-Image Support

Choose a tag to compare

@elbruno elbruno released this 12 Apr 19:59
· 129 commits to main since this release
2d14db6

What's New

🔴 Bug Fix: Content-Length Header (#5)

  • Fixed
    o_content_length_header\ error affecting all BFL API requests since April 12, 2026
  • Replaced \JsonContent.Create()\ with \ByteArrayContent\ + explicit \Content-Length\ header
  • All cloud users should upgrade immediately

✨ Feature: Image-to-Image (img2img) Reference Images (#6)

  • New \ReferenceImages\ property on \ImageGenerationOptions\ for passing reference images (URL, base64, or Data URI)
  • Supports FLUX.2-pro (up to 8), FLUX.2-flex (up to 10), and FLUX.1-kontext-pro
  • New \AddReferenceImageFromFile()\ convenience method — reads a file and auto-converts to base64 Data URI
  • Microsoft.Extensions.AI integration via \AdditionalProperties["reference_images"]\ passthrough
  • Backward compatible — existing text-to-image calls work unchanged

🧪 Testing

  • 43 new tests covering both fixes
  • 260 total tests passing (net8.0 + net10.0)

Upgrade

\
dotnet add package ElBruno.Text2Image.Foundry --version 0.7.0
\\

Quick Start — img2img

\\csharp
var generator = new Flux2Generator(endpoint, apiKey, modelId: "FLUX.2-pro");

// From file path
var options = new ImageGenerationOptions();
options.AddReferenceImageFromFile("logo.png");
var result = await generator.GenerateAsync("A stylized version of this logo", options);

// From Data URI
var options2 = new ImageGenerationOptions
{
ReferenceImages = new List { "data:image/png;base64,..." }
};
var result2 = await generator.GenerateAsync("Generate a variation", options2);
\\

Full Changelog: v0.6.0...v0.7.0