Based on my tutor’s feedback I am going to make something around these points
- html page with image placeholder.
- textbox input
- Using node for backend, user can click button to submit a word that they enter
- The word is submitted, possibly using an endpoint of the node server
- The word is added to other keywords related to advertising so that the prompt formed is likely to produce a stylised result looking like an ad
- This generated image is displayed on the page
I updated the code in the app.js file with elements from https://www.itsolutionstuff.com/post/node-js-express-form-submission-exampleexample.html
I changed the response sent in the code example from 200 to 204, so that the server didn’t attempt to update the page.
This left me with a text field my app could receive user input from, letting them submit what would inform the image that would be generated
I started to use the node package child_process to allow the node app/ server to launch the python txt2img script and ran in to an error that looked like it arose from the txt2img script expecting to be run from within the stable diffusion directory.
I had moved the stable diffusion directory into the public directory of my project so when I got the error for a file not found at '/Users/fin/graduationProject/configs/stable-diffusion/v1-inference.yaml'
I knew from playing around with stable diffusion previously that this should have looked more like graduationProject/public/stable-diffusion/configs/stabl-diffusion/v1-inference.yaml
Bibliography
https://www.itsolutionstuff.com/post/node-js-express-form-submission-exampleexample.html
https://stackoverflow.com/questions/59836406/nodejs-run-python-script-in-conda-environment