Method signature
Parameters
The text description of how you want to transform the image. Describe the desired changes or style.
The base64-encoded string representation of the input image you want to transform.
Text describing what you don’t want in the transformed image. The default value includes common undesirable elements like distortions, poor anatomy, and NSFW content.
The width of the output image in pixels.
The height of the output image in pixels.
Returns
The transformed image as decoded binary data. The API returns base64-encoded data which is automatically decoded to bytes for you.
Example
Notes
- The input
image_dataparameter must be a base64-encoded string - The method automatically sets
responseType="base64data"internally and decodes the response for you - All image-to-image operations are asynchronous and must be awaited
- The transformation maintains the general composition of the input image while applying the style or changes described in the prompt
- The default negative prompt helps avoid common generation issues