FlowDIS / README.md
andraniksargsyan's picture
Upload folder using huggingface_hub
37378fe
---
license: other
license_name: picsart-inc-flowdis-model-1.0
license_link: https://huggingface.co/PAIR/FlowDIS/raw/main/LICENSE
tags:
- remove background
- background removal
- dichotomous image segmentation
- flow matching
datasets:
- DIS5K
pipeline_tag: image-segmentation
library_name: flowdis
---
# FlowDIS
<p align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://flowdis.github.io/static/videos/teaser-dark.avif">
<source media="(prefers-color-scheme: light)" srcset="https://flowdis.github.io/static/videos/teaser-light.avif">
<img src="https://flowdis.github.io/static/videos/teaser-light.avif" alt="FlowDIS teaser" width="100%">
</picture>
</p>
FlowDIS enables highly accurate foreground segmentation, optionally guided by a text prompt. When ambiguity prevents the model from producing the desired result, the user can specify which elements to retain in the foreground.
## Usage
```bash
pip install "git+ssh://git@github.com/Picsart-AI-Research/FlowDIS.git"
```
```python
from PIL import Image
from flowdis import flowdis_predict, load_models
models = load_models(device="cuda")
input_img_path = "path/to/input.jpg" # Input image path
output_mask_path = "path/to/output.png" # Path to save the output mask
image = Image.open(input_img_path).convert("RGB")
mask = flowdis_predict(
image=image,
prompt="", # Text prompt
models=models,
resolution=1024,
num_inference_steps=2,
device="cuda",
)
mask.save(output_mask_path)
```
## License
This model is licensed under the [PicsArt Inc. FlowDIS Model License](https://huggingface.co/PAIR/FlowDIS/raw/main/LICENSE).
## Acknowledgements
This project is built on top of [FLUX.1 [schnell]](https://github.com/black-forest-labs/flux) and [DIS5K](https://github.com/xuebinqin/DIS).
## BibTeX
If you use our work in your research, please cite our publication:
```
@article{sargsyan2026flowdis,
title={{FlowDIS: Language-Guided Dichotomous Image Segmentation with Flow Matching}},
author={Sargsyan, Andranik and Navasardyan, Shant},
journal={arXiv preprint arXiv:2605.05077},
year={2026},
eprint={2605.05077},
archivePrefix={arXiv},
url={https://arxiv.org/abs/2605.05077}
}
```