org.llm4s.imagegeneration.provider

Members list

Type members

Classlikes

trait HttpClient

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object HttpClient

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
HttpClient.type
case class HuggingClientPayload(inputs: String, parameters: Parameters)

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type

HuggingFace Inference API client for image generation.

HuggingFace Inference API client for image generation.

This client provides access to HuggingFace's hosted diffusion models through their Inference API. It supports popular models like Stable Diffusion and other text-to-image models available on the HuggingFace Hub.

Value parameters

config

Configuration containing API key and model settings

Attributes

Example
val config = HuggingFaceConfig(
 apiKey = "your-hf-token",
 model = "stabilityai/stable-diffusion-2-1"
)
val client = new HuggingFaceClient(config)
client.generateImage("a beautiful sunset over mountains") match {
 case Right(image) => println(s"Generated image: $${image.size}")
 case Left(error) => println(s"Error: $${error.message}")
}
Supertypes
class Object
trait Matchable
class Any
class OpenAIImageClient(config: OpenAIConfig, httpClient: HttpClient) extends ImageGenerationClient

OpenAI Images API client for image generation.

OpenAI Images API client for image generation.

Supports GPT Image models and legacy DALL-E models.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
case class Parameters(guidance_scale: Double, inferenceSteps: Int, negative_prompt: Option[String], seed: Option[Long])

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Parameters

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Parameters.type
class SimpleHttpClient(llm4sClient: Llm4sHttpClient) extends HttpClient

Attributes

Supertypes
trait HttpClient
class Object
trait Matchable
class Any

Stability AI API client for image generation.

Stability AI API client for image generation.

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}")
}
Supertypes
class Object
trait Matchable
class Any

Stable Diffusion WebUI API client for image generation.

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}")
}
Supertypes
class Object
trait Matchable
class Any
case class StableDiffusionImg2ImgPayload(init_images: Seq[String], mask: Option[String], prompt: String, negative_prompt: String, width: Int, height: Int, steps: Int, cfg_scale: Double, denoising_strength: Double, batch_size: Int, n_iter: Int, seed: Long, sampler_name: String)

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class StableDiffusionPayload(prompt: String, negative_prompt: String, width: Int, height: Int, steps: Int, cfg_scale: Double, batch_size: Int, n_iter: Int, seed: Long, sampler_name: String)

Represents the JSON payload for the Stable Diffusion WebUI API's text-to-image endpoint. This case class ensures type-safe construction of the request body.

Represents the JSON payload for the Stable Diffusion WebUI API's text-to-image endpoint. This case class ensures type-safe construction of the request body.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type