API client for fusion brain image generator
$ dotnet add package FusionBrainGetModelsAsync.GenerateImageAsyncStartGenerateAsync + GetGenerationStatusAsyncConfigure ImageGeneratorSettings.
BaseUrl and Authentication are mandatory.CheckGeneration are not mandatory with default values (Attempts = 10 + Delay = 10 seconds)Create instance of IImageGeneratorClient.
ConfigureImageGeneratorHttpClient HttpClient extension for simplify authentication configuration.Get existing models by GetModelsAsync method
Use one of model for creating GeneratingImage
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)
Make request with auto or manual pooling result.
IImageGeneratorClient.GenerateAsync(), result will be collection of images with processingId and
content byte array.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).IImageGeneratorClient.GetGenerationStatusAsync()
to get actual status generation.
GeneratedImage by ToGeneratedImages collection of byte array extension.Model and sometimes processingId.