Method signature
Parameters
The text description of the image you want to generate. Be specific and descriptive for best results.
Text describing what you don’t want in the generated image. The default value includes common undesirable elements like distortions, poor anatomy, and NSFW content.
The Stable Diffusion model to use for generation. Use
sd_models() to get a list of available models.The width of the generated image in pixels.
The height of the generated image in pixels.
Returns
The generated image as decoded binary data. The API returns base64-encoded data which is automatically decoded to bytes for you.
Example
Notes
- The method automatically sets
responseType="base64data"internally and decodes the response for you - All image generation operations are asynchronous and must be awaited
- The default negative prompt is comprehensive and helps avoid common generation issues
- Use
sd_models()orsdxl_models()methods to discover available models