TencentARC / PhotoMaker

PhotoMaker
https://photo-maker.github.io/
Other
8.63k stars 675 forks source link

TypeError: PhotoMakerStableDiffusionXLPipeline.__call__() got an unexpected keyword argument 'callback_on_step_end' #118

Closed machineminded closed 4 months ago

machineminded commented 5 months ago

I am trying to utilize the callback_on_step_end in diffusers:

https://huggingface.co/docs/diffusers/main/en/using-diffusers/callback#interrupt-the-diffusion-process

However, I get this error.

Traceback (most recent call last):
  File "E:\github\Fooocus-inswapper\modules\async_worker.py", line 865, in worker
    handler(task)
  File "E:\github\Fooocus-inswapper\venv\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "E:\github\Fooocus-inswapper\venv\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "E:\github\Fooocus-inswapper\modules\async_worker.py", line 790, in handler
    imgs = generate_photomaker(photomaker_prompt, photomaker_source_images, photomaker_negative_prompt, steps, task['task_seed'], width, height, guidance_scale, loras, sampler_name, scheduler_name, async_task)      
  File "E:\github\Fooocus-inswapper\modules\pm.py", line 119, in generate_photomaker
    images = pipe(
  File "E:\github\Fooocus-inswapper\venv\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
TypeError: PhotoMakerStableDiffusionXLPipeline.__call__() got an unexpected keyword argument 'callback_on_step_end'

Results of pip show diffusers:

(venv) PS E:\github\Fooocus-inswapper> pip show diffusers
Name: diffusers
Version: 0.26.1
Summary: State-of-the-art diffusion in PyTorch and JAX.
Home-page: https://github.com/huggingface/diffusers
Author: The Hugging Face team (past and future) with the help of all our contributors (https://github.com/huggingface/diffusers/graphs/contributors)
Author-email: patrick@huggingface.co
License: Apache 2.0 License
Location: e:\github\fooocus-inswapper\venv\lib\site-packages
Requires: filelock, huggingface-hub, importlib-metadata, numpy, Pillow, regex, requests, safetensors
Required-by:

Is this an issue with my environment?

Paper99 commented 5 months ago

Hi, You could add args and edit some codes in our pipeline function following official implementation.

machineminded commented 5 months ago

I will get this updated. I am not great with Python and thought maybe the props were inherited from the base SDXL pipeline. Thank you! 🚀

machineminded commented 5 months ago

Please see https://github.com/TencentARC/PhotoMaker/pull/119

Paper99 commented 5 months ago

Thanks for your great work!

machineminded commented 4 months ago

Resolved by https://github.com/TencentARC/PhotoMaker/pull/119