TencentARC / PhotoMaker

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

demo notebooks don't work at all. #37

Open jarredou opened 10 months ago

jarredou commented 10 months ago

demo notebooks don't work at all, when will they be fixed ?!

Paper99 commented 10 months ago

Please give us more details. Thank you.

VieVie31 commented 10 months ago

Hello ! I just tried the notebook, I think I see what @jarredou is referring to: the loading of the pipeline and downloading of the weights.

For my part, I solved it by:

Commenting:

#photomaker_path = 'release_model/photomaker-v1.bin'

Then changing:

from huggingface_hub import hf_hub_download

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

pipe = PhotoMakerStableDiffusionXLPipeline.from_pretrained(
    base_model_path, 
    torch_dtype=torch.bfloat16, 
    use_safetensors=True, 
    variant="fp16",
).to(device)

pipe.load_photomaker_adapter(
    os.path.dirname(photomaker_ckpt),
    subfolder="",
    weight_name=os.path.basename(photomaker_ckpt),
    trigger_word="img"
)     
pipe.id_encoder.to(device)

After what, I encountered later the following issue when running on Colab with a V100:

RuntimeError: cutlassF: no kernel found to launch!

This has been "solved" by switching to an A100 GPU (BTW, the GPU RAM consumption is high: 25.9 / 40.0 GB, maybe too high for a Colab V100)

VieVie31 commented 10 months ago

@Paper99 I just proposed the fix in the pull request #39 😃

Paper99 commented 10 months ago

Thank you. I have merged it.

Vargol commented 10 months ago
RuntimeError: cutlassF: no kernel found to launch!

This has been "solved" by switching to an A100 GPU (BTW, the GPU RAM consumption is high: 25.9 / 40.0 GB, maybe too high for a Colab V100)

On a T4 the "no kernel" error is fixed by switching to float16 instead of bfloat16. Yes with a batch size of 1 (sometimes 2) you can get this working on the free tier.

Tinaa23 commented 9 months ago
RuntimeError: cutlassF: no kernel found to launch!

This has been "solved" by switching to an A100 GPU (BTW, the GPU RAM consumption is high: 25.9 / 40.0 GB, maybe too high for a Colab V100)

On a T4 the "no kernel" error is fixed by switching to float16 instead of bfloat16. Yes with a batch size of 1 (sometimes 2) you can get this working on the free tier.

Hi. I am receiving this error on google colab. Can you please help, how can I fix it? How do we change from bfloat16 to float16.

Vargol commented 9 months ago

@Tinaa23

pipe = PhotoMakerStableDiffusionXLPipeline.from_pretrained(
    base_model_path,
    torch_dtype=torch.float16,   <------  change torch.bfloat16 to torch.float16
    use_safetensors=True,
    variant="fp16",
).to(device)