> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-fix-nav-issues.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Image generation

> Generate and edit images inside ClickHouse Agents

export const Image = ({img, alt, size}) => {
  return <Frame>
      <img src={img} alt={alt} />
    </Frame>;
};

export const galaxyOnClick = eventName => () => {
  try {
    if (typeof window !== "undefined" && window.galaxy && eventName) {
      window.galaxy.track(eventName, {
        interaction: "click"
      });
    }
  } catch (e) {}
};

export const BetaBadge = ({link, galaxyTrack, galaxyEvent}) => {
  if (link) {
    return <a href={link} target="_blank" rel="noopener noreferrer" className="betaBadge" onClick={galaxyTrack && galaxyEvent ? galaxyOnClick(galaxyEvent) : undefined}>
                <Icon />
                <span>Beta</span>
            </a>;
  }
  return <div className="betaBadge">
            <Icon />
            <span>
                Beta feature. 
                <u>
                    <a href="/docs/beta-and-experimental-features#beta-features">
                        Learn more.
                    </a>
                </u>
            </span>
        </div>;
};

Image generation lets an agent produce new images from a text prompt or edit images the user has uploaded. The agent picks between generation and editing based on what was asked and the available context.

<h2 id="enable-it">
  Enable image generation
</h2>

Image generation is added through the **Add Tools** modal in the Agent Builder (not the Capabilities section). Click **Add Tools** at the bottom of the Agent Builder panel, then add one of the image-model tools — for example **OpenAI Image Tools**, **DALL-E-3**, or **Stable Diffusion**. The agent picks the appropriate one based on the request, or you can restrict it in instructions.

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/huP88Vza7bEG09HU/images/cloud/agent-builder/tools-modal.png?fit=max&auto=format&n=huP88Vza7bEG09HU&q=85&s=80cb90aa3290765aeb07f2f9b7420c80" alt="Agent Tools modal showing image-model integrations including OpenAI Image Tools, DALL-E-3, and Stable Diffusion alongside other third-party tools" size="md" width="2560" height="1280" data-path="images/cloud/agent-builder/tools-modal.png" />

<h2 id="generation">
  Generation
</h2>

When the user asks for an image, the agent calls the generation tool with a prompt and returns the resulting image inline. The agent retains a reference to the image in its context so it can describe or reuse it within the same conversation.

<h2 id="editing">
  Editing
</h2>

If the user uploads an image and asks for a modification — change a color, add an object, extend a composition — the agent invokes the editing variant of the tool. The output replaces the relevant region or extends the source as requested.

<h2 id="notes">
  Notes
</h2>

* Generated images aren't fed into separate vision analysis automatically. If you need the agent to *interpret* an image, use [vision](/products/cloud/features/ai-ml/agents/builder/vision) with a user-uploaded image.
* Provider content policies apply. Prompts that violate the provider's policy return an error rather than an image.
