TencentARC / PhotoMaker

PhotoMaker [CVPR 2024]
https://photo-maker.github.io/
Other
9.59k stars 769 forks source link

Installation instructions / Repository not found in HuggingFace #8

Open amelio-vazquez-reina opened 10 months ago

amelio-vazquez-reina commented 10 months ago

Hi folks! The example notebooks [require]:(https://github.com/TencentARC/PhotoMaker/blob/main/photomaker_demo.ipynb)

from photomaker.pipeline import PhotoMakerStableDiffusionXLPipeline

Installing from the repository doesn't work:

!pip install git+https://github.com/TencentARC/PhotoMaker.git

ERROR: git+https://github.com/TencentARC/PhotoMaker.git does not appear to be a Python project: neither 'setup.py' nor 'pyproject.toml' found.

I guess the solution is to just download the repo and use PYTHONPATH?

But if so, what about the bin files? E.g. I run this from HuggingFace:

from huggingface_hub import hf_hub_download
photomaker_ckpt = hf_hub_download(repo_id="TencentARC/PhotoMaker", filename="photomaker-v1.bin", repo_type="model")

but I get this error:

401 Client Error: Unauthorized for url:
https://huggingface.co/release_model/resolve/main/photomaker-v1.bin
ilisparrow commented 10 months ago

I have the same problem : My guess is that didn't yet get merged into the transformers pipeline, it's a huge repo that takes time.

amelio-vazquez-reina commented 10 months ago

Got it @ilisparrow . Are you getting this error? Or something else?

image
ilisparrow commented 10 months ago

Hello, I didn't use the notebook but followed the pure python instructions. It said that it was not able to find photo.maker from photomakerPipeline

steverhoades commented 10 months ago

The correct syntax is the following unless you download the model directly from the hugging face repo here: https://huggingface.co/TencentARC/PhotoMaker/tree/main, in which case the notebook suggests placing the .bin file in the model_release local directory.

# Load PhotoMaker checkpoint
pipe.load_photomaker_adapter(
    "TencentARC/PhotoMaker",
    weight_name="photomaker-v1.bin",
    trigger_word="img"
)  
Paper99 commented 10 months ago

Hello, I didn't use the notebook but followed the pure python instructions. It said that it was not able to find photo.maker from photomakerPipeline

Hello @ilisparrow, first of all, thank you for your discussion, which helped us fix many known issues in environment construction (in the latest version).

Now, you could update the environment building through:

conda create --name photomaker python=3.10
pip install -U pip

# Install requirements
pip install -r requirements.txt

# Install photomaker
pip install git+https://github.com/TencentARC/PhotoMaker.git

Then you can run the following command to use our PhotoMaker:

from photomaker import PhotoMakerStableDiffusionXLPipeline

The previous line can also be used outside the repo.

Paper99 commented 10 months ago

The correct syntax is the following unless you download the model directly from the hugging face repo here: https://huggingface.co/TencentARC/PhotoMaker/tree/main, in which case the notebook suggests placing the .bin file in the model_release local directory.

# Load PhotoMaker checkpoint
pipe.load_photomaker_adapter(
    "TencentARC/PhotoMaker",
    weight_name="photomaker-v1.bin",
    trigger_word="img"
)  

Hi, @steverhoades, does this problem still exist?