kabachuha / sd-webui-text2video

Auto1111 extension implementing text2video diffusion models (like ModelScope or VideoCrafter) using only Auto1111 webui dependencies
Other
1.28k stars 106 forks source link

[Bug]: Not working at all on Apple silicon #159

Closed elchupacabrinski closed 1 year ago

elchupacabrinski commented 1 year ago

Is there an existing issue for this?

Are you using the latest version of the extension?

What happened?

When trying to render anything with the ModelScope Model I get this error:

Traceback (most recent call last): File "/Users/konsti/stable-diffusion-webui/extensions/sd-webui-text2video/scripts/t2v_helpers/render.py", line 24, in run vids_pack = process_modelscope(args_dict) File "/Users/konsti/stable-diffusion-webui/extensions/sd-webui-text2video/scripts/modelscope/process_modelscope.py", line 45, in process_modelscope del shared.sd_model AttributeError: can't delete attribute 'sd_model' Exception occurred: can't delete attribute 'sd_model'

And with the VideoCrafter one I get this: AssertionError: Torch not compiled with CUDA enabled Exception occurred: Torch not compiled with CUDA enabled

Steps to reproduce the problem

  1. Go to ....
  2. Press ....
  3. ...

What should have happened?

No response

WebUI and Deforum extension Commit IDs

webui commit id - Newest of Vlad and Auto1111 txt2vid commit id - 2a7b60d6

Torch version

2.0.0

What GPU were you using for launching?

None

On which platform are you launching the webui backend with the extension?

Local PC setup (Mac)

Settings

Default

Console logs


(base) XXXX@XXXXs-MBP automatic % ./webui.sh --reinstall
Create and activate python venv
Launching launch.py...
12:53:04-449220 INFO     Starting SD.Next                                                                               
12:53:04-451156 INFO     Python 3.10.9 on Darwin                                                                        
12:53:04-468476 INFO     Version: f6f1a73b Wed May 17 06:15:18 2023 -0400                                               
12:53:04-749875 INFO     Setting environment tuning                                                                     
12:53:04-752418 INFO     Forcing reinstall of all packages                                                              
12:53:04-754338 INFO     Installing package: torch==2.0.0 torchvision==0.15.1                                           
12:53:06-191356 INFO     Torch 2.0.0                                                                                    
12:53:06-191949 INFO     Installing package: tensorflow==2.12.0                                                         
12:53:06-507584 INFO     Verifying requirements                                                                         
12:53:06-508616 INFO     Installing package: addict                                                                     
12:53:07-377685 INFO     Installing package: aenum                                                                      
12:53:08-246553 INFO     Installing package: aiohttp                                                                    
12:53:09-248412 INFO     Installing package: anyio                                                                      
12:53:10-141952 INFO     Installing package: appdirs                                                                    
12:53:11-008352 INFO     Installing package: astunparse                                                                 
12:53:11-919323 INFO     Installing package: bitsandbytes                                                               
12:53:12-786659 INFO     Installing package: blendmodes                                                                 
12:53:13-686273 INFO     Installing package: clean-fid                                                                  
12:53:14-638800 INFO     Installing package: easydev                                                                    
12:53:15-502344 INFO     Installing package: extcolors                                                                  
12:53:16-513044 INFO     Installing package: facexlib                                                                   
12:53:17-437827 INFO     Installing package: filetype                                                                   
12:53:18-359715 INFO     Installing package: font-roboto                                                                
12:53:19-317207 INFO     Installing package: fonts                                                                      
12:53:20-305564 INFO     Installing package: future                                                                     
12:53:21-256779 INFO     Installing package: gdown                                                                      
12:53:22-212188 INFO     Installing package: gfpgan                                                                     
12:53:23-530162 INFO     Installing package: GitPython                                                                  
12:53:24-456717 INFO     Installing package: httpcore                                                                   
12:53:25-403444 INFO     Installing package: inflection                                                                 
12:53:26-316645 INFO     Installing package: jsonmerge                                                                  
12:53:27-240454 INFO     Installing package: kornia                                                                     
12:53:28-144962 INFO     Installing package: lark                                                                       
12:53:29-042952 INFO     Installing package: lmdb                                                                       
12:53:30-047543 INFO     Installing package: lpips                                                                      
12:53:31-019472 INFO     Installing package: numpy                                                                      
12:53:32-095276 INFO     Installing package: omegaconf                                                                  
12:53:33-054192 INFO     Installing package: open-clip-torch                                                            
12:53:34-112277 INFO     Installing package: opencv-contrib-python                                                      
12:53:35-103674 INFO     Installing package: piexif                                                                     
12:53:36-024377 INFO     Installing package: Pillow                                                                     
12:53:37-034706 INFO     Installing package: psutil                                                                     
12:53:37-976073 INFO     Installing package: pyyaml                                                                     
12:53:38-886677 INFO     Installing package: realesrgan                                                                 
12:53:39-883528 INFO     Installing package: resize-right                                                               
12:53:40-766812 INFO     Installing package: rich                                                                       
12:53:41-663009 INFO     Installing package: safetensors                                                                
12:53:42-553817 INFO     Installing package: scipy                                                                      
12:53:43-505396 INFO     Installing package: tb_nightly                                                                 
12:53:44-614549 INFO     Installing package: toml                                                                       
12:53:45-498309 INFO     Installing package: torchdiffeq                                                                
12:53:46-394764 INFO     Installing package: torchsde                                                                   
12:53:47-281672 INFO     Installing package: voluptuous                                                                 
12:53:48-152699 INFO     Installing package: yapf                                                                       
12:53:49-052852 INFO     Installing package: scikit-image                                                               
12:53:49-977595 INFO     Installing package: basicsr                                                                    
12:53:50-931572 INFO     Installing package: requests==2.30.0                                                           
12:53:51-858669 INFO     Installing package: tqdm==4.65.0                                                               
12:53:52-771686 INFO     Installing package: accelerate==0.18.0                                                         
12:53:53-668161 INFO     Installing package: opencv-python==4.7.0.72                                                    
12:53:54-605164 INFO     Installing package: diffusers==0.16.1                                                          
12:53:55-500291 INFO     Installing package: einops==0.4.1                                                              
12:53:56-396814 INFO     Installing package: gradio==3.29.0                                                             
12:53:57-423657 INFO     Installing package: numexpr==2.8.4                                                             
12:53:58-325016 INFO     Installing package: pandas==1.5.3                                                              
12:53:59-301579 INFO     Installing package: protobuf==3.20.3                                                           
12:54:00-312280 INFO     Installing package: pytorch_lightning==1.9.4                                                   
12:54:01-315234 INFO     Installing package: transformers==4.26.1                                                       
12:54:02-258341 INFO     Installing package: timm==0.6.13                                                               
12:54:03-163333 INFO     Installing package: tomesd==0.1.2                                                              
12:54:04-178592 INFO     Installing package: urllib3==1.26.15                                                           
12:54:05-100358 INFO     Installing package: onnxruntime==1.14.0                                                        
12:54:05-404617 ERROR    Error running pip: install --upgrade onnxruntime==1.14.0                                       
12:54:05-405805 INFO     Installing packages                                                                            
12:54:05-406173 INFO     Installing package:                                                                            
                         git+https://github.com/openai/CLIP.git@d50d76daa670286dd6cacf3bcd80b5e4823fc8e1                
12:54:08-851905 INFO     Running setup                                                                                  
12:54:08-852902 INFO     Installing repositories                                                                        
12:54:08-896559 INFO     Installing submodules                                                                          
12:54:09-282876 INFO     Updating submodules                                                                            
12:54:33-603454 INFO     Extensions enabled: ['SwinIR', 'clip-interrogator-ext', 'sd-dynamic-thresholding',             
                         'prompt-bracket-checker', 'sd-webui-controlnet', 'ScuNET', 'stable-diffusion-webui-rembg',     
                         'sd-webui-model-converter', 'Lora', 'sd-extension-system-info',                                
                         'stable-diffusion-webui-images-browser', 'LDSR', 'multidiffusion-upscaler-for-automatic1111',  
                         'a1111-sd-webui-lycoris', 'sd-webui-text2video']                                               
12:54:33-604843 INFO     Updating Wiki                                                                                  
12:54:34-081012 WARNING  Setup complete with errors: 1                                                                  
12:54:34-082477 WARNING  See log file for more details: setup.log                                                       
12:54:34-083368 INFO     Running extension preloading                                                                   
12:54:34-085714 INFO     Server arguments: ['--reinstall']                                                              
No module 'xformers'. Proceeding without it.
12:54:35-932570 INFO     Libraries loaded                                                                               
12:54:36-033919 INFO     Available models: /Users/XXXX/automatic/models/Stable-diffusion 26                           
ControlNet v1.1.173
ControlNet v1.1.173
Image Browser: ImageReward is not installed, cannot be used.
OMP: Info #276: omp_set_nested routine deprecated, please use omp_set_max_active_levels instead.
12:54:36-935629 INFO     Libraries loaded                                                                               
12:54:37-050755 INFO     Loading UI theme: black-orange                                                                 
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
12:54:37-898947 INFO     Local URL: http://127.0.0.1:7860/                                                              
12:54:37-899586 INFO     API Docs: http://127.0.0.1:7860/docs                                                           
12:54:37-899916 INFO     Initializing middleware                                                                        
12:54:38-173929 INFO     CUDA FP16 test passed but desired mode is set to FP32                                          
12:54:38-174556 INFO     Setting Torch parameters: dtype=torch.float32 vae=torch.float32 unet=torch.float32             
Loading weights: /Users/XXXX/automatic/models/Stable-diffusion/2.1-Based/Artius/artiusV21_v21.safetensors ━━━ 0.… -:-…
                                                                                                                GB      
LatentDiffusion: Running in v-prediction mode
DiffusionWrapper has 865.91 M params.
12:54:38-457877 INFO     Model created from config:                                                                     
                         /Users/XXXX/automatic/models/Stable-diffusion/2.1-Based/Artius/artiusV21_v21.yaml            
12:54:39-676854 INFO     Applying scaled dot product cross attention optimization                                       
12:54:39-692781 INFO     Embeddings loaded: 17 ['DrD_PNTE768', 'KittyPic', 'XXXX-Embedding-2000',                     
                         'XXXX-Embedding-2500', 'XXXX-Embedding-3000', 'XXXX-Embedding-3500',                     
                         'XXXX-Embedding-4000', 'XXXX-Embedding-4500', 'XXXX-Embedding-5000',                     
                         'XXXX-Embedding-5500', 'XXXX-Embedding-6000', 'XXXX-Embedding-6500',                     
                         'XXXX-Embedding-7000', 'XXXX-Embedding-7500', 'XXXX-Embedding-8000',                     
                         'XXXX-Embedding-8500', 'XXXX-Embedding-9000']                                              
12:54:39-693593 INFO     Textual inversion embeddings skipped(1): RFKTR_bontrex-150                                     
12:54:39-696862 INFO     Model loaded in 1.5s (load=0.2s create=0.1s apply=0.4s vae=0.3s move=0.5s)                     
12:54:39-813643 INFO     Model load finished: {'ram': {'used': 5.17, 'total': 64.0}}                                    
12:54:39-934451 INFO     Startup time: 5.8s (torch=0.6s gradio=0.9s libraries=0.4s models=0.1s scripts=0.9s opts        
                         onchange=0.1s ui=0.8s start=0.1s scripts app_started_callback=0.2s checkpoint=1.9s)            
12:54:39-935514 INFO     Memory used: 2.74 total: 64.0                                                                  
text2video — The model selected is:  ModelScope
 text2video extension for auto1111 webui
Git commit: <p>2a7b60d6</p><p>Sun May14 2023 18:36</p>
Starting text2video
Pipeline setup
config namespace(framework='pytorch', task='text-to-video-synthesis', model={'type': 'latent-text-to-video-synthesis', 'model_args': {'ckpt_clip': 'open_clip_pytorch_model.bin', 'ckpt_unet': 'text2video_pytorch_model.pth', 'ckpt_autoencoder': 'VQGAN_autoencoder.pth', 'max_frames': 16, 'tiny_gpu': 1}, 'model_cfg': {'unet_in_dim': 4, 'unet_dim': 320, 'unet_y_dim': 768, 'unet_context_dim': 1024, 'unet_out_dim': 4, 'unet_dim_mult': [1, 2, 4, 4], 'unet_num_heads': 8, 'unet_head_dim': 64, 'unet_res_blocks': 2, 'unet_attn_scales': [1, 0.5, 0.25], 'unet_dropout': 0.1, 'temporal_attention': 'True', 'num_timesteps': 1000, 'mean_type': 'eps', 'var_type': 'fixed_small', 'loss_type': 'mse'}}, pipeline={'type': 'latent-text-to-video-synthesis'})
device mps
Working in txt2vid mode
Traceback (most recent call last):
  File "/Users/XXXX/automatic/extensions/sd-webui-text2video/scripts/t2v_helpers/render.py", line 24, in run
    vids_pack = process_modelscope(args_dict)
  File "/Users/XXXX/automatic/extensions/sd-webui-text2video/scripts/modelscope/process_modelscope.py", line 136, in process_modelscope
    pbar = tqdm(range(args.batch_count), leave=False)
  File "/Users/XXXX/automatic/venv/lib/python3.10/site-packages/tqdm/_tqdm.py", line 383, in __new__
  File "/Users/XXXX/automatic/venv/lib/python3.10/site-packages/tqdm/_tqdm.py", line 68, in __init__
AttributeError: module 'sys' has no attribute 'setcheckinterval'
Exception occurred: module 'sys' has no attribute 'setcheckinterval'
Exception ignored in: <function tqdm.__del__ at 0x1076667a0>
Traceback (most recent call last):
  File "/Users/XXXX/automatic/venv/lib/python3.10/site-packages/tqdm/_tqdm.py", line 764, in __del__
  File "/Users/XXXX/automatic/venv/lib/python3.10/site-packages/tqdm/_tqdm.py", line 994, in close
AttributeError: 'tqdm' object has no attribute 'disable'
text2video — The model selected is:  VideoCrafter (WIP)
 text2video extension for auto1111 webui
Git commit: <p>2a7b60d6</p><p>Sun May14 2023 18:36</p>
VideoCrafter config: 
 {'model': {'target': 'lvdm.models.ddpm3d.LatentDiffusion', 'params': {'linear_start': 0.00085, 'linear_end': 0.012, 'num_timesteps_cond': 1, 'log_every_t': 200, 'timesteps': 1000, 'first_stage_key': 'video', 'cond_stage_key': 'caption', 'image_size': [32, 32], 'video_length': 16, 'channels': 4, 'cond_stage_trainable': False, 'conditioning_key': 'crossattn', 'scale_by_std': False, 'scale_factor': 0.18215, 'unet_config': {'target': 'lvdm.models.modules.openaimodel3d.UNetModel', 'params': {'image_size': 32, 'in_channels': 4, 'out_channels': 4, 'model_channels': 320, 'attention_resolutions': [4, 2, 1], 'num_res_blocks': 2, 'channel_mult': [1, 2, 4, 4], 'num_heads': 8, 'transformer_depth': 1, 'context_dim': 768, 'use_checkpoint': True, 'legacy': False, 'kernel_size_t': 1, 'padding_t': 0, 'temporal_length': 16, 'use_relative_position': True}}, 'first_stage_config': {'target': 'lvdm.models.autoencoder.AutoencoderKL', 'params': {'embed_dim': 4, 'monitor': 'val/rec_loss', 'ddconfig': {'double_z': True, 'z_channels': 4, 'resolution': 256, 'in_channels': 3, 'out_ch': 3, 'ch': 128, 'ch_mult': [1, 2, 4, 4], 'num_res_blocks': 2, 'attn_resolutions': [], 'dropout': 0.0}, 'lossconfig': {'target': 'torch.nn.Identity'}}}, 'cond_stage_config': {'target': 'lvdm.models.modules.condition_modules.FrozenCLIPEmbedder'}}}}
Loading model from /Users/XXXX/automatic/models/VideoCrafter/model.ckpt
LatentDiffusion: Running in eps-prediction mode
Successfully initialize the diffusion model !
DiffusionWrapper has 958.92 M params.
making attention of type 'vanilla' with 512 in_channels
Working with z of shape (1, 4, 32, 32) = 4096 dimensions.
making attention of type 'vanilla' with 512 in_channels
Traceback (most recent call last):
  File "/Users/XXXX/automatic/extensions/sd-webui-text2video/scripts/t2v_helpers/render.py", line 26, in run
    vids_pack = process_videocrafter(args_dict)
  File "/Users/XXXX/automatic/extensions/sd-webui-text2video/scripts/videocrafter/process_videocrafter.py", line 41, in process_videocrafter
    model, _, _ = load_model(config, ph.models_path+'/VideoCrafter/model.ckpt', #TODO: support safetensors and stuff
  File "/Users/XXXX/automatic/extensions/sd-webui-text2video/scripts/videocrafter/sample_utils.py", line 37, in load_model
    model.cuda()
  File "/Users/XXXX/automatic/venv/lib/python3.10/site-packages/lightning_fabric/utilities/device_dtype_mixin.py", line 69, in cuda
    device = torch.device("cuda", torch.cuda.current_device())
  File "/Users/XXXX/automatic/venv/lib/python3.10/site-packages/torch/cuda/__init__.py", line 674, in current_device
    _lazy_init()
  File "/Users/XXXX/automatic/venv/lib/python3.10/site-packages/torch/cuda/__init__.py", line 239, in _lazy_init
    raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled
Exception occurred: Torch not compiled with CUDA enabled

Additional information

No response

github-actions[bot] commented 1 year ago

This issue has been closed due to incorrect formatting. Please address the following mistakes and reopen the issue:

elchupacabrinski commented 1 year ago

format is not incorrect smh bot