Qwen Image Edit Plus Texture Extract Serverless API

Effortlessly extracts and generates seamless, tileable textures from photographs for digital creatives.

~23.38s
~$0.102
 1import requests
 2import json
 3
 4url = "https://api.segmind.com/v1/qwen-image-edit-plus-texture-extract"
 5headers = {
 6    "x-api-key": "YOUR_API_KEY",
 7    "Content-Type": "application/json"
 8}
 9
10data = {
11    "prompt": "Extract stone texture from the wall. Extract into a texture image.",
12    "image_1": "https://segmind-resources.s3.amazonaws.com/input/73db8f48-bbbb-43e9-8758-ed99c88c3654-08-scaled.jpg",
13    "lora": "texture_extract",
14    "aspect_ratio": "1:1",
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-texture-extract

Parameters

promptrequired
string

Describe the desired image. Use specific details for tailored outputs, like 'sunset over mountains' for nature scenes.

aspect_ratiooptional
string

Set output aspect ratio. Use 'match_input_image' for consistent dimensions or select ratios like '16:9' for widescreen.

Default: "1:1"
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

Get output as a base64 string. Use for easy web embedding.

Default: false
image_1optional
string (uri)

Upload a base image. Use landscape images for scenery edits, portraits for fashion edits.

image_2optional
string (uri)

Add a secondary image for blending. Ideal for combining images like cityscapes with skies.

Default: null
image_3optional
string (uri)

Use a tertiary image for texture layering. Choose textures like rust or water for creative effects.

Default: null
image_formatoptional
string

Choose image output format. 'webp' is efficient; choose 'jpeg' or 'png' for compatibility.

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

Select a LoRA model for texture extraction. Use 'texture_extract' for detailed texture effects.

Default: "texture_extract"
Allowed values :
"texture_extract"
lora_2_urloptional
string

Include an additional LoRA model URL. Useful for specialized effects like artistic filters.

Default: null
lora_3_urloptional
string

Include another LoRA model URL. Opt for unique URLs for intricate design blending.

Default: null
qualityoptional
integer

Set image quality. Use '95' for high quality and '80' for web optimization.

Default: 95Range: 1 - 100
seedoptional
integer

Set a seed for reproducible results. Use -1 for random outcomes.

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