Qwen Image Edit Plus Texture Extract Serverless API
Effortlessly extracts and generates seamless, tileable textures from photographs for digital creatives.
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) 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
https://api.segmind.com/v1/qwen-image-edit-plus-texture-extractParameters
promptrequiredstringDescribe the desired image. Use specific details for tailored outputs, like 'sunset over mountains' for nature scenes.
aspect_ratiooptionalstringSet output aspect ratio. Use 'match_input_image' for consistent dimensions or select ratios like '16:9' for widescreen.
"1:1""1:1""2:3""3:2""3:4""4:3""4:5""5:4""9:16""16:9""21:9"+1 morebase64optionalbooleanGet output as a base64 string. Use for easy web embedding.
falseimage_1optionalstring (uri)Upload a base image. Use landscape images for scenery edits, portraits for fashion edits.
image_2optionalstring (uri)Add a secondary image for blending. Ideal for combining images like cityscapes with skies.
nullimage_3optionalstring (uri)Use a tertiary image for texture layering. Choose textures like rust or water for creative effects.
nullimage_formatoptionalstringChoose image output format. 'webp' is efficient; choose 'jpeg' or 'png' for compatibility.
"webp""jpeg""png""webp"loraoptionalstringSelect a LoRA model for texture extraction. Use 'texture_extract' for detailed texture effects.
"texture_extract""texture_extract"lora_2_urloptionalstringInclude an additional LoRA model URL. Useful for specialized effects like artistic filters.
nulllora_3_urloptionalstringInclude another LoRA model URL. Opt for unique URLs for intricate design blending.
nullqualityoptionalintegerSet image quality. Use '95' for high quality and '80' for web optimization.
95Range: 1 - 100seedoptionalintegerSet a seed for reproducible results. Use -1 for random outcomes.
87568756Range: -1 - 2147483647Response Type
Returns: Image
Common Error Codes
The API returns standard HTTP status codes. Detailed error messages are provided in the response body.
Bad Request
Invalid parameters or request format
Unauthorized
Missing or invalid API key
Forbidden
Insufficient permissions
Not Found
Model or endpoint not found
Insufficient Credits
Not enough credits to process request
Rate Limited
Too many requests
Server Error
Internal server error
Bad Gateway
Service temporarily unavailable
Timeout
Request timed out