You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
parallel) to generate the requested number of images.
84
84
</Note>
85
85
86
+
Each image model has an internal limit on how many images it can generate in a single API call. The AI SDK manages this automatically by batching requests appropriately when you request multiple images using the `n` parameter. By default, the SDK uses provider-documented limits (for example, DALL-E 3 can only generate 1 image per call, while DALL-E 2 supports up to 10).
87
+
88
+
If needed, you can override this behavior using the `maxImagesPerCall` setting when configuring your model. This is particularly useful when working with new or custom models where the default batch size might not be optimal:
89
+
90
+
```tsx
91
+
const model =openai.image('dall-e-2', {
92
+
maxImagesPerCall: 5, // Override the default batch size
93
+
});
94
+
95
+
const { images } =awaitgenerateImage({
96
+
model,
97
+
prompt: 'Santa Claus driving a Cadillac',
98
+
n: 10, // Will make 2 calls of 5 images each
99
+
});
100
+
```
101
+
86
102
### Providing a Seed
87
103
88
104
You can provide a seed to the `generateImage` function to control the output of the image generation process.
0 commit comments