Imagen 4 Preview
Model Overview
Setup your API Key
API Schema
post
Body
modelstring Ā· enumRequiredPossible values:
promptstring Ā· max: 400Required
The text prompt describing the content, style, or composition of the image to be generated.
convert_base64_to_urlbooleanOptionalDefault:
If True, the URL to the image will be returned; otherwise, the file will be provided in base64 format.
truenum_imagesinteger Ā· max: 4OptionalDefault:
The number of images to generate.
1seedinteger Ā· max: 4294967295Optional
The same seed and the same prompt given to the same version of the model will output the same image every time.
enhance_promptbooleanOptionalDefault:
Optional parameter to use an LLM-based prompt rewriting feature for higher-quality images that better match the original prompt. Disabling it may affect image quality and prompt alignment.
trueaspect_ratiostring Ā· enumOptionalDefault:
The aspect ratio of the generated image.
1:1Possible values: person_generationstring Ā· enumOptionalDefault:
Allow generation of people.
allow_adultPossible values: safety_settingstring Ā· enumOptionalDefault:
Adds a filter level to safety filtering.
block_medium_and_abovePossible values: add_watermarkbooleanOptionalDefault:
Add an invisible watermark to the generated images.
falseResponses
200Success
application/json
post
/v1/images/generations200Success
Quick Example

Last updated
Was this helpful?