Skip to content

Commit bcbd335

Browse files
committed
add username, password to WebUIApi constructor. check controlnet when set_auth is called.
1 parent 9e8b815 commit bcbd335

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
setup(
1313
name="webuiapi",
14-
version="0.9.0",
14+
version="0.9.1",
1515
description="Python API client for AUTOMATIC1111/stable-diffusion-webui",
1616
url="https://github.com/mix1009/sdwebuiapi",
1717
author="ChunKoo Park",

webuiapi/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
ControlNetUnit,
1313
)
1414

15-
__version__ = "0.9.0"
15+
__version__ = "0.9.1"
1616

1717
__all__ = [
1818
"__version__",

webuiapi/webuiapi.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ def __init__(
138138
sampler="Euler a",
139139
steps=20,
140140
use_https=False,
141+
username=None,
142+
password=None,
141143
):
142144
if baseurl is None:
143145
if use_https:
@@ -151,7 +153,10 @@ def __init__(
151153

152154
self.session = requests.Session()
153155

154-
self.check_controlnet()
156+
if username and password:
157+
self.set_auth(username, password)
158+
else:
159+
self.check_controlnet()
155160

156161
def check_controlnet(self):
157162
try:
@@ -162,6 +167,7 @@ def check_controlnet(self):
162167

163168
def set_auth(self, username, password):
164169
self.session.auth = (username, password)
170+
self.check_controlnet()
165171

166172
def _to_api_result(self, response):
167173
if response.status_code != 200:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy