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


promptstr *

Describes what to edit in the image


negative_promptstr ( default: None )

Avoid specific traits. 'Avoid noise' removes unwanted noise.


stepsint *

Number of steps for generating the image

min : 1,

max : 100


guidancefloat ( default: 3.5 )

Influence of prompt. Use 4 for stronger control.

min : 1,

max : 25


seedint ( default: 760941192 )

Seed stabilizes output. Try -1 for randomness.

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 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.

Qwen Image edit - The latest Image Editing Model

Last Updated 19 Aug 2025 By Segmind Team

What is Qwen-Image-Edit?

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.

Key Features

  • Text Editing: Edit text (supports English and Chinese) in images; maintains original font, size, and style.
  • Semantic Editing: Modify objects or image context. Example: change weather, swap art styles, reposition elements.
  • Appearance Editing: Precisely adjust local pixels (color, texture, shape) without altering the rest of the scene.

Best Use Cases

  • UI/UX Mockups: Update on-screen text, switch languages, refine interface elements.
  • E-commerce & Packaging: Swap product labels, rotate packaging, adapt promotional banners for different markets.
  • Creative IP Generation: Generate brand-consistent assets by transferring painting or photography styles.

Prompt Tips and Output Quality

  1. Clear Semantic Prompts
    E.g., “Rotate the car 30° clockwise,” or “Change background to night sky.”
  2. Negative Prompting
    Use negative_prompt="low quality, noise, extra elements" to suppress unwanted artifacts.
  3. Adjust Steps
    Default steps=40; increase to 70 for ultra-detailed results, or lower for faster iterations.
  4. Tweak Guidance Scale
    Default guidance_scale=4; raise to 8 for stronger adherence to the prompt.
  5. Set Seed
    Use seed=760941192 for reproducible outputs, or seed=-1 for full randomness.
  6. High-Resolution Inputs
    Supply images ≥512×512 px to maximize detail and minimize artifacts.

FAQs

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.