Dall-E-3 Won't Produce Image In Sizes Other Than 1024x1024

My API call to dall-e-3 produced images in size of 1024x1024 without any problem. But whenever I want size of 1792x1024 or 1024x1792, it says “HTTP status code: 400 (Bad Request)”.

I searched the forum and found one thread with similar problem, but no one answered the question.

Does anyone know the solution?

Thank you!

PS. I use the Tectalic OpenAI Client.

/** @var \Tectalic\OpenAi\Models\ImagesGenerations\CreateResponse $response */
$response = $openaiClient->imagesGenerations()->create(
new \Tectalic\OpenAi\Models\ImagesGenerations\CreateRequest([
‘model’ => “dall-e-3”,
‘prompt’ => $imagePrompt,
‘size’ => “1024x1024”,
‘n’ => 1,
//‘quality’ => ‘hd’,
//‘style’ => ‘natural’,

I view the readme homepage of the client. It has no indication of DALL-E 3, and shows an example of 256x256 image generation.

The CreateRequest.php was last updated March 1 2023. DALL-E 3 API was nonexistent then.

Chiefly, it fault is that it does not pass a model parameter and therefore cannot specify dall-e-3. You will need to modify this languishing code.

Would need to see the code for the call that isn’t working to help. But if it’s exactly the same except literally just replacing the size variable with “1792x1024” then I’m not sure.

The call produce 1024x1024 image ok. So it does pass the model parameter.

Yes, exact same code. Just paste “1792x1024”, then bad request. It works perfectly with “1024x1024”.

You are probably right. The code may need some update. Just wish someone already figured that out. :wink:

1024x1024 is passed and accepted – and you get a DALL-E 2 image.

From the API Reference:

model - Optional, Defaults to dall-e-2
The model to use for image generation.

The model parameter is new and is optional, but not one that is passed by the php code.

Therefore, without that, the only allowed image dimensions are those of the dall-e-2 model.

1 Like