POST
javascript
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); } })();
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.

Qwen-Image-Edit – AI Image Editing Model

What is Qwen-Image-Edit?

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.

Key Features

  • Semantic and appearance editing – Supports the modification of content meaning or fine-tuning specific visual elements
  • Bilingual text editing – Unique feature that supports editing of English and Chinese text while preserving the original layout
  • Regional precision control – Capable of making targeted changes with precision without affecting surrounding areas
  • Style transfer capabilities – Easy to apply artistic styles and visual transformations
  • Object manipulation – Liberty to modify images in multiple ways - rotate, reposition, or modify objects within scenes
  • VAE-powered quality preservation – Dependable when it comes to maintaining image fidelity during complex edits

Best Use Cases

  • For creative agencies, it's a huge time-saver as they can quickly create and revise mockups for clients in no time.
  • E-commerce teams can use it to create different versions of product images for A/B testing so they can determine which ones will perform better.
  • Marketing departments can utilize it to customize campaigns for different regions and create brand images as per their specific needs.

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.

Prompt Tips and Output Quality

  • Write clear, specific prompts that precisely describe your intended changes.
  • For text editing, specify exactly what text should be replaced; for example, the prompt - "replace the text on the sign with 'Welcome to Our Store'" - works better than "change the sign."
  • Use '8 steps' for balanced speed and quality, as it will render perfect results for most editing tasks.
  • Increase 'guidance to 4' when you need precise output based on your prompt, especially when you need to perform complex semantic changes.
  • Set 'seed to -1' for creative variations, or use a fixed value for consistent results across iterations.

For best results, use high-resolution source images that you want to edit, that has clear text or well-defined objects .

FAQs

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.