background to transparent and output_format to png.
Watch the demo video
Text-to-RGBA
Do not passimage. Describe the subject and the transparent-background requirement in the prompt.
Image-to-RGBA
Pass one reference image or up to 10 withimage. The example extracts the stickers from two images and places them on a single transparent-background image.
Response
data[].background in the response is the actual transparency of the image: transparent when it has transparent or translucent pixels, opaque when the whole image is opaque. It may differ from the requested value.
Notes
- With
backgroundtransparent,output_formatmust bepng;jpegreturns 400. - The default
backgroundisauto: the model decides from the prompt andoutput_formatwhether to output an alpha channel. Passtransparentto be sure of a transparent background andopaqueto be sure of an opaque one. backgroundapplies to image generation only. Layer decomposition always returns transparent PNG layers and passingbackgroundreturns 400; see Fine-grained layer decomposition.- Billing is the same as any image generation: one output image in the tier of its pixels, plus one input image per reference image.





