Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.
InvokeAI - A Stable Diffusion Toolkit
Stable Diffusion distribution by InvokeAI: https://github.com/invoke-ai
The Docker image tracks the main branch of the InvokeAI project, which means it includes the latest features, but may contain some bugs.
Your working directory is mounted under the /workspace path inside the pod. The models are in /workspace/invokeai/models, and outputs are in /workspace/invokeai/outputs.
Only the /workspace directory will persist between pod restarts!
If you terminate (not just stop) the pod, the /workspace will be lost.
Quickstart
- Before launching, choose a pod with a public IP for SSH. In the template's port settings, clear the exposed HTTP ports and expose only TCP port 22. Anyone who can reach InvokeAI on a fresh installation can claim the first administrator account.
- Set the pod's
PUBLIC_KEYenvironment variable to your SSH public key so that the image starts its SSH server. SetINVOKEAI_ROOT=/workspace/invokeaiso the administrator account persists on the volume. Launch the pod and wait for InvokeAI to start. - In the pod's Connect tab, copy the SSH over exposed TCP command. Insert
-N -L 127.0.0.1:9090:127.0.0.1:9090immediately aftersshand run it on your computer. Leave that terminal open. See RunPod's full SSH setup. - Open
http://localhost:9090on your computer, create the administrator account and sign in. - Keep using the tunnel for private access. If you want to share InvokeAI through the pod's HTTP proxy, enable HTTP port 9090 only after setup, with multi-user mode enabled and the same
/workspace/invokeaivolume attached.
PUBLIC_KEY can hold several keys, one per line. On every start, each key that is not already a line of /root/.ssh/authorized_keys is appended to it. Existing lines are never changed or removed, so to retire a key, delete its line from that file in an SSH session and remove it from PUBLIC_KEY.
Other things you can do
At any point you may edit the pod configuration and set an arbitrary Docker command. For example, you could run a command to downloads some models using curl, or fetch some images and place them into your outputs to continue a working session.
If you need to run multiple commands, define them in the Docker Command field like this:
bash -c "cd ${INVOKEAI_ROOT}/outputs; wormhole receive 2-foo-bar; invoke.py --web --host 0.0.0.0"
Copying your data in and out of the pod
This image includes a couple of handy tools to help you get the data into the pod (such as your custom models or embeddings), and out of the pod (such as downloading your outputs). Here are your options for getting your data in and out of the pod:
SSH server:
- Make sure to create and set your Public Key in the RunPod settings (follow the official instructions)
- Add an exposed port 22 (TCP) in the pod settings!
- When your pod restarts, you will see a new entry in the
Connectdialog. Use this SSH server toscporsftpyour files as necessary, or SSH into the pod using the fully fledged SSH server.
-
- On your computer,
pip install magic-wormhole(see above instructions for details) - Connect to the command line using the "light" SSH client or the browser-based console. Currently there's a bug where
wormholeisn't available when connected to "full" SSH server, as described above. wormhole send /workspace/invokeai/outputswill send the entireoutputsdirectory. You can also send individual files.- Once packaged, you will see a
wormhole receive <123-some-words>command. Copy it - Paste this command into the terminal on your local machine to securely download the payload.
- It works the same in reverse: you can
wormhole sendsome models from your computer to the pod. Again, save your files somewhere in/workspaceor they will be lost when the pod is stopped.
- On your computer,
RunPod's Cloud Sync feature may be used to sync the persistent volume to cloud storage. You could, for example, copy the entire
/workspaceto S3, add some custom models to it, and copy it back from S3 when launching new pod configurations. Follow the Cloud Sync instructions.
Disable the NSFW checker
The NSFW checker is enabled by default. To disable it, edit the pod configuration and set the following command:
invoke --web --host 0.0.0.0 --no-nsfw_checker
Template ©2023 Eugene Brodsky ebr