Skip to content

Commit

Permalink
make initimg appear in web log
Browse files Browse the repository at this point in the history
  • Loading branch information
lstein committed Sep 3, 2022
1 parent b90a215 commit d0d95d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ldm/dream/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def do_POST(self):
# across images generated by each call to prompt2img(), so we define it in
# the outer scope of image_done()
config = post_data.copy() # Shallow copy
config['initimg'] = ''
config['initimg'] = config.pop('initimg_name','')

images_generated = 0 # helps keep track of when upscaling is started
images_upscaled = 0 # helps keep track of when upscaling is completed
Expand Down
4 changes: 3 additions & 1 deletion static/dream_web/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ function appendOutput(src, seed, config) {
outputNode.addEventListener('click', () => {
let form = document.querySelector("#generate-form");
for (const [k, v] of new FormData(form)) {
form.querySelector(`*[name=${k}]`).value = config[k];
if (k == 'initimg') { continue; }
form.querySelector(`*[name=${k}]`).value = config[k];
}
document.querySelector("#seed").value = seed;

Expand Down Expand Up @@ -59,6 +60,7 @@ async function generateSubmit(form) {

// Convert file data to base64
let formData = Object.fromEntries(new FormData(form));
formData.initimg_name = formData.initimg.name
formData.initimg = formData.initimg.name !== '' ? await toBase64(formData.initimg) : null;

let strength = formData.strength;
Expand Down

0 comments on commit d0d95d3

Please sign in to comment.