Skip to content

Instantly share code, notes, and snippets.

@w-e-w
w-e-w / sd_webui_add_middleware_test.py
Created December 28, 2024 05:56
This is an extension of sd-webui for testing the ability add new middleware after the server has started
"""
This is an extension of sd-webui for testing the ability add new middleware after the server has started.
New middleware can be added by clicking the button in the Setting > Middleware section,
or by get request to /add-test-middleware.
The middleware will print the request url to the console with the middleware count and datetime.
[<Number>] <datetime>: <url>
Usage: save this script to extensions/<add_middleware>/scripts/sd_webui_add_middleware_test.py then restart the webui server.