Complete guide to image generation APIs
imageDataUrl
parameter. Here are the different ways to provide input images:
gpt-4o-image
, flux-kontext
, and gpt-image-1
support multiple input images:
flux-dev-image-to-image
- Image-to-image onlyghiblify
- Transform images to Studio Ghibli stylegemini-flash-edit
- Edit images with promptshidream-edit
- Advanced image editingbagel
- Both text-to-image and image-to-imageSDXL-ArliMix-v1
- Artistic transformationsUpscaler
- Upscale images to higher resolutionflux-kontext
- Advanced context-aware generationflux-kontext/dev
- Development version (image-to-image only)gpt-4o-image
- GPT-4 powered image generationgpt-image-1
- Advanced multi-image processingflux-lora/inpainting
- Requires both imageDataUrl
(base image) and maskDataUrl
(mask)image/jpeg
or image/jpg
image/png
image/webp
image/gif
(first frame only)prompt
(string): The text description of the image you want to generatemodel
(string): The model to use for generationwidth
(integer): Width of the generated image (default: 1024)height
(integer): Height of the generated image (default: 1024)negative_prompt
(string): Things to avoid in the generated imagenImages
(integer): Number of images to generate (default: 1)num_steps
(integer): Number of denoising steps (default: 30)resolution
(string): Output resolution (default: “1024x1024”)sampler_name
(string): Sampling method (default: “DPM++ 2M Karras”)scale
(float): Guidance scale (default: 7.5)imageDataUrl
parameter with a base64-encoded image:
imageDataUrl
(string): Base64-encoded image data URL (format: data:image/[type];base64,[data]
)kontext_max_mode
(boolean): When using flux-kontext model, enables maximum context mode for better image understandingdata:image/jpeg;base64,
)data:image/png;base64,
)data:image/webp;base64,
)