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
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-fast";
const data = {
"image": "toB64('https://segmind-resources.s3.amazonaws.com/input/354cdf06-8901-4f0c-a9e0-8bf72bcb2859-5769d60b13eeba42135ff0c65db49c14.png')",
"prompt": "Change '1000$' to '5$' in the poster",
"steps": 8,
"guidance": 1,
"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. Use a recognizable sign for editing text.
Describes what to edit in the image. Be clear about text changes or other edits needed.
Defines the precision of editing. Use 8 for balanced speed and quality.
min : 1,
max : 20
Controls adherence to prompt. Set 4 for stronger influence on changes.
min : 1,
max : 25
Ensures reproducibility of edits. Use -1 for random creative results.
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 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.
Qwen-Image-Edit, built on the Qwen-Image foundation model, is an advanced AI for image editing developed using an impressive 20-billion-parameter model. Its powerful design can seamlessly render context-aware images with precision, as it integrates semantic understanding with pixel-perfect control that can work magic on images while simultaneously maintaining their essence and quality. Qwen-Image-Edit can perform two starkly different tasks with ease: content changes at a broader level and precision editing over selected regions - a perfect model for professional image modification workflows.
A major aspect that further sets Qwen-Image-Edit apart from its rivals is its bilingual text editing capability, i.e., it can modify text within the targeted images in English and Chinese, while ensuring that the original fonts, styles, and visual coherence remain intact. This unique feature makes it an excellent tool when it comes to localization, signage editing, and multilingual content creation.
In addition to this, Qwen-Image-Edit excels in signage editing, product photography enhancement, social media content adaptation, and multilingual marketing materials. It's especially vital for businesses that operate across English and Chinese markets, enabling them to execute content localization while maintaining the brand's visual identity universally.
For best results, use high-resolution source images that you want to edit, that has clear text or well-defined objects .
Is Qwen-Image-Edit open-source? Qwen-Image-Edit is based on open research but available through Segmind's API platform for seamless integration.
How does it differ from other image editing models? Unlike standard models, Qwen-Image-Edit uses an impressive 20-billion-parameter model that offers bilingual text editing and combines semantic understanding with precise regional control.
What image formats are supported? The model accepts standard image formats, including JPEG, PNG, and WebP, through URL or file upload.
Can it handle complex text editing tasks? Yes, it maintains original fonts and styles while editing English and Chinese texts within images.
What's the optimal steps parameter for production use? Use '8 steps' for the majority of applications, as it provides a remarkable balance of quality and processing speed.
Does it work well with low-resolution images? Though it can process various resolutions without any problem, but higher-quality source images yield better editing precision and higher output quality.