Package dev.langchain4j.model.image
Interface ImageModel
- All Known Implementing Classes:
AzureOpenAiImageModel
,DisabledImageModel
,OpenAiImageModel
,VertexAiImageModel
,WorkersAiImageModel
public interface ImageModel
Text to Image generator model.
-
Method Summary
Modifier and TypeMethodDescriptionGiven an existing image, edit this image following the given prompt and apply the changes only to the part of the image specified by the given mask.Given an existing image, edit this image following the given prompt.Given a prompt, generate an image.Given a prompt, generate n images.
-
Method Details
-
generate
Given a prompt, generate an image.- Parameters:
prompt
- The prompt to generate an image from.- Returns:
- The generated image Response.
-
generate
Given a prompt, generate n images.Not supported by all models; as explicit support is needed to generate different images from the same prompt.
- Parameters:
prompt
- The prompt to generate images from.n
- The number of images to generate.- Returns:
- The generated images Response.
- Throws:
IllegalArgumentException
- if the operation is not supported.
-
edit
Given an existing image, edit this image following the given prompt.- Parameters:
image
- The image to be edited.prompt
- The prompt to edit the image.- Returns:
- The generated image Response.
-
edit
Given an existing image, edit this image following the given prompt and apply the changes only to the part of the image specified by the given mask.- Parameters:
image
- The image to be edited.mask
- The image mask to apply to delimit the area to edit.prompt
- The prompt to edit the image.- Returns:
- The generated image Response.
-