HVision-NKU / StoryDiffusion

Accepted as [NeurIPS 2024] Spotlight Presentation Paper
Apache License 2.0
5.94k stars 597 forks source link

fails to install all necessary files #8

Open LockMan007 opened 6 months ago

LockMan007 commented 6 months ago

python3 -m venv venv call .\venv\Scripts\activate pip install -r requirements.txt python app.py python pygradio_app_sdxl_specific_id.py

conda create --name storydiffusion python=3.10 conda activate storydiffusion pip install -U pip

pip install -r requirements.txt

result:

(venv) D:\ai\Video\StoryDiffusion>python gradio_app_sdxl_specific_id.py WARNING[XFORMERS]: xFormers can't load C++/CUDA extensions. xFormers was built for: PyTorch 2.0.1+cu118 with CUDA 1108 (you have 2.0.1+cpu) Python 3.10.11 (you have 3.10.11) Please reinstall xformers (see https://github.com/facebookresearch/xformers#installing-xformers) Memory-efficient attention, SwiGLU, sparse and more won't be available. Set XFORMERS_MORE_DETAILS=1 for more details Loading pipeline components...: 0%| | 0/7 [00:00<?, ?it/s] Traceback (most recent call last): File "D:\ai\Video\StoryDiffusion\gradio_app_sdxl_specific_id.py", line 430, in pipe = StableDiffusionXLPipeline.from_pretrained(sd_model_path, torch_dtype=torch.float16, use_safetensors=True if use_va else False) File "D:\ai\Video\StoryDiffusion\venv\lib\site-packages\huggingface_hub\utils_validators.py", line 118, in _inner_fn return fn(*args, kwargs) File "D:\ai\Video\StoryDiffusion\venv\lib\site-packages\diffusers\pipelines\pipeline_utils.py", line 1271, in from_pretrained loaded_sub_model = load_sub_model( File "D:\ai\Video\StoryDiffusion\venv\lib\site-packages\diffusers\pipelines\pipeline_utils.py", line 525, in load_sub_model loaded_sub_model = load_method(os.path.join(cached_folder, name), loading_kwargs) File "D:\ai\Video\StoryDiffusion\venv\lib\site-packages\transformers\modeling_utils.py", line 3206, in from_pretrained raise EnvironmentError( OSError: Error no file named pytorch_model.bin, tf_model.h5, model.ckpt.index or flax_model.msgpack found in directory C:\Users\Windows.cache\huggingface\hub\models--SG161222--RealVisXL_V4.0\snapshots\49740684ab2d8f4f5dcf6c644df2b33388a8ba85\text_encoder.

(venv) D:\ai\Video\StoryDiffusion>python app.py Traceback (most recent call last): File "D:\ai\Video\StoryDiffusion\app.py", line 4, in import spaces File "D:\ai\Video\StoryDiffusion\venv\lib\site-packages\spaces__init__.py", line 10, in from .zero.decorator import GPU File "D:\ai\Video\StoryDiffusion\venv\lib\site-packages\spaces\zero\decorator.py", line 18, in from .wrappers import regular_function_wrapper File "D:\ai\Video\StoryDiffusion\venv\lib\site-packages\spaces\zero\wrappers.py", line 42, in Process = multiprocessing.get_context('fork').Process File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64qbz5n2kfra8p0\lib\multiprocessing\context.py", line 243, in get_context return super().get_context(method) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64qbz5n2kfra8p0\lib\multiprocessing\context.py", line 193, in get_context raise ValueError('cannot find context for %r' % method) from None ValueError: cannot find context for 'fork'

(venv) D:\ai\Video\StoryDiffusion>

Adenialzz commented 6 months ago

you can try set use_safetensors as True for the first problem. and the second problem may be caused by different operating systems.

Pauweltje commented 6 months ago

So this doesn't run on Windows 11?

Z-YuPeng commented 6 months ago

We are testing on windows urgently. Also, we very much hope that Windows users who are already running can push a version that is available in Windows.

Bigfield77 commented 6 months ago

try to run: pip install torch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2 xformers --index-url https://download.pytorch.org/whl/cu121 --upgrade

that should take care of the xformers issue at least

Bigfield77 commented 6 months ago

for the issue with C:\Users\Windows.cache\huggingface\hub\models--SG161222--RealVisXL_V4.0\snapshots\49740684ab2d8f4f5dcf6c644df2b33388a8ba85\text_encoder

Mine looks like this: image

I think I had to download it manually and overwrite it (i might have been out of disk space while it first downloaded)

YasmeenAlsaedy commented 5 months ago

Hello @Bigfield77 ! From where you download the files and how? because when ever I tried to run the code after download the files manually I am getting this error "safetensors_rust.SafetensorError: Error while deserializing header: HeaderTooLarge"

Thank you.