> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cassidyai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate image

> Generate an image from a text description using AI within a Workflow.

Generate AI images from text descriptions directly within a [Workflow](/workflows/overview). Use this to create visuals for content, social media, presentations, or any automation that needs image assets. The output is a file reference that can be used in subsequent Workflow actions, saved to your [Knowledge Base](/knowledge-base/overview), or sent via email or other integrations.

<Steps>
  <Step title="Add the action">
    In the Workflow builder, click **+** between blocks and select **Generate Image** from the action library.

    <Frame>
      <img src="https://mintcdn.com/cassidy/PSOwom-PV6-w07rd/images/reference/generate-image-img-0.png?fit=max&auto=format&n=PSOwom-PV6-w07rd&q=85&s=6ca83b0ee81d88b7cc312475d0e635a6" alt="Action library with Generate Image selected" width="624" height="298" data-path="images/reference/generate-image-img-0.png" />
    </Frame>
  </Step>

  <Step title="Write the image prompt">
    In the **Prompt** field, describe the image you want to generate. Be specific about key elements, composition, lighting, mood, style, and colors for best results. [Reference variables](/guides/prompt-engineering#workflow-prompts) from previous steps or the trigger using **#** to create dynamic image prompts.

    <Frame>
      <img src="https://mintcdn.com/cassidy/PSOwom-PV6-w07rd/images/reference/generate-image-img-6.png?fit=max&auto=format&n=PSOwom-PV6-w07rd&q=85&s=1d79bb72e9f85f45bb8a5aa63605fbbc" alt="Image prompt field with a detailed description" width="479" height="142" data-path="images/reference/generate-image-img-6.png" />
    </Frame>
  </Step>

  <Step title="Enter a file name">
    In the **File Name** field, specify the name for the generated image file. You can reference variables from previous steps to create dynamic file names.

    <Frame>
      <img src="https://mintcdn.com/cassidy/PSOwom-PV6-w07rd/images/reference/generate-image-img-7.png?fit=max&auto=format&n=PSOwom-PV6-w07rd&q=85&s=0fe28c7a342734bde24b5f894dfe7af3" alt="File name field for the generated image" width="474" height="133" data-path="images/reference/generate-image-img-7.png" />
    </Frame>
  </Step>

  <Step title="Choose the image size">
    In the **Size** dropdown, select the aspect ratio for the generated image:

    * **Auto** (default) — automatically determines the best aspect ratio based on your prompt
    * **Square** — 1:1 aspect ratio
    * **Portrait** — vertical orientation
    * **Landscape** — horizontal orientation

    <Frame>
      <img src="https://mintcdn.com/cassidy/PSOwom-PV6-w07rd/images/reference/generate-image-img-8.png?fit=max&auto=format&n=PSOwom-PV6-w07rd&q=85&s=da849f93251577421683f30484d6f726" alt="Size dropdown showing Auto, Square, Portrait, and Landscape options" width="477" height="197" data-path="images/reference/generate-image-img-8.png" />
    </Frame>
  </Step>

  <Step title="Select the background type">
    In the **Background** dropdown, select the background type for the generated image:

    * **Auto** (default) — AI determines the best background
    * **Transparent** — generates an image with a transparent background
    * **Opaque** — generates an image with a solid background

    <Frame>
      <img src="https://mintcdn.com/cassidy/PSOwom-PV6-w07rd/images/reference/generate-image-img-9.png?fit=max&auto=format&n=PSOwom-PV6-w07rd&q=85&s=fb6d7fe4fe2de630d3f40789a614de28" alt="Background dropdown showing Auto, Transparent, and Opaque options" width="478" height="159" data-path="images/reference/generate-image-img-9.png" />
    </Frame>
  </Step>

  <Step title="Test the action">
    Run a test of your Workflow to preview the generated image and ensure it meets your expectations. Refine your prompt based on the results to achieve the desired output.

    <Frame>
      <img src="https://mintcdn.com/cassidy/PSOwom-PV6-w07rd/images/reference/generate-image-img-10.png?fit=max&auto=format&n=PSOwom-PV6-w07rd&q=85&s=b3e976bdb0ec9f34023ecbfe8633cee4" alt="Test run showing the generated image preview" width="473" height="120" data-path="images/reference/generate-image-img-10.png" />
    </Frame>
  </Step>
</Steps>

## Related

* [Image Generation capability for Agents](/agents/capabilities/image-generation)
