Avatar
dalle/image-generator
Public
Circuit
Code
Versions
API
RUNNING
The circuit is running and is healthy.
11Total Runs
13,557Avg Response Time (ms)
0Total Embeds
1Total Nodes
36%Error Rate
Control Panel
Login to ModelWorksLogin to ModelWorks to use this circuit. To get started, get an API key.
Explore endpointsModelWorks allows apps to access LLMs and MCP servers worldwide easily in any datacenter, securely and privately.
SecretsOverride default secrets and set up your own for better billing and security.
Readme

Dalle Logo


DALL-E 3 Image Generation Service

Overview

The DALL-E 3 Image Generation Service allows users to generate custom images using the OpenAI DALL-E 3 API. Provide a prompt, set image dimensions, and define how many images to generate in each request.


Environment Configuration

API Key: Ensure your api_key is securely stored in the environment under env.


Inputs

1. Prompt (prompt)

  • Description: Text prompt describing the desired image.
  • Type: string
  • Required: Yes

2. Model (model)

  • Description: Model to use for image generation (e.g., dall-e-3).
  • Type: string
  • Value: "dall-e-3"
  • Required: Yes

3. Size (size)

  • Description: Image dimensions, available options: 256x256, 512x512, 1024x1024.
  • Type: string
  • Default Value: "1024x1024"
  • Required: No

4. Number of Images (num_images)

  • Description: Number of images to generate.
  • Type: number
  • Default Value: 1
  • Required: No

Steps

Step 1: Generate Image (dalle_image_generation)

  • Description: Sends a request to the DALL-E 3 API to generate images based on the provided prompt.
  • Method: POST
  • Endpoint: https://api.openai.com/v1/images/generations
  • Headers:
    • Content-Type: application/json
    • Authorization: Bearer ${{ env.api_key }}

Body:

{  
  "model": "${{ model }}",  
  "prompt": "${{ prompt }}",  
  "n": "${{ num_images }}",  
  "size": "${{ size }}"  
}  

Outputs

1. DALL-E Image URL (dalle_image_url)

  • Description: URL to access the generated image.
  • Value: ${{ dalle_image_generation.output.json_body.data.$.[0].url }}

2. Revised Prompt (revised_prompt)

  • Description: Revised prompt returned by DALL-E.
  • Value: ${{ dalle_image_generation.output.json_body.data.$.[0].revised_prompt }}

Circuit Request and Response

Sample Request:

{  
  "context": {  
    "version": "1.0"  
  },  
  "input": {  
    "prompt": "A futuristic cityscape with flying cars",  
    "model": "dall-e-3",  
    "size": "512x512",  
    "num_images": 2  
  }  
}

Sample Response:

{  
  "dalle_image_url": "https://api.openai.com/v1/images/generations/example_image_url",  
  "revised_prompt": "Futuristic cityscape showing flying vehicles"  
}

Cost

15 units per request


Notes

  1. API Configuration: Ensure your api_key is correctly configured by uploading your API KEY in circuit -> settings -> secrets.
  2. Customization: Modify size, prompt, and num_images to generate the desired images.
  3. Response Handling: The image URL provided will expire after a set period, so download the image promptly.

Enjoy creating unique and imaginative images with DALL-E 3!

About
The DALL-E 3 Image Generation Service allows users to generate custom images using the OpenAI DALL-E 3 API.
Pricing Structure
No Cost
Free
This circuit is free to use0 credits