This client connects to Stability AI's REST API for text-to-image generation. It supports models like Stable Diffusion XL, Stable Diffusion 3, and other Stability AI models.
Value parameters
config
Configuration containing API key, model selection, and timeout settings
Attributes
Example
val config = StabilityAIConfig(
apiKey = "your-stability-api-key",
model = "stable-diffusion-xl-1024-v1-0"
)
val client = new StabilityAIClient(config)
val options = ImageGenerationOptions(
size = ImageSize.Square1024,
format = ImageFormat.PNG
)
client.generateImage("a beautiful landscape", options) match {
case Right(image) => println(s"Generated image: $${image.size}")
case Left(error) => println(s"Error: $${error.message}")
}