Qwen Image Edit Plus Add People Lora Serverless API

Effortlessly generates realistic multi-character scenes with natural interactions for diverse creative applications.

~23.01s
~$0.099
 1import requests
 2import json
 3
 4url = "https://api.segmind.com/v1/qwen-image-edit-plus-add-people"
 5headers = {
 6    "x-api-key": "YOUR_API_KEY",
 7    "Content-Type": "application/json"
 8}
 9
10data = {
11    "prompt": "Generate a cozy family sitting on the sofa and a dog on the floor",
12    "image_1": "https://segmind-resources.s3.amazonaws.com/input/4ef80f21-c076-445f-b0cc-af37e2619733-cozy-living-room-sofa-against-an-empty-white-brick-wall-modern-home-decor-indoor-setting-minimalist-style-free-photo.jpg",
13    "lora": "add_people",
14    "aspect_ratio": "4:3",
15    "seed": 87568756,
16    "image_format": "webp",
17    "quality": 95,
18    "base64": false
19}
20
21response = requests.post(url, headers=headers, json=data)
22
23if response.status_code == 200:
24    result = response.json()
25    print(json.dumps(result, indent=2))
26else:
27    print(f"Error: {response.status_code}")
28    print(response.text)

API Endpoint

POSThttps://api.segmind.com/v1/qwen-image-edit-plus-add-people

Parameters

promptrequired
string

Text prompt describing the desired image edit or generation

Default: "Generate a cozy family sitting on the sofa and a dog on the floor"
aspect_ratiooptional
string

Output image aspect ratio

Default: "4:3"
Allowed values (11 total):
"1:1""2:3""3:2""3:4""4:3""4:5""5:4""9:16""16:9""21:9"+1 more
base64optional
boolean

Return image as base64 encoded string

Default: false
image_1optional
string (uri)

Primary input image (URL or base64)

image_2optional
string (uri)

Secondary input image (URL or base64)

Default: null
image_3optional
string (uri)

Tertiary input image (URL or base64)

Default: null
image_formatoptional
string

Output image format

Default: "webp"
Allowed values :
"jpeg""png""webp"
loraoptional
string

Pre-configured LoRA model to apply

Default: "add_people"
Allowed values :
"add_people"
lora_2_urloptional
string

Additional LoRA model URL. Public direct url or huggingface url pointing to the lora file

Default: null
lora_3_urloptional
string

Additional LoRA model URL. Public direct url or huggingface url pointing to the lora file

Default: null
qualityoptional
integer

Output image quality (1-100)

Default: 95Range: 1 - 100
seedoptional
integer

Random seed for reproducibility. Use -1 for random

Default: nullRange: -1 - 2147483647

Response Type

Returns: Image

Common Error Codes

The API returns standard HTTP status codes. Detailed error messages are provided in the response body.

400

Bad Request

Invalid parameters or request format

401

Unauthorized

Missing or invalid API key

403

Forbidden

Insufficient permissions

404

Not Found

Model or endpoint not found

406

Insufficient Credits

Not enough credits to process request

429

Rate Limited

Too many requests

500

Server Error

Internal server error

502

Bad Gateway

Service temporarily unavailable

504

Timeout

Request timed out