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

# Image Generation

> AI-powered image generation endpoints

# AI Image Generation

ProductFlo provides powerful AI image generation capabilities through various models and providers. These endpoints allow you to generate, manipulate, and analyze images using state-of-the-art AI models.

## Image Generation Models

<Tabs>
  <Tab title="OpenAI DALL-E">
    Generates high-quality images from text descriptions using OpenAI's DALL-E 3 model.
  </Tab>

  <Tab title="Stability AI">
    Creates detailed images with fine-grained control using Stability AI's diffusion models.
  </Tab>

  <Tab title="Replicate">
    Offers specialized models for product photography, inpainting, and design mockups.
  </Tab>

  <Tab title="Recraft">
    Provides comprehensive image editing, vectorization, and style transfer capabilities.
  </Tab>
</Tabs>

## Generate Images with DALL-E

<Card title="POST /image-generation-openai" icon="paintbrush" iconType="duotone">
  Generate images using OpenAI's DALL-E 3 model
</Card>

Generates one or more images from a text prompt using OpenAI's DALL-E 3 model.

### Request

<Tabs>
  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST https://api.productflo.io/image-generation-openai \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -d '{
        "prompt": "A photorealistic smart thermostat with a touch screen interface, modern design",
        "nbr_images": 3,
        "folder_path": "projects/thermostats"
      }'
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    import requests

    response = requests.post(
        "https://api.productflo.io/image-generation-openai",
        headers={
            "Content-Type": "application/json",
            "Authorization": "Bearer YOUR_API_KEY"
        },
        json={
            "prompt": "A photorealistic smart thermostat with a touch screen interface, modern design",
            "nbr_images": 3,
            "folder_path": "projects/thermostats"
        }
    )

    data = response.json()
    ```
  </Tab>
</Tabs>

### Request Body

<ParamField body="prompt" type="string" required>
  The text description of the image to generate
</ParamField>

<ParamField body="nbr_images" type="integer" default={1}>
  Number of images to generate (1-4)
</ParamField>

<ParamField body="folder_path" type="string">
  Optional folder path where generated images will be saved
</ParamField>

### Response

<ResponseField name="status" type="string">
  Status of the operation (COMPLETED, PROCESSING, ERROR)
</ResponseField>

<ResponseField name="generated_images" type="array">
  Array of URLs to the generated images
</ResponseField>

<ResponseField name="error_message" type="string">
  Error message if generation failed
</ResponseField>

<ResponseField name="created_at" type="string">
  Timestamp of when the images were generated
</ResponseField>

<RequestExample>
  ```json theme={null}
  {
    "prompt": "A photorealistic smart thermostat with a touch screen interface, modern design",
    "nbr_images": 3,
    "folder_path": "projects/thermostats"
  }
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "status": "COMPLETED",
    "generated_images": [
      "https://api.productflo.io/global/projects/thermostats/image_1.png",
      "https://api.productflo.io/global/projects/thermostats/image_2.png",
      "https://api.productflo.io/global/projects/thermostats/image_3.png"
    ],
    "error_message": null,
    "created_at": "2023-05-01T12:34:56.789Z"
  }
  ```
</ResponseExample>

## Generate Images with Stability AI

<Card title="POST /image-generation-stability" icon="sparkles" iconType="duotone">
  Generate images using Stability AI models
</Card>

Generates detailed images with fine-grained control using Stability AI's diffusion models.

### Request

<Tabs>
  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST https://api.productflo.io/image-generation-stability \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -d '{
        "prompt": "Photo of a modern electric vehicle charging station, photorealistic, high detail",
        "negative_prompt": "blurry, low quality, distortion, text, watermark",
        "nbr_images": 2,
        "folder_path": "projects/charging-stations"
      }'
    ```
  </Tab>
</Tabs>

### Request Body

<ParamField body="prompt" type="string" required>
  The text description of the image to generate
</ParamField>

<ParamField body="negative_prompt" type="string">
  Elements to avoid in the generated image
</ParamField>

<ParamField body="nbr_images" type="integer" default={1}>
  Number of images to generate (1-4)
</ParamField>

<ParamField body="folder_path" type="string">
  Optional folder path where generated images will be saved
</ParamField>

### Response

Same structure as the OpenAI endpoint response.

## Generate Product Photos

<Card title="POST /image-generation-product-photo" icon="camera" iconType="duotone">
  Generate professional product photos
</Card>

Generates realistic product photos using specialized models from Replicate.

### Request

<Tabs>
  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST https://api.productflo.io/image-generation-product-photo \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -d '{
        "prompt": "A sleek smartwatch with heart rate monitor and fitness tracking",
        "negative_prompt": "blurry, low quality, people, hands",
        "reference_image": "https://example.com/reference_watch.jpg",
        "nbr_images": 3,
        "folder_path": "projects/smartwatch"
      }'
    ```
  </Tab>
</Tabs>

### Request Body

<ParamField body="prompt" type="string" required>
  The text description of the product to generate
</ParamField>

<ParamField body="negative_prompt" type="string">
  Elements to avoid in the generated image
</ParamField>

<ParamField body="reference_image" type="string">
  Optional URL to a reference image for image-to-image generation
</ParamField>

<ParamField body="nbr_images" type="integer" default={1}>
  Number of images to generate (1-4)
</ParamField>

<ParamField body="folder_path" type="string">
  Optional folder path where generated images will be saved
</ParamField>

### Response

Same structure as the OpenAI endpoint response.

## Generate Product Mockups

<Card title="POST /image-generation-product-mockups" icon="layer-group" iconType="duotone">
  Generate product mockups in various contexts
</Card>

Generates product mockups showing your product in realistic environments and contexts.

### Request Body

<ParamField body="prompt" type="string" required>
  The text description of the product mockup to generate
</ParamField>

<ParamField body="negative_prompt" type="string">
  Elements to avoid in the generated mockup
</ParamField>

<ParamField body="reference_image" type="string">
  Optional URL to a reference image of the product
</ParamField>

<ParamField body="nbr_images" type="integer" default={1}>
  Number of images to generate (1-4)
</ParamField>

<ParamField body="folder_path" type="string">
  Optional folder path where generated images will be saved
</ParamField>

## Image Analysis with Vision API

<Card title="POST /image-analysis" icon="magnifying-glass" iconType="duotone">
  Analyze images using AI vision capabilities
</Card>

Analyzes images using OpenAI's Vision API to extract information, measurements, and insights.

### Request

<Tabs>
  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST https://api.productflo.io/image-analysis \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -d '{
        "prompt": "Analyze this circuit board and identify all components",
        "reference_image": "https://example.com/circuit_board.jpg"
      }'
    ```
  </Tab>
</Tabs>

### Request Body

<ParamField body="prompt" type="string" required>
  The question or instruction for analyzing the image
</ParamField>

<ParamField body="reference_image" type="string" required>
  URL to the image to be analyzed
</ParamField>

### Response

<ResponseField name="status" type="string">
  Status of the operation (COMPLETED, PROCESSING, ERROR)
</ResponseField>

<ResponseField name="analysis" type="string">
  Detailed analysis of the image based on the prompt
</ResponseField>

<ResponseField name="error_message" type="string">
  Error message if analysis failed
</ResponseField>

<ResponseField name="created_at" type="string">
  Timestamp of when the analysis was performed
</ResponseField>

## Recraft Image Processing

ProductFlo integrates with Recraft AI for specialized image processing tasks.

### Vectorize Image

<Card title="POST /recraft-vectorize" icon="bezier-curve" iconType="duotone">
  Convert raster images to vector graphics
</Card>

Converts raster images to scalable vector graphics (SVG) format.

### Request Body

<ParamField body="prompt" type="string">
  Optional text description to guide the vectorization
</ParamField>

<ParamField body="reference_image" type="string" required>
  URL to the image to be vectorized
</ParamField>

### Remove Background

<Card title="POST /recraft-remove-background" icon="object-subtract" iconType="duotone">
  Remove backgrounds from images
</Card>

Automatically removes the background from an image, producing a transparent PNG.

### Request Body

<ParamField body="reference_image" type="string" required>
  URL to the image to process
</ParamField>

### Upscale Image

<Card title="POST /recraft-upscale" icon="expand" iconType="duotone">
  Enhance image resolution
</Card>

Upscales an image to higher resolution while preserving quality.

### Request Body

<ParamField body="image_path" type="string" required>
  Path to the source image
</ParamField>

<ParamField body="scale_factor" type="integer" default={2}>
  Upscaling factor (1-4)
</ParamField>

<ParamField body="mode" type="string" default="clarity">
  Upscaling mode (clarity or generative)
</ParamField>

## Custom AI Styles

### Create Custom Style

<Card title="POST /recraft-create-style" icon="palette" iconType="duotone">
  Create a custom image generation style
</Card>

Creates a custom style from reference images that can be used for future generations.

### Request Body

<ParamField body="name" type="string" required>
  Name for the custom style
</ParamField>

<ParamField body="reference_images" type="array" required>
  List of paths to reference images
</ParamField>

<ParamField body="description" type="string">
  Optional style description
</ParamField>

### List Styles

<Card title="GET /recraft-list-styles" icon="list" iconType="duotone">
  List available custom styles
</Card>

Returns a list of all available custom styles.

### Get Style

<Card title="GET /recraft-get-style/{style_id}" icon="brush" iconType="duotone">
  Get details of a specific custom style
</Card>

Returns details about a specific custom style.
