Added URL for local stable web api

This commit is contained in:
ebolam
2022-11-09 19:46:57 -05:00
parent 0cd70fdb56
commit 875c56c5e7
3 changed files with 15 additions and 1 deletions

View File

@@ -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()

View File

@@ -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",

View File

@@ -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