API calls for all endpoints tagged Images.
Summary
Functions
Edit an image
Edits an image using a text prompt and optional mask. Request must be sent as multipart/form-data with at least model, prompt (unless type is background_removal), and image (or image[]).
Generate an image Generates images from text prompts using the specified model.
Create Variation
Creates variations of an image. Request must be sent as multipart/form-data with model and image (or image[]). Does not support streaming.
Functions
@spec image_edit(Tesla.Env.client(), String.t(), String.t(), keyword()) :: {:ok, ExBifrost.Model.ImageGeneration200Response.t()} | {:ok, ExBifrost.Model.BifrostError.t()} | {:error, Tesla.Env.t()}
Edit an image
Edits an image using a text prompt and optional mask. Request must be sent as multipart/form-data with at least model, prompt (unless type is background_removal), and image (or image[]).
Parameters
connection(ExBifrost.Connection): Connection to servermodel(String.t): Model identifier in formatprovider/modelimage(String.t): Image file to edit. Use field nameimagefor a single file orimage[]for multiple files.opts(keyword): Optional parameters:prompt(String.t): Text prompt describing the edit. Required unlesstypeisbackground_removal.:mask(String.t): Optional mask image for inpainting (transparent areas indicate regions to edit):type(String.t): Type of edit operation:n(integer()): Number of images to generate:size(String.t): Size of the output image:response_format(String.t): Format of the response:stream(boolean()): When true, stream the response via Server-Sent Events:background(String.t): Background type for the image:input_fidelity(String.t): How closely to follow the original image:partial_images(integer()): Number of partial images to generate when streaming:quality(String.t): Quality of the output image:output_format(String.t): Output image format:num_inference_steps(integer()): Number of inference steps:seed(integer()): Seed for reproducible editing:output_compression(integer()): Compression level (0-100%):negative_prompt(String.t): What to avoid in the edit:user(String.t): User identifier for tracking:fallbacks([ExBifrost.Model.Fallback.t]): Fallback models to try if primary model fails
Returns
{:ok, ExBifrost.Model.ImageGeneration200Response.t}on success{:error, Tesla.Env.t}on failure
@spec image_generation( Tesla.Env.client(), ExBifrost.Model.ImageGenerationRequest.t(), keyword() ) :: {:ok, ExBifrost.Model.ImageGeneration200Response.t()} | {:ok, ExBifrost.Model.BifrostError.t()} | {:error, Tesla.Env.t()}
Generate an image Generates images from text prompts using the specified model.
Parameters
connection(ExBifrost.Connection): Connection to serverimage_generation_request(ImageGenerationRequest):opts(keyword): Optional parameters
Returns
{:ok, ExBifrost.Model.ImageGeneration200Response.t}on success{:error, Tesla.Env.t}on failure
@spec image_variation(Tesla.Env.client(), String.t(), String.t(), keyword()) :: {:ok, ExBifrost.Model.ImageGeneration200Response.t()} | {:ok, ExBifrost.Model.BifrostError.t()} | {:error, Tesla.Env.t()}
Create Variation
Creates variations of an image. Request must be sent as multipart/form-data with model and image (or image[]). Does not support streaming.
Parameters
connection(ExBifrost.Connection): Connection to servermodel(String.t): Model identifier in formatprovider/modelimage(String.t): Image file to create variations of. Use field nameimagefor a single file orimage[]for multiple (first image is used).opts(keyword): Optional parameters:n(integer()): Number of variations to generate:size(String.t): Size of the output images:response_format(String.t): Format of the response:user(String.t): User identifier for tracking:fallbacks([ExBifrost.Model.Fallback.t]): Fallback models to try if primary model fails
Returns
{:ok, ExBifrost.Model.ImageGeneration200Response.t}on success{:error, Tesla.Env.t}on failure