Class DisabledImageModel

  • All Implemented Interfaces:
    dev.langchain4j.model.image.ImageModel

    
    public class DisabledImageModel
     implements ImageModel
                        

    An ImageModel which throws a ModelDisabledException for all of its methods

    This could be used in tests, or in libraries that extend this one to conditionally enable or disable functionality.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      Response<Image> generate(String prompt) Given a prompt, generate an image.
      Response<List<Image>> generate(String prompt, int n) Given a prompt, generate n images.
      Response<Image> edit(Image image, String prompt) Given an existing image, edit this image following the given prompt.
      Response<Image> edit(Image image, Image mask, String prompt) 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DisabledImageModel

        DisabledImageModel()
    • Method Detail

      • generate

         Response<Image> generate(String prompt)

        Given a prompt, generate an image.

        Parameters:
        prompt - The prompt to generate an image from.
        Returns:

        The generated image Response.

      • generate

         Response<List<Image>> generate(String prompt, int n)

        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.

      • edit

         Response<Image> edit(Image image, String prompt)

        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

         Response<Image> edit(Image image, Image mask, String prompt)

        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.