Non official fusion brain API client.
For actual official documentation please refer to https://fusionbrain.ai/docs/en/doc/api-dokumentaciya/
- Getting available models -
GetModelsAsync
. - Generation image
- Auto polling result status -
GenerateImageAsync
- Manual pooling result status -
StartGenerateAsync
+GetGenerationStatusAsync
- Auto polling result status -
-
Configure
ImageGeneratorSettings
.BaseUrl
andAuthentication
are mandatory.CheckGeneration
are not mandatory with default values (Attempts
= 10 +Delay
= 10 seconds)
-
Create instance of
IImageGeneratorClient
.- Use can use DI way or manually configuring, meanwhile you can
use
ConfigureImageGeneratorHttpClient
HttpClient
extension for simplify authentication configuration.
- Use can use DI way or manually configuring, meanwhile you can
use
-
Get existing models by
GetModelsAsync
method -
Use one of model for creating
GeneratingImage
- 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)
- Example:
-
Make request with auto or manual pooling result.
- Auto.
- Use
IImageGeneratorClient.GenerateAsync()
, result will be collection of images withprocessingId
and content byte array.
- Use
- Manual
- Use
IImageGeneratorClient.StartGenerateAsync()
, result will be status with processing id and array of by arrays of caseDone
status (one of which is image byte array content). - Depending on your application's polling configuration use
IImageGeneratorClient.GetGenerationStatusAsync()
to get actual status generation.- Additionally u can get
GeneratedImage
byToGeneratedImages
collection of byte array extension.
- Additionally u can get
- Use
- At each request you must have processing
Model
and sometimesprocessingId
.
- Auto.