ReFocusEraser

This repository provides the pretrained weights for ReFocusEraser, including the pretrained VAE and LoRA weights.

ReFocusEraser is proposed in the paper:

"ReFocusEraser: Refocusing for Small Object Removal with Robust Context-Shadow Repair"

The model is designed for small object removal, with a particular focus on improving the repair quality of surrounding context and object shadows after removal.

Model Description

ReFocusEraser aims to remove small target objects from images while preserving the visual consistency of the surrounding background. Compared with general image inpainting settings, small object removal requires more careful reconstruction of local texture, contextual structure, and shadow regions. To address this issue, ReFocusEraser introduces a refocusing-based object removal framework for robust context-shadow repair.

This Hugging Face repository releases the pretrained weights used for inference:

  • Pretrained VAE weights
  • Pretrained LoRA weights

The released LoRA weights are intended to be used together with the base FLUX model.

Model Details

  • Model name: ReFocusEraser
  • Task: Small object removal / image inpainting
  • Base model: FLUX.1-dev
  • Released weights: VAE and LoRA
  • Input: Image and corresponding object mask
  • Output: Image with the masked object removed and the surrounding region repaired

Intended Use

This model is intended for research and academic use in image inpainting, object removal, and generative image editing.

Typical use cases include:

  • Small object removal
  • Mask-guided image inpainting
  • Context-aware background repair
  • Shadow-consistent object removal
  • Research on image editing and generative restoration

How to Use

Please first download the pretrained weights from this repository, then run the inference code from our GitHub repository.

GitHub repository:

https://github.com/ProAirVerse/ReFocusEraser

Example inference command:

python inference.py \
  --img_path /path/to/imgs \
  --mask_path /path/to/masks \
  --output_path /path/to/output \
  --flux_path /path/to/FLUX.1-dev \
  --lora_path /path/to/ReFocusEraser_LoRA

Input Format

The model requires:

  1. An input image.
  2. A binary mask indicating the object region to be removed.

The masked region should correspond to the target object. The model then generates a repaired image where the target object is removed and the surrounding context is restored.

Output

The model outputs an edited image where the target object has been removed. ReFocusEraser focuses on preserving local background consistency and repairing object-related shadow/context regions.

Limitations

Although ReFocusEraser is designed for robust small object removal, it may still have limitations in some challenging cases, such as:

  • Very large masked regions
  • Highly complex or repetitive backgrounds
  • Ambiguous object boundaries
  • Strong shadows or reflections extending far beyond the mask
  • Low-resolution or heavily degraded input images

The quality of the result may also depend on the accuracy of the input mask.

Ethical Considerations

This model is intended for legitimate research and image editing applications. Users should avoid using the model for misleading, harmful, or deceptive image manipulation. Edited images should be used responsibly, especially in contexts where image authenticity is important.

Citation

If you find this work useful, please consider citing our paper:

@inproceedings{zhengrefocuseraser,
  title={ReFocusEraser: Refocusing for Small Object Removal with Robust Context-Shadow Repair},
  author={Zheng, Qingping and Huang, Bo and Liu, Yang and Zhao, Haoyu and Zheng, Ling and Wang, Zengmao and Li, Ying and Deng, Jiankang},
  booktitle={The Fourteenth International Conference on Learning Representations}
}

Acknowledgements

This work is built upon the FLUX model family. We thank the open-source community for their valuable contributions to generative image editing and image inpainting research.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support