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
const axios = require('axios');
const fs = require('fs');
const path = require('path');
async function toB64(imgPath) {
const data = fs.readFileSync(path.resolve(imgPath));
return Buffer.from(data).toString('base64');
}
const api_key = "YOUR API-KEY";
const url = "https://api.segmind.com/v1/qwen-image-edit";
const data = {
"image": "toB64('https://segmind-resources.s3.amazonaws.com/input/32e99b1e-d3b6-4a59-a588-9cfae0675b9d-qwen_display.png')",
"prompt": "replace the text on sign board with 'STOP Qwen Image Edit is on Segmind'",
"negative_prompt": "low quality, noise, extra elements",
"steps": 30,
"guidance": 3.5,
"seed": 760941192,
"image_format": "png",
"quality": 90,
"base64": false
};
(async function() {
try {
const response = await axios.post(url, data, { headers: { 'x-api-key': api_key } });
console.log(response.data);
} catch (error) {
console.error('Error:', error.response.data);
}
})();
Input Image URL or file reference.
Describes what to edit in the image
Avoid specific traits. 'Avoid noise' removes unwanted noise.
Number of steps for generating the image
min : 1,
max : 100
Influence of prompt. Use 4 for stronger control.
min : 1,
max : 25
Seed stabilizes output. Try -1 for randomness.
min : -1,
max : 999999999999999
Choose format for image storage. 'jpeg' for compact files, 'png' for clarity.
Allowed values:
Sets image detail level. Use 80 for web content, 100 for high-quality prints.
min : 10,
max : 100
Outputs base64. True if image as text 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.
Last Updated 19 Aug 2025 By Segmind Team
It is the latest image editing model, built upon the original image generation of Qwen Image , this extends all the capabilities of the original model including high quality text rendering to editing related tasks with precise control even over text elements. It can be used for a range of use cases including adding, removing or changing existing elements of an image while maintaining consistency. This model can also be used to swap styles and update on-image text. Qwen Image Edit handles both high-level semantic transformations and pixel-perfect local tweaks.
negative_prompt="low quality, noise, extra elements"
to suppress unwanted artifacts.steps=40
; increase to 70 for ultra-detailed results, or lower for faster iterations.guidance_scale=4
; raise to 8 for stronger adherence to the prompt.seed=760941192
for reproducible outputs, or seed=-1
for full randomness.Q: How do I choose between semantic and appearance editing?
A: Describe high-level changes (e.g., style, position) for semantic editing. Specify local pixel tweaks (color or texture) for appearance editing.
Q: Can I edit text in both Chinese and English?
A: Yes. Qwen-Image-Edit preserves the original font, size, and style during bilingual text modifications.
Q: Which parameters most affect output quality?
A: steps
, guidance_scale
, and seed
directly influence detail, fidelity, and reproducibility.
Q: How do I avoid unwanted elements?
A: Include a negative_prompt
listing traits to exclude (e.g., “noise,” “blurriness,” “extra objects”).
Q: Is there a limit to image size?
A: For optimal performance, use images at or above 512×512 px. Larger inputs improve detail retention.
Q: What file formats are supported?
A: Standard image formats (JPEG, PNG) are fully supported via URL or direct upload.