StableDiffusionClient
org.llm4s.imagegeneration.provider.StableDiffusionClient
class StableDiffusionClient(config: StableDiffusionConfig) extends ImageGenerationClient
Stable Diffusion WebUI API client for image generation.
This client connects to a locally hosted or remote Stable Diffusion WebUI instance through its REST API. It supports all the standard text-to-image generation features including custom sampling, guidance scale, negative prompts, and more.
Value parameters
- config
-
Configuration containing base URL, API key, and timeout settings
Attributes
- Example
-
val config = StableDiffusionConfig( baseUrl = "http://localhost:7860", apiKey = Some("your-api-key") // optional ) val client = new StableDiffusionClient(config) val options = ImageGenerationOptions( size = ImageSize.Square512, guidanceScale = 7.5, negativePrompt = Some("blurry, low quality") ) client.generateImage("a beautiful landscape", options) match { case Right(image) => println(s"Generated image: $${image.size}") case Left(error) => println(s"Error: $${error.message}") } - Graph
-
- Supertypes
Members list
In this article