modelscope / DiffSynth-Studio

Enjoy the magic of Diffusion models!
Apache License 2.0
5.52k stars 502 forks source link

OutOfMemoryError: CUDA out of memory. Tried to allocate 480.00 MiB. GPU #88

Open Hing-Hing-Zone-Zone opened 2 days ago

Hing-Hing-Zone-Zone commented 2 days ago

Hello ~ I got this error when doing Video Creator... How can I solve this out?

Loading videos ...

Loading videos ... done!

Loading models ...

Loading models ... done!

Synthesizing videos ...

OutOfMemoryError: CUDA out of memory. Tried to allocate 480.00 MiB. GPU Traceback: File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 589, in _run_script exec(code, module.dict) File "C:\AI\DiffSynth-Studio\pages\2_Video_Creator.py", line 197, in SDVideoPipelineRunner(in_streamlit=True).run(config) File "C:\AI\DiffSynth-Studio\diffsynth\pipelines\stable_diffusion_video.py", line 349, in run output_video = self.synthesize_video(model_manager, pipe, config["pipeline"]["seed"], smoother, config["pipeline"]["pipeline_inputs"]) File "C:\AI\DiffSynth-Studio\diffsynth\pipelines\stable_diffusion_video.py", line 296, in synthesize_video output_video = pipe(pipeline_inputs, smoother=smoother, progress_bar_st=progress_bar_st) File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context return func(*args, kwargs) File "C:\AI\DiffSynth-Studio\diffsynth\pipelines\stable_diffusion_video.py", line 221, in call noise_pred_posi = lets_dance_with_long_video( File "C:\AI\DiffSynth-Studio\diffsynth\pipelines\stable_diffusion_video.py", line 38, in lets_dance_with_long_video hidden_states_batch = lets_dance( File "C:\AI\DiffSynth-Studio\diffsynth\pipelines\dancer.py", line 93, in lets_dance hidden_states, time_emb, text_emb, res_stack = motion_modules.motion_modules[motion_module_id]( File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1532, in _wrapped_call_impl return self._call_impl(*args, *kwargs) File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1541, in _call_impl return forward_call(args, kwargs) File "C:\AI\DiffSynth-Studio\diffsynth\models\sd_motion.py", line 82, in forward hidden_states = block( File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1532, in _wrapped_call_impl return self._call_impl(*args, kwargs) File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1541, in _call_impl return forward_call(*args, *kwargs) File "C:\AI\DiffSynth-Studio\diffsynth\models\sd_motion.py", line 45, in forward ff_output = self.act_fn(norm_hidden_states) File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1532, in _wrapped_call_impl return self._call_impl(args, kwargs) File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1541, in _call_impl return forward_call(*args, kwargs) File "C:\AI\DiffSynth-Studio\diffsynth\models\sd_unet.py", line 27, in forward hidden_states, gate = self.proj(hidden_states).chunk(2, dim=-1) File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1532, in _wrapped_call_impl return self._call_impl(*args, *kwargs) File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1541, in _call_impl return forward_call(args, kwargs) File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\linear.py", line 116, in forward return F.linear(input, self.weight, self.bias)

Artiprocher commented 3 hours ago

You need more GPU VRAM. Or reduce the resolution.