Create Image
HTTP request
POST /ai/image_generation
Authorization
Include your ACCESS TOKEN in HTTP Authorization header
Request Parameters
prompt
String
A brief description or theme for the image you want to generate. Example: “A beautiful flower”
configs
JSON
This parameter is a JSON object encompassing a variety of settings you can adjust to customize the image generation process. It includes several parameters, which we will describe next, allowing you to control different aspects of the generation.
model
String
Specifies the AI model used for generating the image. Default value is “sdxl-lightning”.
lora
String
Indicates the LoRA (Low-Rank Adaptation) used, which can affect the style or aspects of the generated image. LoRa is not used by default.
width
Integer
The width of the generated image in pixels. This should be a positive integer. Common range: 256 to 1024 pixels. Default value is 1024.
height
Integer
The height the of the generated image in pixels. This should be a positive integer. Common range: 256 to 1024 pixels. Default value is 1024.
steps
Integer
The number of steps the model will take to refine the image. Default value is 8 if using the sdxl-lightning model. For SD-1.5, SDXL models, a good setting is 50.
seed
Integer
An initial seed value for the random number generator used in image generation. Can be initialized with any random integer. Default value is -1.
negative_prompt
String
A description of elements you specifically want to exclude from the image. This helps in refining the output to better match your expectations. Example: "No humans, animals".
negative_prompt is not used by default.
enhance_prompt
Boolean
The model will utilize language modeling to enhance and clarify the initial prompt, potentially leading to more detailed and accurate representations. Default value is False.
User Guide
Craft a Detailed Prompt: Begin by crafting a clear and detailed prompt for the image you have in mind. Incorporate all pertinent details to steer the image generation effectively.
Adjust Configuration Settings: Tailor the configuration settings to your preferences. This involves making choices regarding image resolution (width and height), the level of detail (steps), and the expected processing time, balancing these elements according to your needs.
Experiment with Seeds: Leverage the seed parameter to explore different variations of your image. Altering the seed can yield distinct outcomes based on the same initial prompt, offering a range of possibilities.
Refine Using Negative Prompts: Employ the negative_prompt field to eliminate any elements you do not wish to include in your images. This step helps in fine-tuning the results to more accurately reflect your vision.
Enhance Your Prompt for Better Outcomes: Should the results not meet your expectations, consider activating the enhance_prompt feature. A more elaborate prompt may lead to improved image generation.
Example Request
Parrot API
Response
Returns the ID of the successful task.
Last updated
Was this helpful?