omerbt / TokenFlow

Official Pytorch Implementation for "TokenFlow: Consistent Diffusion Features for Consistent Video Editing" presenting "TokenFlow" (ICLR 2024)
https://diffusion-tokenflow.github.io
MIT License
1.52k stars 134 forks source link

what is the correct way to run demo? #27

Open realcarlos opened 10 months ago

realcarlos commented 10 months ago

python preprocess.py --data_path data/woman-running.mp4 --inversion_prompt "a marble sculpture of a woman running, Venus de Milossets"

the "latents" folder is created , but the video file "inverted.mp4" is not changed .

then I run "python run_tokenflow_pnp.py"

Traceback (most recent call last): File "/home/xxx/TokenFlow/run_tokenflow_pnp.py", line 300, in run(config) File "/home/xxx/TokenFlow/run_tokenflow_pnp.py", line 280, in run editor.edit_video() File "/home/xxx/TokenFlow/run_tokenflow_pnp.py", line 258, in edit_video edited_frames = self.sample_loop(noisy_latents, torch.arange(self.config["n_frames"])) File "/home/xxx/TokenFlow/run_tokenflow_pnp.py", line 267, in sample_loop x = self.batched_denoise_step(x, t, indices) File "/home/xxx/anaconda3/envs/tokenflow/lib/python3.9/site-packages/torch/amp/autocast_mode.py", line 14, in decorate_autocast return func(*args, kwargs) File "/home/xxx/TokenFlow/run_tokenflow_pnp.py", line 227, in batched_denoise_step self.denoise_step(x[pivotal_idx], t, indices[pivotal_idx]) File "/home/xxx/anaconda3/envs/tokenflow/lib/python3.9/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context return func(*args, *kwargs) File "/home/xxx/TokenFlow/run_tokenflow_pnp.py", line 210, in denoise_step noise_pred = self.unet(latent_model_input, t, encoder_hidden_states=text_embed_input)['sample'] File "/home/xxx/anaconda3/envs/tokenflow/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(args, kwargs) File "/home/xxx/anaconda3/envs/tokenflow/lib/python3.9/site-packages/diffusers/models/unet_2d_condition.py", line 1018, in forward sample = upsample_block( File "/home/xxx/anaconda3/envs/tokenflow/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(*args, *kwargs) File "/home/xxx/anaconda3/envs/tokenflow/lib/python3.9/site-packages/diffusers/models/unet_2d_blocks.py", line 2227, in forward hidden_states = resnet(hidden_states, temb, scale=lora_scale) File "/home/xxx/anaconda3/envs/tokenflow/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(args, **kwargs) TypeError: forward() got an unexpected keyword argument 'scale'

could you help?

littlewhitesea commented 10 months ago

I also met with a similar problem. I solved it through installing an assigned version of diffusers as follows:

pip install diffusers==0.20.0
nathanshipley commented 10 months ago

Had the same problem: this fixed it! Thank you!