Skip to content

Commit cae8733

Browse files
committed
Add an endpoint to manually clear the usage of video memory
1 parent a444bf3 commit cae8733

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

fooocusapi/routes/query.py

+12
Original file line numberDiff line numberDiff line change
@@ -165,3 +165,15 @@ def all_styles():
165165
"""Return all available styles"""
166166
from modules.sdxl_styles import legal_style_names
167167
return legal_style_names
168+
169+
170+
@secure_router.get(
171+
path="/v1/engines/clean_vram",
172+
description="Clean all vram",
173+
tags=['Query'])
174+
def all_engines():
175+
"""unload all models and clean vram"""
176+
from ldm_patched.modules.model_management import cleanup_models, unload_all_models
177+
cleanup_models()
178+
unload_all_models()
179+
return {"message": "ok"}

0 commit comments

Comments
 (0)