Interface ImageModel

  • All Implemented Interfaces:

    
    public interface ImageModel
    
                        

    Text to Image generator model.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract 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

    • Method Detail

      • generate

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