Skip to content

Commit b983d61

Browse files
committed
tweak format of "result" event in web ui
1 parent 153c93b commit b983d61

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

ldm/dream/server.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,8 @@ def image_done(image, seed, upscaled=False):
104104
with open("./outputs/img-samples/dream_web_log.txt", "a") as log:
105105
log.write(f"{path}: {json.dumps(config)}\n")
106106

107-
# TODO fix format of this event
108107
self.wfile.write(bytes(json.dumps(
109-
{'event': 'result', 'files': [path, seed], 'config': config}
108+
{'event': 'result', 'url': path, 'seed': seed, 'config': config}
110109
) + '\n',"utf-8"))
111110

112111
# control state of the "postprocessing..." message

static/dream_web/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ async function generateSubmit(form) {
9595
if (data.event === 'result') {
9696
noOutputs = false;
9797
document.querySelector("#no-results-message")?.remove();
98-
appendOutput(data.files[0],data.files[1],data.config);
98+
appendOutput(data.url, data.seed, data.config);
9999
progressEle.setAttribute('value', 0);
100100
progressEle.setAttribute('max', totalSteps);
101101
progressImageEle.src = BLANK_IMAGE_URL;

0 commit comments

Comments
 (0)