Image Gen Request Parameters
The basic parameters of all AKI.IO image generator models are standardized across all models. The standard request parameters for image generation endpoints are in JSON format.
The call to an image generator is done with a HTTPS POST request to:
https://aki.io/api/call/{endpoint name}
For a overview of available image generator endpoints please read here.
Request Parameters
key:string
Your AKI.IO API key for authentication and authorization. Get your AKI.IO API key at https://aki.io/signup
prompt:string
The prompt that describes the image that should be generated. Depending on the model it can be very detailed and describing different parts of the image, objects, persons, background, lighting, colors, camera lense or style like painting, comic, photo realistic etc.
width:integer
Depending on the capabilities of the model but usually in the range of 128 to 2048 pixels.
height:integer
Depending on the capabilities of the model but usually in the range of 128 to 2048 pixels.
The aspect ratio of the image can have influence in the generated image like landscape and portrait images can trigger different styles as they are most commonly used for one or the other sort of images. Some models work best on a defined aspect ratio, please check the details of the used model.
seed:integer (optional)
The seed of the initial random image that is taken as starting point for generating the image.
The default setting -1 means that a random seed should be used of generating a “surprise” image. The used seed is returned in the output.
With the same seed, prompt and width and height the exact image can be recreated. Changing either height or width will give a different image, although the seed and prompt was not changed.
negative_prompt (optional)
The optional negative prompt can be used to suppress unwanted features for example specific colors, objects or styles in the generated image.
steps:integer (optional)
The inference steps the diffusion process should be run to develop the image. For ‘turbo’ models only a few steps, usually below 10, are required. For larger models that have a higher control over the diffusion process up to 50 steps can be set. A lower value for steps will result in a faster image, but the resulting image will still be faded and have rough or no details. A higher then recommended setting will over sharpen the image or result in very high contrast HDR like images.
The default setting is the recommended setting for the model.
true_cfg_scale:float (optional)
The cfg_scale stands for “classifier‑free‑guidance” (CFG) scale, it tells the diffusion process how strongly to mix the prompt‑driven noise reduction with the unconditional one at each sampling step. The higher the setting, the more the image generation will focus on the text prompt and the objects it should render; the lower the number, the more the image will have additional random features and lively background.
The range is 0 to 10. The default value is in the mid range.
Not all image-gen models provide this setting, especially the turbo models require a fixed setting of this parameter and will ignore this setting.
quality:string (optional)
The quality parameter has following options “max”, “high”, “fast” and “preview”. It controls the trade off in quality vs speed when computing the diffusion process. The settings are defined as:
- “max” no compromises in computation are made, the complete process is calculated with highest resolution
- “high” is the default setting, the compute resolution is optimized in a way that no noticeable reduction in image quality is achieved
- “fast” the compute makes minimal compromises in image quality to produce the image faster
- “preview” noticeable image quality reduction, useable to get a fast preview of the image that will be generated
In case the prompt, seed and resolution settings are kept the same, the quality setting will reproduce an image with the same composition but depending on the quality setting a shaper, detailed and better illuminated version of the image.
The quality parameter has high impact on the generation speed and offers a more reproducible image than just reducing the number of steps to generate. We would suggest to use this parameter to control the image generation speed in favor over reducing the number of diffusion steps.