feat: CD_BYPASS_UPLOAD

This commit is contained in:
bennykok 2024-05-10 11:34:49 +09:00
parent 697fd52349
commit 00d827e232

View File

@ -30,6 +30,10 @@ api_task = None
cd_enable_log = os.environ.get('CD_ENABLE_LOG', 'false').lower() == 'true' cd_enable_log = os.environ.get('CD_ENABLE_LOG', 'false').lower() == 'true'
cd_enable_run_log = os.environ.get('CD_ENABLE_RUN_LOG', 'false').lower() == 'true' cd_enable_run_log = os.environ.get('CD_ENABLE_RUN_LOG', 'false').lower() == 'true'
bypass_upload = os.environ.get('CD_BYPASS_UPLOAD', 'false').lower() == 'true'
print("CD_BYPASS_UPLOAD", bypass_upload)
def clear_current_prompt(sid): def clear_current_prompt(sid):
prompt_server = server.PromptServer.instance prompt_server = server.PromptServer.instance
@ -974,6 +978,7 @@ async def update_run_with_output(prompt_id, data, node_id=None):
"output_data": data "output_data": data
} }
if not bypass_upload:
try: try:
have_upload = 'images' in data or 'files' in data or 'gifs' in data or 'mesh' in data have_upload = 'images' in data or 'files' in data or 'gifs' in data or 'mesh' in data
print("\nhave_upload", have_upload, node_id) print("\nhave_upload", have_upload, node_id)
@ -987,7 +992,6 @@ async def update_run_with_output(prompt_id, data, node_id=None):
except Exception as e: except Exception as e:
await handle_error(prompt_id, data, e) await handle_error(prompt_id, data, e)
requests.post(status_endpoint, json=body) requests.post(status_endpoint, json=body)
await send('outputs_uploaded', { await send('outputs_uploaded', {