Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
[ICLR 2025] HD-Painter: High-Resolution and Prompt-Faithful Text-Guided Image Inpainting with Diffusion Models
| Date | Stars |
|---|---|
| 2026-07-31 | 368 |
| 2026-08-06 | 368 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# HD-Painter This repository is the official implementation of [HD-Painter](https://arxiv.org/abs/2312.14091). **[HD-Painter: High-Resolution and Prompt-Faithful Text-Guided Image Inpainting with Diffusion Models](https://arxiv.org/abs/2312.14091)** </br> Hayk Manukyan*, Andranik Sargsyan*, Barsegh Atanyan, [Zhangyang Wang](https://www.ece.utexas.edu/people/faculty/atlas-wang), Shant Navasardyan, [Humphrey Shi](https://www.humphreyshi.com) </br> [Paper](https://arxiv.org/abs/2312.14091) | [Video](https://www.dropbox.com/scl/fi/t4lnssa9wbkd3bqo9kzgs/HDPainterTeaserVideoV4.mov?rlkey=vuk2zwm4z4pngt73cdmpmumpv&dl=0) | [](https://huggingface.co/spaces/PAIR/HD-Painter) <p align="center"> <img src="__assets__/github/teaser.jpg" width="800px"/> <br> <em> We propose the <strong>Prompt-Aware Introverted Attention (PAIntA)</strong> layer enhancing self-attention scores by prompt information and resulting in better text alignment generations. To further improve the prompt coherence we introduce the <strong>Reweighting Attention Score Guidance (RASG)</strong> mechanism seamlessly integrating a post-hoc sampling strategy into general form of DDIM to prevent out-of-distribution latent shifts. Moreover, our approach allows extension to larger scales by introducing a specialized super-resolution technique customized for inpainting, enabling the completion of missing regions in images of up to 2K resolution. </em> </p> ## Setup To set up the environment, install requirements using Python 3.9 ``` python3 -m venv venv source ./venv/bin/activate pip install pip --upgrade pip install -r requirements.txt ``` If you would like to also perform metric evaluation, additionally install `mmcv` by running: ``` pip install mmcv==2.1.0 -f https://download.openmmlab.com/mmcv/dist/cu118/torch2.1/index.html ``` ## Usage You can use the following script to perform inference on the given image+mask pair and prompt: ``` python hd_inpaint.py \ --model-id ONE_OF[ds8_inp, sd2_inp, sd15_inp] \ --method ONE_OF[baseline, painta, rasg, painta+rasg] \ --image-path HR_IMAGE_PATH \ --mask-path HR_IMAGE_MASK \ --prompt PROMPT_TXT \ --output-dir OUTPUT_DIRECTORY ``` `--model-id` specifies the baseline model for text-guided image inpainting. The following baseline models are supported by the script: - `ds8_inp` - DreamShaper 8 Inpainting - `sd2_inp` - Stable Diffusion 2.0 Inpainting - `sd15_inp` - Stable Diffusion 1.5 Inpainting If not specified `--model-id` defaults to `ds8_inp`. ` --method` specifies the inpainting method. The available options are as such: - `baseline` - Run the underlying baseline model. - `painta` - Use PAIntA block as introduced in the paper. - `rasg` - Use RASG guidance mechanism as introduced in the paper. - `painta+rasg` - Use both PAIntA and RASG mechanisms. If not specified `--method` defaults to `painta+rasg`. The script uses combination of positive and negative text prompts by default for visually more pleasing results. The script will automatically download the necessary models during first run, please be patient. Output will be saved in the `--output-dir` directory. Please note that the provided script outputs an image which longer side is equal to 2048px while the aspect ratio is preserved. You can see more options and details in `hd_inpaint.py` script. ## Gradio Demo From the project root folder, run this shell command: ``` python demo/app.py ``` Then access the app [locally](http://127.0.0.1:7860) with a browser. Please be patient: during first run models will be being automatically downloaded, which can take several minutes. ## Evaluation From the root repository directory run the following commands to download and unzip MSCOCO validation images and annotations: ``` mkdir mscoco_data cd mscoco_data wget http://images.cocodataset.org/zips/val2017.zip unzip val2017.zip wget http://images.cocodataset.org/annotatio
Excerpt of 6,659 characters
Read on GitHubWould you bet a product on this? Bounded 0–100 and slow moving.
matched fp:e123f0b0acccaae4, desc:inpainting