mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Remove reset switch for sd web api
Automatically recover from errors
This commit is contained in:
@@ -9384,7 +9384,11 @@ def text2img_api(prompt,
|
||||
apiaddress = '{}/sdapi/v1/txt2img'.format(koboldai_vars.img_gen_api_url.rstrip("/"))
|
||||
payload_json = json.dumps(final_imgen_params)
|
||||
logger.debug(final_imgen_params)
|
||||
submit_req = requests.post(url=apiaddress, data=payload_json)
|
||||
|
||||
try:
|
||||
submit_req = requests.post(url=apiaddress, data=payload_json)
|
||||
finally:
|
||||
koboldai_vars.generating_image = False
|
||||
|
||||
if submit_req.status_code == 404:
|
||||
show_error_notification(
|
||||
@@ -9396,7 +9400,6 @@ def text2img_api(prompt,
|
||||
elif not submit_req.ok:
|
||||
show_error_notification("SD Web API Failure", f"HTTP Code {submit_req.status_code} -- See console for details")
|
||||
logger.error(f"SD Web API Failure: HTTP Code {submit_req.status_code}, Body:\n{submit_req.text}")
|
||||
koboldai_vars.generating_image = False
|
||||
return None
|
||||
|
||||
results = submit_req.json()
|
||||
|
@@ -670,23 +670,6 @@ gensettingstf = [
|
||||
"ui_level": 2
|
||||
},
|
||||
{
|
||||
"UI_V2_Only": True,
|
||||
"uitype": "toggle",
|
||||
"unit": "bool",
|
||||
"label": "Reset Image Generating",
|
||||
"id": "generating_image",
|
||||
"min": 0,
|
||||
"max": 1,
|
||||
"step": 1,
|
||||
"default": 0,
|
||||
"tooltip": "Use to reset image gen flag in case of error.",
|
||||
"menu_path": "Interface",
|
||||
"sub_path": "Images",
|
||||
"classname": "system",
|
||||
"name": "generating_image",
|
||||
"ui_level": 2
|
||||
},
|
||||
{
|
||||
"UI_V2_Only": True,
|
||||
"uitype": "toggle",
|
||||
"unit": "bool",
|
||||
|
@@ -1060,7 +1060,8 @@ class system_settings(settings):
|
||||
no_save_variables = ['socketio', 'lua_state', 'lua_logname', 'lua_koboldbridge', 'lua_kobold',
|
||||
'lua_koboldcore', 'sp', 'sp_length', '_horde_pid', 'horde_share', 'aibusy',
|
||||
'serverstarted', 'inference_config', 'image_pipeline', 'summarizer',
|
||||
'summary_tokenizer', 'use_colab_tpu', 'noai', 'disable_set_aibusy', 'cloudflare_link', 'tts_model']
|
||||
'summary_tokenizer', 'use_colab_tpu', 'noai', 'disable_set_aibusy', 'cloudflare_link', 'tts_model',
|
||||
'generating_image']
|
||||
settings_name = "system"
|
||||
def __init__(self, socketio, koboldai_var):
|
||||
self.socketio = socketio
|
||||
|
Reference in New Issue
Block a user