org.llm4s.imagegeneration.provider

Members list

Type members

Classlikes

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class HttpClient
class HttpClient(url: String, headers: Map[String, String], timeout: Int) extends BaseHttpClient

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object HttpClient

Attributes

Companion
class
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

OpenAI DALL-E API client for image generation.

OpenAI DALL-E API client for image generation.

This client connects to OpenAI's DALL-E API for text-to-image generation. It supports both DALL-E 2 and DALL-E 3 models with their respective capabilities and limitations.

Value parameters

config

Configuration containing API key, model selection, and timeout settings

Attributes

Example
val config = OpenAIConfig(
 apiKey = "your-openai-api-key",
 model = "dall-e-2"  // or "dall-e-3"
)
val client = new OpenAIImageClient(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
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

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 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