open-mmlab / PowerPaint

[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. 一个高质量多功能的图像修补模型,可以同时支持插入物体、移除物体、图像扩展、形状可控的物体生成,只需要一个模型
https://powerpaint.github.io/
MIT License
584 stars 38 forks source link

installation working #23

Closed tranquan687 closed 1 month ago

tranquan687 commented 6 months ago

1)

# Clone the Repository
git clone https://github.com/zhuang2002/PowerPaint.git

# Navigate to the Repository
cd projects/powerpaint

# Create Virtual Environment with Conda
conda create --name PowerPaint python=3.9
conda activate PowerPaint
conda install cuda -c nvidia
python -m pip install torch==1.13.1+cu117 torchvision==0.14.1+cu117 torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cu117
python -m pip install mmcv==2.0.0 -f https://download.openmmlab.com/mmcv/dist/cu117/torch1.13/index.html
python -m pip install mmengine==0.8.5
python -m pip install mmagic==1.1.0
python -m pip install gradio==3.41.0
python -m pip uninstall transformers -y  
python -m pip install transformers==4.25.1 # or 4.27.4 ( i didn't check)

2) edit requirments.txt

diffusers==0.23.1
opencv-python
gradio==3.41.0
# torch
# torchvision
controlnet-aux==0.0.3
#transformers==4.28.0
# mmengine==0.8.5
# mmagic==1.1.0

3) edit line 38, 47 in gradio_PowerPaint.py

load_model(pipe.text_encoder, "./models/text_encoder/text_encoder.safetensors") #line 38

hed = HEDdetector.from_pretrained('lllyasviel/Annotators') # line 47

4)

pip install -r requirements.txt
danielscos commented 5 months ago

i get this error: Traceback (most recent call last): File "C:\Users\danie\PowerPaint\gradio_PowerPaint_BrushNet.py", line 13, in from pipeline.pipeline_PowerPaint_Brushnet_CA import StableDiffusionPowerPaintBrushNetPipeline File "C:\Users\danie\PowerPaint\pipeline\pipeline_PowerPaint_Brushnet_CA.py", line 15, in from diffusers.loaders import FromSingleFileMixin, IPAdapterMixin, LoraLoaderMixin, TextualInversionLoaderMixin ImportError: cannot import name 'IPAdapterMixin' from 'diffusers.loaders' (C:\Users\danie\anaconda3\envs\PowerPaint\lib\site-packages\diffusers\loaders.py)

i did all your steps, im losing my mind i have no idea what to do ive been trying to run powerpaint for like 2 weeks no matter what i do it doesnt work bro

tranquan687 commented 5 months ago

i get this error: Traceback (most recent call last): File "C:\Users\danie\PowerPaint\gradio_PowerPaint_BrushNet.py", line 13, in from pipeline.pipeline_PowerPaint_Brushnet_CA import StableDiffusionPowerPaintBrushNetPipeline File "C:\Users\danie\PowerPaint\pipeline\pipeline_PowerPaint_Brushnet_CA.py", line 15, in from diffusers.loaders import FromSingleFileMixin, IPAdapterMixin, LoraLoaderMixin, and TextualInversionLoaderMixin ImportError: cannot import name 'IPAdapterMixin' from 'diffusers.loaders' (C:\Users\danie\anaconda3\envs\PowerPaint\lib\site-packages\diffusers\loaders.py)

i did all your steps, im losing my mind i have no idea what to do ive been trying to run powerpaint for like 2 weeks no matter what i do it doesnt work bro

which Powerpaint version you installed? i just check the authors've updated version 2. Maybe my instruction isn't compatible anymore. About the error, the error says that Class 'IPAdapterMixin' isn't in loaders.py, please try to check the file detail and see what've changed.

danielscos commented 5 months ago

i get this error: Traceback (most recent call last): File "C:\Users\danie\PowerPaint\gradio_PowerPaint_BrushNet.py", line 13, in from pipeline.pipeline_PowerPaint_Brushnet_CA import StableDiffusionPowerPaintBrushNetPipeline File "C:\Users\danie\PowerPaint\pipeline\pipeline_PowerPaint_Brushnet_CA.py", line 15, in from diffusers.loaders import FromSingleFileMixin, IPAdapterMixin, LoraLoaderMixin, and TextualInversionLoaderMixin ImportError: cannot import name 'IPAdapterMixin' from 'diffusers.loaders' (C:\Users\danie\anaconda3\envs\PowerPaint\lib\site-packages\diffusers\loaders.py)

i did all your steps, im losing my mind i have no idea what to do ive been trying to run powerpaint for like 2 weeks no matter what i do it doesnt work bro

which Powerpaint version you installed? i just check the authors've updated version 2. Maybe my instruction isn't compatible anymore. About the error, the error says that Class 'IPAdapterMixin' isn't in loaders.py, please try to check the file detail and see what've changed.

Yea I guess your right, it's probably not compatible anymore. Did you try to run the V2 powerpaint? It never worked for me in the end

zengyh1900 commented 1 month ago

we have removed all the dependencies of mmcv, mmengine and mmagic. Please check our latest readme which has more detailed instructions.