Files
crewAI/crewai_tools/tools/dalle_tool
Greyson Lalonde e16606672a Squashed 'packages/tools/' content from commit 78317b9c
git-subtree-dir: packages/tools
git-subtree-split: 78317b9c127f18bd040c1d77e3c0840cdc9a5b38
2025-09-12 21:58:02 -04:00
..

DALL-E Tool

Description

This tool is used to give the Agent the ability to generate images using the DALL-E model. It is a transformer-based model that generates images from textual descriptions. This tool allows the Agent to generate images based on the text input provided by the user.

Installation

Install the crewai_tools package

pip install 'crewai[tools]'

Example

Remember that when using this tool, the text must be generated by the Agent itself. The text must be a description of the image you want to generate.

from crewai_tools import DallETool

Agent(
    ...
    tools=[DallETool()],
)

If needed you can also tweak the parameters of the DALL-E model by passing them as arguments to the DallETool class. For example:

from crewai_tools import DallETool

dalle_tool = DallETool(model="dall-e-3",
                       size="1024x1024",
                       quality="standard",
                       n=1)

Agent(
    ...
    tools=[dalle_tool]
)

The parameters are based on the client.images.generate method from the OpenAI API. For more information on the parameters, please refer to the OpenAI API documentation.