Endpoint:
https://endpoint.example.com/api/generate_image
HTTP Method:
POST
Request Parameters:
dev_key (required):
Type: String
Description: Your developer key to authenticate the API request.
Example:
"your-dev-key"
model (required):
Type: String
Description: The model to be used for generating the image. Different models are optimized for various styles and outputs.
Example:
"realisticVisionV60B1_v51VAE"
Access the list of all models here
prompt (required):
Type: String
Description: A textual description of the image you want to generate.
Example:
"shoe"
width (required):
Type: Integer
Description: The width of the generated image in pixels.
Example:
"512"
height (required):
Type: Integer
Description: The height of the generated image in pixels.
Example:
"512"
seed (optional):
Type: Integer
Description: A numerical seed for reproducibility. Use
-1
for a random seed.Example:
"-1"
styles (optional):
Type: String
Description: Specifies the art style to apply to the image. Use
"None"
if no specific style is desired.Example:
"None"
Access the list of all styles here
cfg_scale (optional):
Type: Float
Description: Adjusts the adherence to the input prompt. Higher values make the image follow the prompt more closely.
Example:
"7"
steps (optional):
Type: Integer
Description: The number of iterations for refining the image. More steps generally result in higher quality.
Example:
"30"
enable_hr (optional):
Type: Boolean
Description: Enables high-resolution mode. Use
"True"
to enable and"False"
to disable.Example:
"False"
negative_prompt (optional):
Type: String
Description: Specifies elements or themes to exclude from the image.
Example:
""
prompt_temp (optional):
Type: Float
Description: Controls the creativity of the prompt. Higher values result in more creative outputs.
Example:
"0.8"
prompt_top_p (optional):
Type: Float
Description: Controls the probability distribution for the prompt. Higher values result in more deterministic outputs.
Example:
"0.9"
designer (optional):
Type: Boolean
Description: Enables the Object Designer feature. Use
"True"
to generate isolated objects without a background and"False"
otherwise.Example:
"False"
enhance_prompt (optional):
Type: Boolean
Description: Enhances the input prompt to improve image quality. If
designer
isTrue
, only the designer prompt enhancement is applied. Ifdesigner
isFalse
andenhance_prompt
isTrue
, the prompt is enhanced without applying styles.Example:
"True"
Conditions and Behavior:
Styles Application:
Styles can be applied regardless of the
enhance_prompt
setting. The specified style will influence the visual aesthetics of the generated image.
Designer Prompt Enhancement:
If
designer
isTrue
, the designer prompt enhancement will be applied, focusing on generating the object without a background, suitable for product photography and further customization.
General Prompt Enhancement:
If
designer
is notTrue
andenhance_prompt
isTrue
, the input prompt will be enhanced to potentially improve the quality and coherence of the generated image. This enhancement does not include style modifications.
Example cURL Request:
curl --location 'https://endpoint.example.com/api/generate_image' \
--form 'dev_key="your-dev-key"' \
--form 'model="realisticVisionV60B1_v51VAE"' \
--form 'prompt="shoe"' \
--form 'width="512"' \
--form 'height="512"' \
--form 'seed="-1"' \
--form 'styles="None"' \
--form 'cfg_scale="7"' \
--form 'steps="30"' \
--form 'enable_hr="False"' \
--form 'negative_prompt=""' \
--form 'prompt_temp="0.8"' \
--form 'prompt_top_p="0.9"' \
--form 'designer="False"' \
--form 'enhance_prompt="True"'
Response:
The response will contain the generated image data or an error message if the request was not successful.
Usage Notes:
Ensure your developer key (
dev_key
) is valid to authenticate the request.Adjust the
prompt
parameter to accurately describe the desired image.Use
cfg_scale
andsteps
to control the quality and adherence of the generated image.Utilize the
seed
parameter for reproducibility if you need to generate the same image multiple times.Enable
designer
mode for creating isolated objects without backgrounds, suitable for product photography and further customization.Consider using the
enhance_prompt
feature to refine the image quality based on the input prompt.
This documentation provides the necessary information to effectively utilize the Image Generation API, enabling users to create high-quality, customized images. If further assistance is needed, please refer to the support documentation or contact the support team.