Text-to-Image
Overview
The Text to Image API is a service that generates high-quality images based on text prompts. AI creates images according to text descriptions provided by users. This service supports API key authentication, rate limiting, and usage-based billing through a stardust token system. Currently, it provides basic image generation capabilities, with plans to add more diverse and customized image generation features using the illustrious model and LoRA (Low-Rank Adaptation) technology in the future.
Generate an image from text
This API endpoint generates images from text. It creates images based on user-provided prompts, negative prompts, and various generation parameters. Users can configure numerous detailed settings including image resolution, generation steps, CFG scale, seed value, and sampler options. After image generation, stardust tokens are deducted, and the API returns the image along with the amount of tokens used and the remaining token balance. If the token balance is insufficient, an error occurs.
Parameters
This endpoint generates an image based on the input prompt and configuration parameters.
modelId
·
integer
required
Example:
1
prompt
·
string
required
Example:
"masterpiece, extremely aesthetic, newest, very vibrant colors"
negativePrompt
·
string
required
Example:
"worst quality, low quality, low details, bad quality, poorly drawn, bad anatomy, multiple views, bad hands, blurry, artist sign, weibo username"
height
·
integer
required
Example:
512
width
·
integer
required
Example:
512
steps
·
integer
required
Example:
28
cfgScale
·
integer
required
Example:
7.5
seed
·
integer
required
Example:
-1
samplerName
·
string
required
'euler'
'euler_cfg_pp'
'euler_ancestral'
'euler_ancestral_cfg_pp'
'dpm_2'
'dpm_2_ancestral'
'dpmpp_2s_ancestral'
'dpmpp_2s_ancestral_cfg_pp'.
Example:
"euler_ancestral"
scheduler
·
string
required
Enter the scheduler type for image generation. Must be one of:
'normal'
'karras'
'exponential'
'sgm_uniform'
'simple'
'ddim_uniform'
'beta'.
Example:
"normal"
Rate Limit
The Text to Image API implements rate limiting to prevent excessive requests. In cases of abuse such as sudden high volume of requests, continuous automated repetitive requests, etc., action may be taken without warning.
Status Codes
All API queries return HTTP status codes that can tell you more about the response.
201 Created
The request was successful.
400 Bad Request
The request was invalid or cannot be otherwise served. An accompanying error message will explain further.
429 Too Many Requests
The request was rate limited. Please try again later.
404 Not Found
The requested resource was not found.
500 Internal Server Error
The server encountered an error. Please try again later or contact support.
Post
/text-to-image/generate
Content-Type: application/json
x-illustrious-api-key: YOUR_API_KEY
{
“modelId”: : 5,
“steps”: 28,
“width”: 768,
“height”: 768,
“prompt”: A vibrant girl with long, flowing pastel pink hair and sparkling violet eyes, seen from the waist up. She smiles gently with a soft blush, raising one hand in a playful wave. Her outfit is a detailed cropped jacket with metallic accents, paired with a layered lace corset and choker adorned with a glowing crystal pendant. Her hair is styled in loose twin tails with butterfly clips and ribbon strands. Behind her, soft bokeh lights and luminous clouds create a dreamy sunset atmosphere. Petals and sparkles drift in the air. Her expression is warm and inviting, full of charm and softness, as if she’s about to speak directly to the viewer.,
“negative_prompt”: worst quality, low quality, lowers, low details, bad quality, poorly drawn, bad anatomy, multiple views, bad hands, blurry, artist sign, weibo username,
“cfgScale”: 7.4,
“seed”: -1,
“samplerName”: “euler”,
“scheduler”: “normal”,
}Response
{
“images”: [...base64String],
“stardustUsage”: “3”,
“stardustBalance”: “98949385”
}by Onoma AI
Address : 201, 2F, D-dong, 47, Maeheon-ro 8-gil, Seocho-gu, Seoul, 06770, Rep. of KOREA
Business Registration Certificate : 450-86-02454
CEO : Min Song
Contact : illustrious@onomaai.com