Qwen Image Edit Fast

Qwen-Image-Edit enables precise bilingual image editing for seamless localization and professional content creation.


API

If you're looking for an API, you can choose from your desired programming language.

POST
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 import requests import base64 # Use this function to convert an image file from the filesystem to base64 def image_file_to_base64(image_path): with open(image_path, 'rb') as f: image_data = f.read() return base64.b64encode(image_data).decode('utf-8') # Use this function to fetch an image from a URL and convert it to base64 def image_url_to_base64(image_url): response = requests.get(image_url) image_data = response.content return base64.b64encode(image_data).decode('utf-8') # Use this function to convert a list of image URLs to base64 def image_urls_to_base64(image_urls): return [image_url_to_base64(url) for url in image_urls] api_key = "YOUR_API_KEY" url = "https://api.segmind.com/v1/qwen-image-edit-fast" # Request payload data = { "image": image_url_to_base64("https://segmind-resources.s3.amazonaws.com/input/354cdf06-8901-4f0c-a9e0-8bf72bcb2859-5769d60b13eeba42135ff0c65db49c14.png"), # Or use image_file_to_base64("IMAGE_PATH") "prompt": "Change '1000$' to '5$' in the poster", "steps": 8, "guidance": 1, "seed": 760941192, "image_format": "png", "quality": 90, "base64": False } headers = {'x-api-key': api_key} response = requests.post(url, json=data, headers=headers) print(response.content) # The response is the generated image
RESPONSE
image/jpeg
HTTP Response Codes
200 - OKImage Generated
401 - UnauthorizedUser authentication failed
404 - Not FoundThe requested URL does not exist
405 - Method Not AllowedThe requested HTTP method is not allowed
406 - Not AcceptableNot enough credits
500 - Server ErrorServer had some issue with processing

Attributes


imageimage *

Input Image URL or file reference. Use a recognizable sign for editing text.


promptstr *

Describes what to edit in the image. Be clear about text changes or other edits needed.


stepsint *

Defines the precision of editing. Use 8 for balanced speed and quality.

min : 1,

max : 20


guidancefloat ( default: 1 )

Controls adherence to prompt. Set 4 for stronger influence on changes.

min : 1,

max : 25


seedint ( default: 760941192 )

Ensures reproducibility of edits. Use -1 for random creative results.

min : -1,

max : 999999999999999


image_formatenum:str ( default: png )

Choose format for image storage. 'jpeg' for compact files, 'png' for clarity.

Allowed values:


qualityint ( default: 90 )

Sets image detail level. Use 80 for web content, 100 for high-quality prints.

min : 10,

max : 100


base64boolean ( default: 1 )

Outputs image as text. Set true if integration with text-based systems needed.

To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.

Resources to get you started

Everything you need to know to get the most out of Qwen Image Edit Fast

# Qwen Image Edit Guide

This guide outlines best practices and parameter recommendations for using the Qwen Image Edit model on Segmind. By adjusting key settings—`steps`, `guidance`, `seed`, and `base64`—you can optimize for speed, quality, creativity, or reproducibility.

---

## 1. Core Inputs

- **image** (required): URL or file reference of the source image.  
- **prompt** (required): A clear, concise description of edits. E.g., “replace the text on sign board with ‘Welcome to Qwen Image Edit on Segmind’.”

---

## 2. Key Parameters

1. **steps** (int, 1–20)  
   - Controls the number of diffusion iterations.  
   - Default: 8 for balanced speed & quality.  
   - Lower (1–4): Fast, but rough results.  
   - Higher (12–20): Finer details at the cost of longer runtime.

2. **guidance** (float, 1–25)  
   - Adjusts how strictly the model follows your prompt.  
   - Default: 1 (light guidance).  
   - Increase to ~4–8 for stronger adherence to text or precise edits.  
   - Values above 12 can produce overfitting or artifacts.

3. **seed** (int, –1 or [0 to 1e15])  
   - Controls randomness and reproducibility.  
   - Set `seed = –1` for entirely random, creative outputs each run.  
   - Use a fixed positive seed (e.g., 760941192) to replicate the same result.

4. **base64** (boolean)  
   - If `true`, returns the edited image as a Base64 string.  
   - Ideal for text-based workflows or APIs that embed images in payloads.  
   - Default: `false` delivers a standard image file link.

---

## 3. Recommended Settings by Use Case

| Use Case               | steps | guidance | seed      | base64 |
|------------------------|-------|----------|-----------|--------|
| Quick Mockups          | 4     | 1        | –1        | false  |
| Precise Text Replacements | 8     | 4        | 123456789 | false  |
| High-Fidelity Edits    | 15    | 6        | 987654321 | false  |
| Creative Variations    | 12    | 2        | –1        | false  |
| API/Text Integration   | 8     | 4        | 555000444 | true   |

---

## 4. Tips for Best Results

- Be explicit in the **prompt**: mention exact wording, font style, or color when editing text.  
- Preview with low `steps` before scaling up.  
- Lock down the **seed** for consistent A/B testing.  
- Gradually increase **guidance** to avoid unnatural artifacts.  
- Use **base64** when embedding images in JSON responses.

By tailoring these parameters, you can harness Qwen Image Edit’s full power—whether you need rapid mockups, precise signboard updates, or imaginative transformations. Happy editing!

Other Popular Models

Discover other models you might be interested in.

Cookie settings

We use cookies to enhance your browsing experience, analyze site traffic, and personalize content. By clicking "Accept all", you consent to our use of cookies.