InvokeAI/frontend
2022-09-17 09:11:29 -04:00
..
dist * Added parameters to new more verbose React app and rebuilt the app. 2022-09-17 09:11:29 -04:00
src * Added parameters to new more verbose React app and rebuilt the app. 2022-09-17 09:11:29 -04:00
.eslintrc.cjs React web UI with flask-socketio API (#429) 2022-09-16 13:18:15 -04:00
.gitignore React web UI with flask-socketio API (#429) 2022-09-16 13:18:15 -04:00
index.d.ts React web UI with flask-socketio API (#429) 2022-09-16 13:18:15 -04:00
index.html React web UI with flask-socketio API (#429) 2022-09-16 13:18:15 -04:00
package.json React web UI with flask-socketio API (#429) 2022-09-16 13:18:15 -04:00
README.md React web UI with flask-socketio API (#429) 2022-09-16 13:18:15 -04:00
tsconfig.json React web UI with flask-socketio API (#429) 2022-09-16 13:18:15 -04:00
tsconfig.node.json React web UI with flask-socketio API (#429) 2022-09-16 13:18:15 -04:00
vite.config.ts React web UI with flask-socketio API (#429) 2022-09-16 13:18:15 -04:00
yarn.lock React web UI with flask-socketio API (#429) 2022-09-16 13:18:15 -04:00

Stable Diffusion Web UI

Demo at https://peaceful-otter-7a427f.netlify.app/ (not connected to back end)

much of this readme is just notes for myself during dev work

numpy rand: 0 to 4294967295

Test and Build

from frontend/:

  • yarn dev runs tsc-watch, which runs vite build on successful tsc transpilation

from .:

API

backend/server.py serves the UI and provides a socket.io API via flask-socketio.

Server Listeners

The server listens for these socket.io events:

cancel

  • Cancels in-progress image generation
  • Returns ack only

generateImage

  • Accepts object of image parameters
  • Generates an image
  • Returns ack only (image generation function sends progress and result via separate events)

deleteImage

  • Accepts file path to image
  • Deletes image
  • Returns ack only

deleteAllImages WIP

  • Deletes all images in outputs/
  • Returns ack only

requestAllImages

  • Returns array of all images in outputs/

requestCapabilities WIP

  • Returns capabilities of server (torch device, GFPGAN and ESRGAN availability, ???)

sendImage WIP

  • Accepts a File and attributes
  • Saves image
  • Used to save init images which are not generated images

Server Emitters

progress

  • Emitted during each step in generation
  • Sends a number from 0 to 1 representing percentage of steps completed

result WIP

  • Emitted when an image generation has completed
  • Sends a object:
{
    url: relative_file_path,
    metadata: image_metadata_object
}

TODO

  • Search repo for "TODO"
  • My one gripe with Chakra: no way to disable all animations right now and drop the dependence on framer-motion. I would prefer to save the ~30kb on bundle and have zero animations. This is on the Chakra roadmap. See https://github.com/chakra-ui/chakra-ui/pull/6368 for last discussion on this. Need to check in on this issue periodically.