Camel Spring Boot

Spring AI Image

Generate images from a text prompt with a Spring AI ImageModel.

What’s inside

Please refer to the above links for usage and configuration details.

Maven coordinates

<dependency>
    <groupId>org.apache.camel.springboot</groupId>
    <artifactId>camel-spring-ai-image-starter</artifactId>
</dependency>

Spring Boot Auto-Configuration

The starter supports 11 options, which are listed below.

Name Description Default Type

camel.component.spring-ai-image.autowired-enabled

Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.

true

Boolean

camel.component.spring-ai-image.configuration

The configuration that each endpoint starts from. The options of an endpoint override it. The option is a org.apache.camel.component.springai.image.SpringAiImageConfiguration type.

SpringAiImageConfiguration

camel.component.spring-ai-image.enabled

Whether to enable auto configuration of the spring-ai-image component. This is enabled by default.

Boolean

camel.component.spring-ai-image.height

The height of the image in pixels. The accepted sizes depend on the provider and the model. OpenAI uses the height only together with the width, as the size WIDTHxHEIGHT (such as 1024x1024).

Integer

camel.component.spring-ai-image.image-model

The Spring AI ImageModel that generates the images, such as OpenAiImageModel. When not set, the single ImageModel in the registry is used. The option is a org.springframework.ai.image.ImageModel type.

ImageModel

camel.component.spring-ai-image.lazy-start-producer

Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel’s routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.

false

Boolean

camel.component.spring-ai-image.model

The name of the model of the provider that generates the images, such as dall-e-3. When not set, the model of the default options of the ImageModel is used.

String

camel.component.spring-ai-image.n

The number of images to generate. When the model returns more than one image, the message body is a List of Image. When not set, the ImageModel uses its default.

Integer

camel.component.spring-ai-image.response-format

The format of the generated image: url (the Image has a URL to download the image from) or b64_json (the Image has the base64-encoded image data, which converts to byte[]). When not set, the provider default applies. Support depends on the provider and the model.

String

camel.component.spring-ai-image.style

The style of the generated image, such as vivid or natural for the OpenAI dall-e-3 model. The accepted values depend on the provider and the model.

String

camel.component.spring-ai-image.width

The width of the image in pixels. The accepted sizes depend on the provider and the model. OpenAI uses the width only together with the height, as the size WIDTHxHEIGHT (such as 1024x1024).

Integer