InvokeAI/invokeai/frontend/web/docs
2024-01-23 18:04:41 +11:00
..
README.md docs(ui): update README 2024-01-23 18:04:41 +11:00
WORKFLOWS_DESIGN_IMPLEMENTATION.md docs(ui): fix typo 2024-01-23 18:04:41 +11:00

Invoke UI

Core Libraries

Invoke's UI is made possible by a number of excellent open-source libraries. The most heavily-used are listed below, but there are many others.

Package Scripts

See package.json for all scripts.

Run with pnpm <script name>.

  • dev: run the frontend in dev mode, enabling hot reloading
  • build: run all checks (madge, eslint, prettier, tsc) and then build the frontend
  • typegen: generate types from the OpenAPI schema (see Client Types Generation)
  • lint:madge: check frontend for circular dependencies
  • lint:eslint: check frontend for code quality
  • lint:prettier: check frontend for code formatting
  • lint:tsc: check frontend for type issues
  • lint: run all checks concurrently
  • fix: run eslint and prettier, fixing fixable issues

Client Types Generation

We use openapi-typescript to generate types from the app's OpenAPI schema.

The generated types are written to invokeai/frontend/web/src/services/api/schema.d.ts. This file is committed to the repo.

The server must be started and available at http://127.0.0.1:9090.

# from the repo root, start the server
python scripts/invokeai-web.py
# from invokeai/frontend/web/, run the script
pnpm typegen

Contributing

Thanks for your interest in contributing to the Invoke Web UI!

We encourage you to ping @psychedelicious and @blessedcoolant on discord if you want to contribute, just to touch base and ensure your work doesn't conflict with anything else going on. The project is very active.

Localization

We use i18next for localization, but translation to languages other than English happens on our Weblate project.

Only the English source strings should be changed on this repo.

Dev Environment

Install node and pnpm.

From invokeai/frontend/web/ run pnpm i to get everything set up.

Start everything in dev mode:

  1. From invokeai/frontend/web/: pnpm dev
  2. From repo root: python scripts/invokeai-web.py
  3. Point your browser to the dev server address e.g. http://localhost:5173/

VSCode Remote Dev

We've noticed an intermittent issue with the VSCode Remote Dev port forwarding. If you use this feature of VSCode, you may intermittently click the Invoke button and then get nothing until the request times out.

We suggest disabling the IDE's port forwarding feature and doing it manually via SSH:

ssh -L 9090:localhost:9090 -L 5173:localhost:5173 user@host