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
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-plus-eraser";
const data = {
"prompt": "Remove the woman",
"image_1": "toB64('https://segmind-resources.s3.amazonaws.com/input/3a92117c-b205-4586-b460-bc4bdbf984c4-output_0.webp')",
"image_2": "toB64('')",
"image_3": "toB64('')",
"lora": "eraser",
"aspect_ratio": "match_input_image",
"seed": 87568756,
"image_format": "webp",
"quality": 95,
"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);
}
})();Text prompt describing the desired image edit or generation
Primary input image (URL or base64)
Secondary input image (URL or base64)
Tertiary input image (URL or base64)
Pre-configured LoRA model to apply
Allowed values:
Additional LoRA model URL. Public direct url or huggingface url pointing to the lora file
Additional LoRA model URL. Public direct url or huggingface url pointing to the lora file
Output image aspect ratio
Allowed values:
Random seed for reproducibility. Use -1 for random
min : -1,
max : 2147483647
Output image format
Allowed values:
Output image quality (1-100)
min : 1,
max : 100
Return image as base64 encoded string
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.
Edited by Segmind Team on November 25, 2025.
Qwen-Image-Edit-Remover-General-LoRA is a model that accurately removes objects from images with a high level of context-awareness for precise results. It is a specialized LoRA adapter developed on the Qwen/Qwen-Image-Edit foundation, making it an advanced AI platform compared to other conventional models. It can effectively erase people from product shots, remove distractions in portraits, and even refine visuals for online stores, all while preserving the scene's natural balance. It works by rebuilding the background (powered by AI), rather than typical clone-stamping, to ensure consistent lighting, shading, and textures. Furthermore, Qwen-Image-Edit-Remover-General-LoRA is designed for seamless integration by working with the Diffusers library and snugly fits into adapted ComfyUI workflows, making it ideal for developers who need high-tech support for their image editing projects.
E-commerce and Product Photography: It can seamlessly remove mannequins, background clutter, or unwanted objects from product shots while maintaining professional lighting and shadows.
Portrait and Photo Editing: It efficiently cleans up distracting elements from portraits, event photography, or family photos without manual cloning work.
Real Estate and Architecture: It can enhance project/ property images by eliminating cars, people, or temporary objects from property photos to showcase clean, uncluttered spaces.
Content Creation: It is a perfect model to create images for social media, marketing materials, or graphic design projects by removing unwanted elements.
Automated Workflows: It helps in building photo editing pipelines for high-volume image processing, where manual editing isn't scalable and is time-consuming.
Effective Prompting for Object Removal:
Parameter Optimization:
Best Practices:
Is Qwen-Image-Edit-Remover-General-LoRA open-source?
Yes, Qwen-Image-Edit-Remover-General-LoRA is based on Qwen's open-source Image-Edit foundation with the LoRA adapter available for integration.
How is it different from Photoshop's content-aware fill?
This model uses AI diffusion techniques to understand the scene's context to deliver a photorealistic outcome, making it superior to traditional algorithm-based tools, especially for object removal with images that have complex backgrounds.
What parameters should I tweak for the best results?
To achieve perfect results, start with default settings, then adjust the seed for variation control and quality settings (90+) for production use. Furthermore, for specific aspect ratios, override "match_input_image" as needed.
Can I use custom LoRA models with this?
Yes, through the advanced lora_2_url and lora_3_url parameters, you can load additional LoRA adapters for extended capabilities or style control.
Does it work with transparent backgrounds?
The model is primarily designed to handle opaque images. But you can also use the PNG format to preserve existing transparency layers in your workflow.
How do I ensure reproducible edits across batches?
To achieve reproducible edits across batches, set a fixed seed value (any positive integer) instead of the default random seed (-1). This ensures identical outputs for the same input image and prompt combination.