From 875c56c5e7a6341fb1168b085bfd435e52ac3a19 Mon Sep 17 00:00:00 2001 From: ebolam Date: Wed, 9 Nov 2022 19:46:57 -0500 Subject: [PATCH] Added URL for local stable web api --- aiserver.py | 2 +- gensettings.py | 13 +++++++++++++ koboldai_settings.py | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/aiserver.py b/aiserver.py index d3e9ef77..b38bfd8e 100644 --- a/aiserver.py +++ b/aiserver.py @@ -9318,7 +9318,7 @@ def text2img_api(prompt, "prompt": "{}, {}".format(prompt, art_guide), "params": final_imgen_params, } - apiaddress = 'http://127.0.0.1:7860/sdapi/v1/txt2img' + apiaddress = '{}/sdapi/v1/txt2img'.format(koboldai_vars.img_gen_api_url) payload_json = json.dumps(final_submit_dict) logger.debug(final_submit_dict) submit_req = requests.post(url=f'{apiaddress}', data=payload_json).json() diff --git a/gensettings.py b/gensettings.py index 7f00a376..ba0e8f42 100644 --- a/gensettings.py +++ b/gensettings.py @@ -554,6 +554,19 @@ gensettingstf = [ 'children': [{'text': 'Use Local Only', 'value': 0}, {'text':'Prefer Local','value':1}, {'text':'Prefer Horde', 'value':2}, {'text':'Use Horde Only', 'value':3}, {'text':'Use Local SD-WebUI API', 'value':4}] }, { + "UI_V2_Only": True, + "uitype": "text", + "unit": "text", + "label": "Img API URL", + "id": "img_gen_api_url", + "default": "", + "tooltip": "The URL to use when selecting Use Local SD-WebUI API setting in Image Priority", + "menu_path": "Interface", + "sub_path": "Images", + "classname": "user", + "name": "img_gen_api_url" + }, + { "UI_V2_Only": True, "uitype": "toggle", "unit": "bool", diff --git a/koboldai_settings.py b/koboldai_settings.py index 0b53ee3b..5762f7ff 100644 --- a/koboldai_settings.py +++ b/koboldai_settings.py @@ -984,6 +984,7 @@ class user_settings(settings): self.beep_on_complete = False self.img_gen_priority = 1 self.show_budget = False + self.img_gen_api_url = "http://127.0.0.1:7860/" self.cluster_requested_models = [] # The models which we allow to generate during cluster mode