Generate image from text
Body Required
-
The ID of the model to be used.
-
Text prompt with description of the things you want in the image to be generated
-
negative_prompt string
Items you don't want in the image
-
Max Width: 1024x1024
Minimum value is
1
, maximum value is1024
. Default value is512
. -
Max Height: 1024x1024
Minimum value is
1
, maximum value is1024
. Default value is512
. -
samples number
Number of images to generate
Minimum value is
1
, maximum value is1
. Default value is1
. -
Number of denoising steps, The value accepts 21,31,41.
Minimum value is
5
, maximum value is25
. Default value is21
. -
A checker for NSFW images. If such an image is detected, it will be replaced by a blank image.
Values are
yes
orno
. Default value isyes
. -
Type of safety checker
Values are
blur
,sensitive_content_text
,pixelate
, orblack
. Default value issensitive_content_text
. -
enhance_prompt Required
Enhance prompts for better results.
Values are
yes
orno
. Default value isyes
. -
seed string
Seed is used to reproduce results, same seed will give you same image in return again. Pass null for a random number.
-
Scale for classifier-free guidance (minimum: 1; maximum: 20)
Minimum value is
0
, maximum value is20
. Default value is7.5
. -
Set this parameter to "yes" to generate a panorama image.
Values are
yes
orno
. Default value isyes
. -
If you want a high quality image, set this parameter to "yes". In this case the image generation will take more time.
Values are
yes
orno
. Default value isyes
. -
Set this parameter to "yes" if you want to upscale the given image resolution two times (2x). If the requested resolution is 512 x 512 px, the generated image will be 1024 x 1024 px.
Values are
yes
orno
. Default value isyes
. -
embeddings_model string
Use it to pass an embeddings model.
-
Enable tomesd to generate images: gives really fast results
Values are
yes
orno
. Default value isyes
. -
Use keras sigmas to generate images. Gives nice results.
Values are
yes
orno
. Default value isyes
. -
Used in DPMSolverMultistepScheduler scheduler.
Value is
dpmsolver+++
. Default value isdpmsolver+++
. -
vae string
Use custom vae in generating images.
-
lora_strength string
Specify the strength of the LoRa model you're using. If using multiple LoRa, provide each value as a comma-separated range from minimum 0.1 to maximum 1.
Default value is
1
. -
lora_model string
Multi lora is supported, pass comma saparated values. Example
lora1,lora2
-
Scheduler to be used for image generation.
-
clip_skip number
Number of frames to skip in clip.
Minimum value is
1
, maximum value is10
. Default value is2
. -
Fix high resolution images.
Values are
yes
orno
. Default value isyes
. -
The image to be used as input.
-
Link to the mask image for inpainting.
curl \
-X POST https://api.itsrose.rest/sdapi/inpaint \
-H "Content-Type: application/json" \
-d '{"model_id":"string","prompt":"string","negative_prompt":"string","width":512,"height":512,"samples":1,"num_inference_steps":21,"safety_checker":"yes","safety_checker_type":"sensitive_content_text","enhance_prompt":"yes","seed":"string","guidance_scale":7.5,"panorama":"yes","self_attention":"yes","upscale":"yes","embeddings_model":"string","tomesd":"yes","use_karras_sigmas":"yes","algorithm_type":"dpmsolver+++","vae":"string","lora_strength":"1","lora_model":"string","scheduler":"string","clip_skip":2,"highres_fix":"yes","init_image":"string","mask_image":"string"}'
{
"model_id": "string",
"prompt": "string",
"negative_prompt": "string",
"width": 512,
"height": 512,
"samples": 1,
"num_inference_steps": 21,
"safety_checker": "yes",
"safety_checker_type": "sensitive_content_text",
"enhance_prompt": "yes",
"seed": "string",
"guidance_scale": 7.5,
"panorama": "yes",
"self_attention": "yes",
"upscale": "yes",
"embeddings_model": "string",
"tomesd": "yes",
"use_karras_sigmas": "yes",
"algorithm_type": "dpmsolver+++",
"vae": "string",
"lora_strength": "1",
"lora_model": "string",
"scheduler": "string",
"clip_skip": 2,
"highres_fix": "yes",
"init_image": "string",
"mask_image": "string"
}
{
"status": true,
"message": "success",
"result": {
"generation_time": 42.0,
"images": [
"string"
],
"nsfw_content_detected": true,
"meta": {
"model_id": "string",
"prompt": "string",
"negative_prompt": "string",
"width": 512,
"height": 512,
"samples": 1,
"num_inference_steps": 21,
"safety_checker": "yes",
"safety_checker_type": "sensitive_content_text",
"enhance_prompt": "yes",
"seed": "string",
"guidance_scale": 7.5,
"panorama": "yes",
"self_attention": "yes",
"upscale": "yes",
"embeddings_model": "string",
"tomesd": "yes",
"use_karras_sigmas": "yes",
"algorithm_type": "dpmsolver+++",
"vae": "string",
"lora_strength": "1",
"lora_model": "string",
"scheduler": "string",
"clip_skip": 2,
"highres_fix": "yes",
"init_image": "string",
"mask_image": "string"
}
}
}
{
"status": false,
"message": "string",
"result": {}
}
{
"status": false,
"message": "string",
"result": {}
}
{
"status": false,
"message": "string",
"result": {}
}