Qwen Image Edit Plus Texture Apply Serverless API

Apply precise textures to images using natural language.

~23.41s
POST /v2/qwen-image-edit-plus-texture-apply ยท submit + poll
 1# pip install "segmind>=1.1.0"
 2# export SEGMIND_API_KEY="YOUR_API_KEY"
 3import segmind
 4
 5# Async (v2): submit to the queue and block until COMPLETED.
 6# run() returns the final result dict (600s deadline, 1.0s poll by default).
 7result = segmind.run(
 8    "qwen-image-edit-plus-texture-apply",
 9    prompt="Create an abstract wallpaper with vivid colors.",
10    image_1="https://segmind-resources.s3.amazonaws.com/input/b867774a-9e1e-4e4d-97bd-a58a2a7dda46-71REuLDVgVL._AC_UF8941000_QL80_.jpg",
11    image_2="https://segmind-resources.s3.amazonaws.com/input/5fc29fb9-0fe9-46bd-8e09-38915d7bd18d-Oxford_Pink_Flat.jpg",
12    lora="texture_apply",
13    aspect_ratio="4:5",
14    seed=87568756,
15    image_format="webp",
16    quality=95,
17    base64=False,
18)
19print(result["status"])                      # COMPLETED
20print(result.get("output"))                  # model output (e.g. media URL)
21print(result["metrics"]["inference_time"])   # server compute seconds
22
23# --- Or submit + poll manually (track request_id, control the cadence) ---
24from segmind import SegmindClient, InferenceFailed, InferenceTimeout
25
26client = SegmindClient()                      # reads SEGMIND_API_KEY
27payload = {
28    "prompt": "Create an abstract wallpaper with vivid colors.",
29    "image_1": "https://segmind-resources.s3.amazonaws.com/input/b867774a-9e1e-4e4d-97bd-a58a2a7dda46-71REuLDVgVL._AC_UF8941000_QL80_.jpg",
30    "image_2": "https://segmind-resources.s3.amazonaws.com/input/5fc29fb9-0fe9-46bd-8e09-38915d7bd18d-Oxford_Pink_Flat.jpg",
31    "lora": "texture_apply",
32    "aspect_ratio": "4:5",
33    "seed": 87568756,
34    "image_format": "webp",
35    "quality": 95,
36    "base64": False,
37}
38job = client.submit_async("qwen-image-edit-plus-texture-apply", **payload)
39print(job.request_id)                         # available immediately
40try:
41    result = job.wait(timeout=600, interval=1.0)
42except InferenceTimeout as e:
43    print("still running:", e.request_id)
44except InferenceFailed as e:
45    print("failed:", e.detail)

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

Asynchronous requests (v2)

Use Async for video, long-running (>~60s), or high-concurrency workloads; Sync is simplest for fast image & LLM calls. Async submits a request and you poll it to completion.

  1. 1
    POST /v2/qwen-image-edit-plus-texture-apply

    Submit โ€” returns request_id, status_url, response_url

  2. 2
    GET /v2/requests/{id}/status

    Poll โ€” until COMPLETED or FAILED

  3. 3
    GET /v2/requests/{id}

    Result โ€” final response body

Status states

QUEUEDโ€” Accepted, waiting for a worker
PROCESSINGโ€” Running on a worker
COMPLETEDโ€” Done โ€” result body is ready
FAILEDโ€” Errored (incl. content/RAI blocks)
  • A FAILED request is served as HTTP 422 โ€” the body still carries the error detail.
  • An unknown or expired request_id returns HTTP 404.
  • Results are retained for 1 hour, then expire.
  • Content / RAI blocks surface as FAILED, not a separate state.
  • Track completion by polling the status endpoint.

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