Discrepancy of image generation results in browser and via API

I’m sending the same prompt via “chatGPT[.]com” and API “api[.]openai[.]com”
The prompt can be both simple, and very detailed (I tried different).
When I send prompts “from browser”, I get excellent results. When I send the same prompts “via API”, it’s absolutely unbearable quality like “four fingers” or “plastic surgery mistakes” :frowning: (which never happens “from browser”).
Yes, I tried many options…

1 Like

Are you sending to DALLE3 model? Using “vivid” or “natural” style?

Can you share some code you’re using?

1 Like
endpoint = "https://api[.]openai[.]com/v1/images/generations"

# Define the request headers
headers = {
    "Authorization": f"Bearer {api_key}",
    "Content-Type": "application/json"
}

# Define the payload with a test prompt
payload = {
    "prompt": prompt,
    "n": 1,  # Number of images to generate
    "size": "1024x1024"  # Image resolution
}

Reference Documentation for DALL-E 3 Parameters

Endpoint: OpenAI Images API

still current as of Nov 2024

This table outlines the parameters available and which will require alteration in order to generate images with dall-e-3


Parameters

Parameter Type Required Default Description
prompt string Yes N/A A text description of the desired image(s). Maximum length is 4000 characters for DALL-E 3.
model string No dall-e-2 The model to use for image generation. Set to dall-e-3 to specify this model.
n integer No 1 The number of images to generate. Only n=1 is supported for DALL-E 3.
quality string No standard The quality of the generated image. Options are: standard, hd. hd is exclusive to DALL-E 3.
response_format string No url The format for the returned images. Options: url, b64_json. URLs are valid for 60 minutes.
size string No 1024x1024 Specifies the size of generated images. Supported sizes for DALL-E 3 are: 1024x1024, 1792x1024, 1024x1792.
style string No vivid The style of the generated images. Options: vivid, natural. This parameter is exclusive to DALL-E 3.
user string No N/A A unique identifier for the end-user to help monitor and detect abuse.
3 Likes