PhotoMaker icon indicating copy to clipboard operation
PhotoMaker copied to clipboard

demo notebooks don't work at all.

Open jarredou opened this issue 2 years ago • 7 comments

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

jarredou avatar Jan 17 '24 10:01 jarredou

Please give us more details. Thank you.

Paper99 avatar Jan 17 '24 10:01 Paper99

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 avatar Jan 17 '24 11:01 VieVie31

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

VieVie31 avatar Jan 17 '24 11:01 VieVie31

Thank you. I have merged it.

Paper99 avatar Jan 18 '24 09:01 Paper99

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.

Vargol avatar Jan 20 '24 14:01 Vargol

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.

Tinaa23 avatar Feb 19 '24 19:02 Tinaa23

@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)

Vargol avatar Feb 19 '24 21:02 Vargol