Fooocus
Fooocus copied to clipboard
Can I release the GPU manually?
Can you provide an interface or button to release all the memory cached on the GPU? I want to use another AI software at the same time, but I don’t want to restart Fooocus.
Also needed this, surprised there's no way to do it... Here's what I did, all in webui.py:
line 397, add the unload_model button:
with gr.Row():
refresh_files = gr.Button(label='Refresh', value='\U0001f504 Refresh All Files', variant='secondary', elem_classes='refresh_button')
unload_model = gr.Button(label='Unload', value='Unload model', variant='secondary')
line 586, add the handler for it:
def unload_model_clicked():
import ldm_patched.modules.model_management as model_management
model_management.unload_all_models()
unload_model.click(unload_model_clicked)
Now under the advanced->model tab, you can unload models :)