TencentARC / PhotoMaker

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

cannot import name 'LocalContext' from 'gradio.context' #89

Open rizkidewanto opened 9 months ago

rizkidewanto commented 9 months ago

Hello. First of all, I want to say congrats to the dev. What an AI. I try the demo on HF, it's 🤯 I want to try running this locally, but encounter this error :

Traceback (most recent call last):
  File "D:\WPy64-31090\notebooks\pm\app.py", line 10, in <module>
    import spaces
  File "D:\WPy64-31090\python-3.10.9.amd64\lib\site-packages\spaces\__init__.py", line 10, in <module>
    from .zero.decorator import GPU
  File "D:\WPy64-31090\python-3.10.9.amd64\lib\site-packages\spaces\zero\decorator.py", line 17, in <module>
    from . import client
  File "D:\WPy64-31090\python-3.10.9.amd64\lib\site-packages\spaces\zero\client.py", line 17, in <module>
    from .gradio import get_event
  File "D:\WPy64-31090\python-3.10.9.amd64\lib\site-packages\spaces\zero\gradio.py", line 8, in <module>
    from gradio.context import LocalContext
ImportError: cannot import name 'LocalContext' from 'gradio.context'

Help is appreciated, thanks.

Paper99 commented 9 months ago

Using this project to run it on Windows: https://github.com/bmaltais/PhotoMaker/tree/v1.0.1

rizkidewanto commented 9 months ago

Ok, will notify if anything goes wrong again. Thanks.

rizkidewanto commented 9 months ago

Ok, I got it running on Colab (sad PC can't run it). However, I got message torch.cuda.OutOfMemoryError: CUDA out of memory. How to fix it?

Paper99 commented 9 months ago

The minimum GPU memory required by our PhotoMaker is 15G. You could apply other GPU

Paper99 commented 9 months ago

An important note: For those GPUs that do not support bfloat16, please change this line to torch_dtype = torch.float16, the speed will be greatly improved (1min/img (before) vs. 14s/img (after) on V100). The minimum GPU memory requirement for PhotoMaker is 15G.

rizkidewanto commented 9 months ago

Um, can I run it if I have this spec? image