tweak format of "result" event in web ui

This commit is contained in:
Kevin Gibbons 2022-08-30 21:33:42 -07:00
parent 153c93bdd4
commit b983d61e93
2 changed files with 2 additions and 3 deletions

View File

@ -104,9 +104,8 @@ class DreamServer(BaseHTTPRequestHandler):
with open("./outputs/img-samples/dream_web_log.txt", "a") as log:
log.write(f"{path}: {json.dumps(config)}\n")
# TODO fix format of this event
self.wfile.write(bytes(json.dumps(
{'event': 'result', 'files': [path, seed], 'config': config}
{'event': 'result', 'url': path, 'seed': seed, 'config': config}
) + '\n',"utf-8"))
# control state of the "postprocessing..." message

View File

@ -95,7 +95,7 @@ async function generateSubmit(form) {
if (data.event === 'result') {
noOutputs = false;
document.querySelector("#no-results-message")?.remove();
appendOutput(data.files[0],data.files[1],data.config);
appendOutput(data.url, data.seed, data.config);
progressEle.setAttribute('value', 0);
progressEle.setAttribute('max', totalSteps);
progressImageEle.src = BLANK_IMAGE_URL;