Img Open English
  1. image tool
Img Open English
  • AI image generation
    • sd text2image
      POST
    • sd Image to Image
      POST
    • sd controlnet
      POST
    • QueryModelList
      POST
    • QueryLoralList
      POST
    • QueryVaeList
      POST
    • queryEmbeddingList
      POST
  • task query
    • queryTaskInfoV1.0
      POST
    • queryTaskInfoV2.0
      POST
    • queryImageToolTaskInfo
      POST
  • train model
    • Submit training task
    • Training result query
  • image tool
    • Flux text2image
      POST
    • Single Face Swap V1.0
      POST
    • Single Face Swap V2.0
      POST
    • instantID
      POST
    • Face restoration
      POST
    • Super Resolution
      POST
    • image description
      POST
    • Multiple Face Swap
      POST
    • Face Detection
      POST
    • Prompt expansion
      POST
    • Hairstyle changer
      POST
    • Object Removal
      POST
    • Style recognition
      POST
    • Outpainting
      POST
    • CNT preview
      POST
    • background remove
      POST
    • image enlarge
      POST
    • image watermark
      POST
  1. image tool

Prompt expansion

POST
/AIGCImgOpenServ/saas/tool/prompts/expand
This interface supports prompt word expansion, and the underlying algorithm supports SD and SDXL

Request

Header Params
X-Request-req-accessKeyId
string 
required
X-Request-req-accessKeySecret
string 
required
Body Params application/json
businessTaskId
string 
required
mode
integer 
required
0:SD,1:SDXL
sourcePrompt
string 
required
topK
integer 
optional
Value range: [0, 250], precision is 1; when generating the next token, only the top k tokens with the highest probability can be considered; the larger the value, the greater the diversity of the generated text; the smaller the value, the diversity of the generated text The smaller; when K=0, this sampling mode is disabled
topP
number 
optional
Value range: [0.01, 1.00], accuracy is 0.01; when generating the next token, only tokens with cumulative probability reaching top_p from high to low are truncated and selected for prediction; the larger the value, the higher the diversity.
temperature
number 
optional
Value range: [0.1, 3.0], accuracy is 0.1; used to adjust the probability of predicting the next token; the larger the value, the higher the randomness and diversity; temperature=1 means no effect
repetitionPenalty
number 
optional
Value range: [0.1, 5.0], precision is 0.1; repetition penalty coefficient, repetition_penalty=1 means no penalty
maxTokens
integer 
optional
Value range: [32, 512], precision is 16; the maximum number of tokens allowed to be generated, regardless of the number of tokens in the input prompt; the larger the setting, the longer the prompt may be generated and the longer it will take
minTokens
integer 
optional
Value range: [16, max_new_tokens], precision is 16; the minimum number of tokens generated does not take into account the number of tokens in the input prompt
sequencesNum
integer 
optional
Value range: [1, 10], precision is 1; the larger the number of prompts generated at one time, the longer it takes. When using the gpt2 model, it is best to set it to less than 3. If there are too many prompts, multiple prompts will be generated repeatedly.
Example
{
    "mode": 0,
    "sourcePrompt": "a girl",
    "businessTaskId": "1008699601"
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.zhiqite.com/AIGCImgOpenServ/saas/tool/prompts/expand' \
--header 'X-Request-req-accessKeyId;' \
--header 'X-Request-req-accessKeySecret;' \
--header 'Content-Type: application/json' \
--data-raw '{
    "mode": 0,
    "sourcePrompt": "a girl",
    "businessTaskId": "1008699601"
}'

Responses

🟢200成功
application/json
Body
code
string 
required
msg
string 
required
data
object 
optional
status
integer 
required
0: Failure, 2: Success
prompts
array[string]
required
taskId
string 
required
toolTask
string 
required
businessTaskId
string 
required
Example
{
    "code": "200",
    "msg": "success",
    "data": {
        "status": 0,
        "prompts": [
            "masterpiece, (photorealistic:1.4), best quality, beautiful lighting, 1 girl, solo, highly detailed face, detailed eyes, delicate features, looking at viewer, ultra-detailed, UHD, HDR"
        ],
        "taskId": "pre1715773856999364951840",
        "toolTask": "sd_prompts"
    }
}
Modified at 2024-08-29 10:05:25
Previous
Face Detection
Next
Hairstyle changer
Built with