Instructions to use prithivMLmods/Qwen-Image-2.1-Object-Remover-Bbox-Preview with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use prithivMLmods/Qwen-Image-2.1-Object-Remover-Bbox-Preview with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("Qwen/Qwen-Image-2.1", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("prithivMLmods/Qwen-Image-2.1-Object-Remover-Bbox-Preview") prompt = "Turn this cat into a dog" input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png") image = pipe(image=input_image, prompt=prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
Qwen-Image-2.1-Object-Remover-Bbox-Preview
Qwen-Image-2.1-Object-Remover-Bbox-Preview is a preview LoRA adapter for Qwen-Image-2.1, designed for object removal using bounding box guidance. The adapter removes unwanted objects from selected regions while attempting to preserve surrounding textures, lighting, shadows, perspective, and overall image consistency.
This is an experimental preview model. Results may vary depending on the image, object, bounding box, and surrounding context.
Model Details
- Base Model: Qwen/Qwen-Image-2.1
- Adapter:
Qwen-Image-2.1-Object-Remover-Bbox-Preview - Model Type: LoRA / Adapter
- Model Status: Preview / Experimental
- Created by: prithivMLmods
Training Specifications
| Parameter | Configuration |
|---|---|
| Dataset | 50 pairs of high-quality images with bounding box annotations and manually manipulated resultant images |
| Save Precision | BF16 |
| Learning Rate | 1e-4 |
| Optimizer | AdamW |
| Network Dimension (Rank) | 16 |
| Total Steps | 5000 |
| Trigger Prompt | Remove the red highlighted object from the scene |
Download
Download the model files from the Files & versions tab:
Download Qwen-Image-2.1-Object-Remover-Bbox-Preview
Usage
Load the LoRA adapter with Qwen-Image-2.1 and provide an image with the target object indicated by a bounding box.
Use the trigger prompt:
Remove the red highlighted object from the scene
For best results, use a clear bounding box around the object to be removed.
Some Example Comparisons
| Input | - LoRA (Base Model) | + LoRA | Description & Settings |
|---|---|---|---|
|
|
|
Description: Removes unmarked objects and struggles at more than two objects (first silver and last marked black were not removed). Total Steps: 40 |
|
|
|
Description: Base Model without LoRA struggles removing all bounding boxes (one cat remains unremoved). Total Steps: 40 |
|
|
|
Description: Base Model without LoRA struggles to remove more than one object bounding box scenario. Total Steps: 40 |
|
|
|
Description: Sometimes Base Model without LoRA struggles in retaining shadows after removal (look at the player's head shadow in the no-LoRA edition). Total Steps: 40 |
Limitations
This is an early preview release and may produce artifacts or inconsistencies in challenging cases, including:
- Complex backgrounds
- Large or overlapping objects
- Fine structures and textures
- Reflections and transparent objects
- Difficult lighting and perspective conditions
Results can vary depending on the input image and bounding box placement.
License
Please refer to the license terms of the base model, Qwen-Image-2.1, and ensure compliance with its terms when using or redistributing this adapter.
Acknowledgements
This adapter was created by prithivMLmods and is built for use with Qwen-Image-2.1.
- Downloads last month
- 454
Model tree for prithivMLmods/Qwen-Image-2.1-Object-Remover-Bbox-Preview
Base model
Qwen/Qwen-Image-2.1
