Back to rankings

open-mmlab/PowerPaint

Pythonpowerpaint.github.io

[ECCV 2024] PowerPaint, a versatile image inpainting model that supports text-guided object inpainting, object removal, image outpainting and shape-guided object inpainting with only a single model. 一个高质量多功能的图像修补模型,可以同时支持插入物体、移除物体、图像扩展、形状可控的物体生成,只需要一个模型

aigcgenerationimage-editingimage-inpaintingstable-diffusion
Star Growth
Stars
1.1k
Forks
84
Weekly Growth
Issues
52
5001k
Dec 2023Oct 2024Sep 2025Jul 2026
ArtifactsPyPIpip install powerpaint
README

🖌️ ECCV 2024 | PowerPaint: A Versatile Image Inpainting Model

A Task is Worth One Word: Learning with Task Prompts for High-Quality Versatile Image Inpainting

Junhao Zhuang, Yanhong Zeng, Wenran Liu, Chun Yuan†, Kai Chen†

(†corresponding author)

arXiv Project Page Open in OpenXLab HuggingFace Model

Your star means a lot for us to develop this project! :star:

PowerPaint is a high-quality versatile image inpainting model that supports text-guided object inpainting, object removal, shape-guided object insertion, and outpainting at the same time. We achieve this by learning with tailored task prompts for different inpainting tasks.

🚀 News

May 22, 2024:fire:

  • We have open-sourced the model weights for PowerPaint v2-1, rectifying some existing issues that were present during the training process of version 2. HuggingFace Model

April 7, 2024:fire:

  • We open source the model weights and code for PowerPaint v2. Open in OpenXLab HuggingFace Model

April 6, 2024:

  • We have retrained a new PowerPaint, taking inspiration from Brushnet. The Online Demo has been updated accordingly. We plan to release the model weights and code as open source in the next few days.
  • Tips: We preserve the cross-attention layer that was deleted by BrushNet for the task prompts input.
Object insertion Object Removal Shape-guided Object Insertion Outpainting
Original Image cropinput cropinput image cropinput
Output image image image image

December 22, 2023:wrench:

  • The logical error in loading ControlNet has been rectified. The gradio_PowerPaint.py file and Online Demo have also been updated.

December 18, 2023

Enhanced PowerPaint Model

  • We are delighted to announce the release of more stable model weights. These refined weights can now be accessed on Hugging Face. The gradio_PowerPaint.py file and Online Demo have also been updated as part of this release.

Get Started

# Clone the Repository
git clone git@github.com:open-mmlab/PowerPaint.git

# Create Virtual Environment with Conda
conda create --name ppt python=3.9
conda activate ppt

# Install Dependencies
pip install -r requirements/requirements.txt

Or you can construct a conda environment from scratch by running the following command:

conda env create -f requirements/ppt.yaml
conda activate ppt

Inference

You can launch the Gradio interface for PowerPaint by running the following command:

# Set up Git LFS
conda install git-lfs
git lfs install

# Clone PowerPaint Model
git lfs clone https://huggingface.co/JunhaoZhuang/PowerPaint-v1/ ./checkpoints/ppt-v1

python app.py --share

For the BrushNet-based PowerPaint, you can run the following command:

# Clone PowerPaint Model
git lfs clone https://huggingface.co/JunhaoZhuang/PowerPaint_v2/ ./checkpoints/ppt-v2

python app.py --share --version ppt-v2 --checkpoint_dir checkpoints/ppt-v2

Text-Guided Object Inpainting

After launching the Gradio interface, you can insert objects into images by uploading your image, drawing the mask, selecting the tab of Text-guided object inpainting and inputting the text prompt. The model will then generate the output image.

Input Output

Text-Guided Object Inpainting with ControlNet

Fortunately, PowerPaint is compatible with ControlNet. Therefore, users can generate object with a control image.

Input Condition Control Image Output
Canny
Depth
HED
Pose

Object Removal

For object removal, you need to select the tab of Object removal inpainting and you don't need to input any prompts. PowerPaint is able to fill in the masked region according to context background.

We remain the text box for inputing prompt, allowing users to further suppress object generation by using negative prompts. Specifically, we recommend to use 10 or higher value for Guidance Scale. If undesired objects appear in the masked area, you can address this by specifically increasing the Guidance Scale.

Input Output

Image Outpainting

For image outpainting, you don't need to input any text prompt. You can simply select the tab of Image outpainting and adjust the slider for horizontal expansion ratio and vertical expansion ratio, then PowerPaint will extend the image for you.

Input Output

Shape-Guided Object Inpainting

PowerPaint also supports shape-guided object inpainting, which allows users to control the fitting degree of the generated objects to the shape of masks. You can select the tab of Shape-guided object inpainting and input the text prompt. Then, you can adjust the slider of fitting degree to control the shape of generated object.

Taking the following cases as example, you can draw a square mask and use a high fitting degree, e.g., 0.95, to generate a bread to fit in the mask shape. For the same mask, you can also use a low fitting degree, e.g., 0.55, to generate a reasonable result for rabbit. However, if you use a high fitting degree for the 'square rabit', the result may look funny.

Basically, we recommend to use 0.5-0.6 for fitting degree when you want to generate objects that are not constrained by the mask shape. If you want to generate objects that fit the mask shape, you can use 0.8-0.95 for fitting degree.

Prompt Fitting Degree Input Output
a bread 0.95
a rabbit 0.55
a rabbit 0.95
a rabbit 0.95

Training

Since we refactored the code for better support of both the U-Net-based and Brush-Net network architectures, please refer to our dev branch for more details on training.

If you have any issues, please feel free to open issues. Any pull request are welcome and we will review them asap.

Contact Us

Junhao Zhuang: zhuangjh23@mails.tsinghua.edu.cn

Yanhong Zeng: zengyh1900@gmail.com

BibTeX

@misc{zhuang2023task,
      title={A Task is Worth One Word: Learning with Task Prompts for High-Quality Versatile Image Inpainting},
      author={Junhao Zhuang and Yanhong Zeng and Wenran Liu and Chun Yuan and Kai Chen},
      year={2023},
      eprint={2312.03594},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}
Related repositories
ZhuLinsen/daily_stock_analysis

LLM 驱动的多市场股票智能分析系统:多源行情、实时新闻、决策看板与自动推送,支持零成本定时运行。 LLM-powered multi-market stock analysis system with multi-source market data, real-time news, decision dashboard, automated notifications, and cost-free scheduled runs.

PythonPyPIMIT Licenseaigcllm
dsa.zhulinsen.tech
58.2k50k
ATH-MaaS/Pixelle-Video

🚀 AI 全自动短视频引擎 | AI Fully Automated Short Video Engine

PythonPyPIApache License 2.0aigccomfyui
aidc-ai.github.io/Pixelle-Video/zh
25.8k3.7k
Wan-Video/Wan2.2

Wan: Open and Advanced Large-Scale Video Generative Models

PythonPyPIApache License 2.0aigcvideo-generation
wan.video
16.8k2.1k
Wan-Video/Wan2.1

Wan: Open and Advanced Large-Scale Video Generative Models

PythonPyPIApache License 2.0aigcvideogeneration
wan.video
16.6k3k
liaokongVFX/LangChain-Chinese-Getting-Started-Guide

LangChain 的中文入门教程

chatgptlangchain
9.1k710
rockbenben/ChatGPT-Shortcut

🚀💪Maximize your efficiency and productivity. The ultimate hub to manage, customize, and share prompts. (English/中文/Español/العربية). 让生产力加倍的 AI 快捷指令。更高效地管理提示词,在分享社区中发现适用于不同场景的灵感。

TypeScriptnpmMIT Licensechatgptprompts
aishort.top/en
8.6k947
lipku/LiveTalking

Real time interactive streaming digital human

PythonPyPIApache License 2.0digital-humannerf
livetalking.ai
8.5k1.4k
zilliztech/GPTCache

Semantic cache for LLMs. Fully integrated with LangChain and llama_index.

PythonPyPIMIT Licensechatbotchatgpt
gptcache.readthedocs.io
8.1k587
YaoApp/yao

✨ Build AI agents and web apps — with a single binary.

GoGo ModulesOthergolangapi
yaoagents.com
7.5k686
open-mmlab/mmagic

OpenMMLab Multimodal Advanced, Generative, and Intelligent Creation Toolbox. Unlock the magic 🪄: Generative-AI (AIGC), easy-to-use APIs, awsome model zoo, diffusion models, for text-to-image generation, image/video restoration/enhancement, etc.

Jupyter NotebookApache License 2.0super-resolutioninpainting
mmagic.readthedocs.io/en/latest/
7.4k1.1k
Moonvy/OpenPromptStudio

🥣 AIGC 提示词可视化编辑器 | OPS | Open Prompt Studio

Vueaiaigc
moonvy.com/apps/ops/
6.6k741
EwingYangs/awesome-open-gpt

Collection of Open Source Projects Related to GPT,GPT相关开源项目合集🚀、精选🔥🔥

PythonPyPIaigcchatgpt
6k543