Qwen Image Edit Plus Texture Apply Serverless API

Seamlessly applies precise textures to images based on natural language prompts for enhanced visual quality.

~23.41s
~$0.1
 1import requests
 2import json
 3
 4url = "https://api.segmind.com/v1/qwen-image-edit-plus-texture-apply"
 5headers = {
 6    "x-api-key": "YOUR_API_KEY",
 7    "Content-Type": "application/json"
 8}
 9
10data = {
11    "prompt": "Create an abstract wallpaper with vivid colors.",
12    "image_1": "https://segmind-resources.s3.amazonaws.com/input/b867774a-9e1e-4e4d-97bd-a58a2a7dda46-71REuLDVgVL._AC_UF8941000_QL80_.jpg",
13    "image_2": "https://segmind-resources.s3.amazonaws.com/input/5fc29fb9-0fe9-46bd-8e09-38915d7bd18d-Oxford_Pink_Flat.jpg",
14    "lora": "texture_apply",
15    "aspect_ratio": "4:5",
16    "seed": 87568756,
17    "image_format": "webp",
18    "quality": 95,
19    "base64": false
20}
21
22response = requests.post(url, headers=headers, json=data)
23
24if response.status_code == 200:
25    result = response.json()
26    print(json.dumps(result, indent=2))
27else:
28    print(f"Error: {response.status_code}")
29    print(response.text)

API Endpoint

POSThttps://api.segmind.com/v1/qwen-image-edit-plus-texture-apply

Parameters

promptrequired
string

Describe the image edit or generation task. Use descriptive prompts for best results.

Default: "A beautiful photo"
aspect_ratiooptional
string

Select output image aspect ratio. 'Match input' keeps original proportions.

Default: "match_input_image"
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. Useful for embedding images in JSON.

Default: false
image_1optional
string (uri)

Add a primary image for editing. Use URLs for easy access to online images.

image_2optional
string (uri)

Include a secondary image if needed. Useful for compositing multiple images.

image_3optional
string (uri)

Insert a third image optionally. Great for complex projects needing more images.

Default: ""
image_formatoptional
string

Choose output format. 'WEBP' is great for quality and compression.

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

Apply a predefined LoRA model. 'texture_apply' works for texture enhancements.

Default: "texture_apply"
Allowed values :
"texture_apply"
lora_2_urloptional
string

Provide URL for an additional LoRA model. Use for custom LoRA model integration.

Default: ""
lora_3_urloptional
string

Include a third LoRA model via URL. Suitable for advanced users with multiple models.

Default: ""
qualityoptional
integer

Set output quality. Use higher values for better quality, 95 is a good balance.

Default: 95Range: 1 - 100
seedoptional
integer

Set seed for repeatability. Use -1 for uniqueness each time.

Default: 87568756Range: -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