Search Results for

    Show / Hide Table of Contents

    Class ImagePrompt

    A specialized prompt for various image-related requests, such as image inpainting, rotation, animation, etc.
    This class is used to pass the instruction and the image to the respective image model for processing.

    Inheritance
    object
    ImagePrompt
    Implements
    ILoadablePrompt
    IPrompt
    IValidatable
    IModeratable
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Glitch9.AIDevKit
    Assembly: Glitch9.AIDevKit.dll
    Syntax
    public sealed class ImagePrompt : ILoadablePrompt, IPrompt, IValidatable, IModeratable

    Constructors

    | Edit this page View Source

    ImagePrompt()

    Declaration
    public ImagePrompt()
    | Edit this page View Source

    ImagePrompt(Weighted<File<Texture2D>>, Weighted<File<Texture2D>>?)

    Declaration
    public ImagePrompt(Weighted<File<Texture2D>> image, Weighted<File<Texture2D>>? maskImage = null)
    Parameters
    Type Name Description
    Weighted<File<Texture2D>> image
    Weighted<File<Texture2D>>? maskImage
    | Edit this page View Source

    ImagePrompt(Weighted<File<Texture2D>>, string)

    Declaration
    public ImagePrompt(Weighted<File<Texture2D>> image, string maskPrompt)
    Parameters
    Type Name Description
    Weighted<File<Texture2D>> image
    string maskPrompt
    | Edit this page View Source

    ImagePrompt(string, Weighted<File<Texture2D>>, Weighted<File<Texture2D>>?)

    Declaration
    public ImagePrompt(string text, Weighted<File<Texture2D>> image, Weighted<File<Texture2D>>? maskImage = null)
    Parameters
    Type Name Description
    string text
    Weighted<File<Texture2D>> image
    Weighted<File<Texture2D>>? maskImage
    | Edit this page View Source

    ImagePrompt(string, Weighted<File<Texture2D>>, string)

    Declaration
    public ImagePrompt(string text, Weighted<File<Texture2D>> image, string maskPrompt)
    Parameters
    Type Name Description
    string text
    Weighted<File<Texture2D>> image
    string maskPrompt
    | Edit this page View Source

    ImagePrompt(string, Texture2D)

    Declaration
    public ImagePrompt(string text, Texture2D tex = null)
    Parameters
    Type Name Description
    string text
    Texture2D tex
    | Edit this page View Source

    ImagePrompt(string, Texture2D, Texture2D)

    Declaration
    public ImagePrompt(string instruction, Texture2D image, Texture2D maskImage = null)
    Parameters
    Type Name Description
    string instruction
    Texture2D image
    Texture2D maskImage
    | Edit this page View Source

    ImagePrompt(Texture2D, Texture2D)

    Declaration
    public ImagePrompt(Texture2D image, Texture2D maskImage = null)
    Parameters
    Type Name Description
    Texture2D image
    Texture2D maskImage

    Properties

    | Edit this page View Source

    Image

    It's either the reference image for image generation or the image to be edited for image editing tasks.

    Declaration
    public Weighted<File<Texture2D>>? Image { get; set; }
    Property Value
    Type Description
    Weighted<File<Texture2D>>?
    | Edit this page View Source

    MaskImage

    Optional. The mask to be used for inpainting.
    The mask should be a black and white image where the white area is the area to be edited.

    Declaration
    public Weighted<File<Texture2D>>? MaskImage { get; set; }
    Property Value
    Type Description
    Weighted<File<Texture2D>>?
    | Edit this page View Source

    MaskText

    Optional. A text prompt to describe the area to mask. Define this OR MaskImage, not both.

    Declaration
    public string MaskText { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    Text

    Either the text description of the image to be generated or the editing instruction.

    Declaration
    public string Text { get; set; }
    Property Value
    Type Description
    string

    Methods

    | Edit this page View Source

    ArePromptFilesRequireLoading()

    Declaration
    public bool ArePromptFilesRequireLoading()
    Returns
    Type Description
    bool
    | Edit this page View Source

    GetPromptFiles()

    Declaration
    public IFile[] GetPromptFiles()
    Returns
    Type Description
    IFile[]
    | Edit this page View Source

    GetPromptText()

    Declaration
    public string GetPromptText()
    Returns
    Type Description
    string
    | Edit this page View Source

    IsValid()

    Declaration
    public bool IsValid()
    Returns
    Type Description
    bool
    | Edit this page View Source

    LoadPromptFilesAsync()

    Declaration
    public UniTask LoadPromptFilesAsync()
    Returns
    Type Description
    UniTask
    | Edit this page View Source

    ToModerationPrompt()

    Declaration
    public ModerationPrompt ToModerationPrompt()
    Returns
    Type Description
    ModerationPrompt
    | Edit this page View Source

    Validate()

    Validates the object's parameters and throws if invalid.

    Declaration
    public void Validate()

    Operators

    | Edit this page View Source

    implicit operator ImagePrompt(File<Texture2D>)

    Declaration
    public static implicit operator ImagePrompt(File<Texture2D> tex)
    Parameters
    Type Name Description
    File<Texture2D> tex
    Returns
    Type Description
    ImagePrompt
    | Edit this page View Source

    implicit operator ImagePrompt(string)

    Declaration
    public static implicit operator ImagePrompt(string text)
    Parameters
    Type Name Description
    string text
    Returns
    Type Description
    ImagePrompt
    | Edit this page View Source

    implicit operator ImagePrompt(Texture2D)

    Declaration
    public static implicit operator ImagePrompt(Texture2D tex)
    Parameters
    Type Name Description
    Texture2D tex
    Returns
    Type Description
    ImagePrompt

    Implements

    ILoadablePrompt
    IPrompt
    IValidatable
    IModeratable

    Extension Methods

    UnifiedApiCallerExtensions.GENModeration(IModeratable, IEnumerable<SafetySetting>)
    PixelArtBridgeExtensions.GENPixelAnimation(ImagePrompt)
    PixelArtBridgeExtensions.GENPixelInpaint(ImagePrompt)
    UnifiedApiCallerExtensions.GENImage(ImagePrompt)
    UnifiedApiCallerExtensions.GENImageEdit(ImagePrompt, ImageEditType)
    UnifiedApiCallerExtensions.GENInpaint(ImagePrompt)
    UnifiedApiCallerExtensions.GENVideo(ImagePrompt)
    UnifiedApiCallerExtensions.ImageToImage(ImagePrompt)
    UnifiedApiCallerExtensions.ImageToImage(ImagePrompt, ImageEditType)
    UnifiedApiCallerExtensions.ImageToVideo(ImagePrompt)
    UnifiedApiCallerExtensions.TextToImage(ImagePrompt)
    ArrayExtensions.ToArrayOrEmpty<T>(T)
    ArrayExtensions.ToArrayOrNull<T>(T)
    EventExtensions.ToDelta<T>(T, string, int, string, bool)
    EventExtensions.ToDone<T>(T, string, int, string)
    EventExtensions.ToEvent<T>(T)
    EventExtensions.UpcastDelta<T1, T2>(T1, string, int, string, bool)
    FallbackExtensions.IsOr<TParent, TChild>(TParent, TChild)
    ResponseCastingExtensions.GetResult<T>(T)
    SystemExtensions.GetName(object)
    • Edit this page
    • View Source
    In this article
    Back to top AI DevKit Documentation