Class GoogleGenAiImageModel

java.lang.Object
dev.langchain4j.model.google.genai.GoogleGenAiImageModel
All Implemented Interfaces:
ImageModel

@Experimental public class GoogleGenAiImageModel extends Object implements ImageModel
Represents a Google GenAI model for image generation and editing using the official com.google.genai SDK.
  • Method Details

    • builder

      public static GoogleGenAiImageModel.Builder builder()
    • generate

      public Response<Image> generate(String prompt)
      Description copied from interface: ImageModel
      Given a prompt, generate an image.
      Specified by:
      generate in interface ImageModel
      Parameters:
      prompt - The prompt to generate an image from.
      Returns:
      The generated image Response.
    • edit

      public Response<Image> edit(Image image, String prompt)
      Description copied from interface: ImageModel
      Given an existing image, edit this image following the given prompt.
      Specified by:
      edit in interface ImageModel
      Parameters:
      image - The image to be edited.
      prompt - The prompt to edit the image.
      Returns:
      The generated image Response.
    • edit

      public Response<Image> edit(Image image, Image mask, String prompt)
      Description copied from interface: ImageModel
      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.
      Specified by:
      edit in interface ImageModel
      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.