FusionBrain 1.0.1

dotnet add package FusionBrain --version 1.0.1                
NuGet\Install-Package FusionBrain -Version 1.0.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FusionBrain" Version="1.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FusionBrain --version 1.0.1                
#r "nuget: FusionBrain, 1.0.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install FusionBrain as a Cake Addin
#addin nuget:?package=FusionBrain&version=1.0.1

// Install FusionBrain as a Cake Tool
#tool nuget:?package=FusionBrain&version=1.0.1                

Non official fusion brain API client.

NuGet


For actual official documentation please refer to https://fusionbrain.ai/docs/en/doc/api-dokumentaciya/


Features

  1. Getting available models - GetModelsAsync.
  2. Generation image
    1. Auto polling result status - GenerateImageAsync
    2. Manual pooling result status - StartGenerateAsync + GetGenerationStatusAsync

Steps for start

  1. Configure ImageGeneratorSettings.

    1. BaseUrl and Authentication are mandatory.
    2. CheckGeneration are not mandatory with default values (Attempts = 10 + Delay = 10 seconds)
  2. Create instance of IImageGeneratorClient.

    1. Use can use DI way or manually configuring, meanwhile you can use ConfigureImageGeneratorHttpClient HttpClient extension for simplify authentication configuration.
  3. Get existing models by GetModelsAsync method

  4. Use one of model for creating GeneratingImage

    1. Example:
      var generatingImage = new GeneratingImage(
          query: "<YOUR REQUEST>",
          excludingResultQuery: "<YOUR NEGATIVE PROMPT>",
          size: Size.Size1024X1024,
          numberOfImages: 1, // At now supporting only 1 image per request.
          mode: GenerationMode.Generate, // At now supporting only 1 mode - "GENERATE".
          model: model, // Model from step 4
          style: Style.Anime // One of style, available styles by API - https://cdn.fusionbrain.ai/static/styles/api)
      
  5. Make request with auto or manual pooling result.

    1. Auto.
      1. Use IImageGeneratorClient.GenerateAsync(), result will be collection of images with processingId and content byte array.
    2. Manual
      1. Use IImageGeneratorClient.StartGenerateAsync(), result will be status with processing id and array of by arrays of case Done status (one of which is image byte array content).
      2. Depending on your application's polling configuration use IImageGeneratorClient.GetGenerationStatusAsync() to get actual status generation.
        1. Additionally u can get GeneratedImage by ToGeneratedImages collection of byte array extension.
    3. At each request you must have processing Model and sometimes processingId.
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.1 274 5/10/2024
1.0.0 103 5/10/2024