Welcome to SHARK UI! This repo contains a basic app to demonstrate how to use the Shortfin Web APIs for text-to-image and text-to-text inference.
To get SHARK UI up and running:
-
Clone the project
git clone https://github.com/nod-ai/shark-ui.git cd shark-ui
-
Configure dependencies
-
- Prefer the latest LTS version of node (even-numbered major version)
- For "using", select
nvm
if available, otherwise selectfnm
- For "with", select
npm
-
Install project dependencies, by running (from the project root):
npm install
-
-
Add your environment to the project root:
-
Run:
echo "VITE_TEXT_TO_IMAGE_API_ORIGIN=http://localhost:<server-port>" > .env
-
If you are connecting to a server on a virtual machine, have your local machine forward the port.
-
Helps when the VM has a firewall
-
i.e. via SSH:
ssh -L <server-port>:localhost:<local-port> user@server_origin
-
NOTE: https is not yet supported
-
-
If you haven't already:
- Complete installation
- Serve the text-to-image API from Shortfin, i.e. for SDXL
-
Serve the project (and avoid minification) by running:
npm run dev
-
Open the "localhost" URL in your browser of choice.
-
Take it for a spin!
-
If you haven't already, complete the basic installation
-
Serve the project with HMR by running:
npm run dev
NOTE: Shows Vue Dev Tools for debugging UI
-
Lint early and often with ESLint by running:
npm run lint
-
Run Unit Tests with Vitest:
npm run test:unit
-
Run End-to-End Tests against the development server with Cypress:
npm run test:e2e:dev
NOTE: It is much faster than doing so against the production build.
-
If you haven't already, complete the basic installation
-
Type-Check, compile and minify for production by running:
npm run build
-
Test the production build (e.g. in CI environments):
npm run test:e2e