fix failure when --nowebui called without --api (#7055)

This commit is contained in:
Miriam 2025-06-09 19:25:39 -07:00 committed by GitHub
parent 1443612e72
commit 331d03c33f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -318,8 +318,8 @@ if __name__ == "__main__":
if shared.args.nowebui:
# Start the API in standalone mode
shared.args.extensions = [x for x in shared.args.extensions if x != 'gallery']
if shared.args.extensions is not None and len(shared.args.extensions) > 0:
shared.args.extensions = [x for x in (shared.args.extensions or []) if x != 'gallery']
if shared.args.extensions:
extensions_module.load_extensions()
else:
# Launch the web UI