Skip to content

Image artifact

ImageArtifact

Bases: MediaArtifact

ImageArtifact is a type of MediaArtifact representing an image.

Attributes:

Name Type Description
value

Raw bytes representing media data.

media_type str

The type of media, defaults to "image".

format str

The format of the media, like png, jpeg, or gif.

name str

Artifact name, generated using creation time and a random string.

model str

Optionally specify the model used to generate the media.

prompt str

Optionally specify the prompt used to generate the media.

Source code in griptape/artifacts/image_artifact.py
@define
class ImageArtifact(MediaArtifact):
    """ImageArtifact is a type of MediaArtifact representing an image.

    Attributes:
        value: Raw bytes representing media data.
        media_type: The type of media, defaults to "image".
        format: The format of the media, like png, jpeg, or gif.
        name: Artifact name, generated using creation time and a random string.
        model: Optionally specify the model used to generate the media.
        prompt: Optionally specify the prompt used to generate the media.
    """

    media_type: str = "image"
    width: int = field(kw_only=True, metadata={"serializable": True})
    height: int = field(kw_only=True, metadata={"serializable": True})

height: int = field(kw_only=True, metadata={'serializable': True}) class-attribute instance-attribute

media_type: str = 'image' class-attribute instance-attribute

width: int = field(kw_only=True, metadata={'serializable': True}) class-attribute instance-attribute