generate_images
autogen.agentchat.contrib.capabilities.generate_images.ImageGenerator
ImageGenerator
This class defines an interface for image generators.
Concrete implementations of this protocol must provide a generate_image
method that takes a string prompt as
input and returns a PIL Image object.
NOTE: Current implementation does not allow you to edit a previously existing image.
Name | Description |
---|---|
*args | |
**kwargs |
Instance Methods
cache_key
Generates a unique cache key for the given prompt.
This key can be used to store and retrieve generated images based on the prompt.
Name | Description |
---|---|
prompt | A string describing the desired image. Type: str |
Type | Description |
---|---|
str | A unique string that can be used as a cache key. |
generate_image
Generates an image based on the provided prompt.
Name | Description |
---|---|
prompt | A string describing the desired image. Type: str |
Type | Description |
---|---|
Image | A PIL Image object representing the generated image. |