A guide on configuring your truss to use external packages
packages
directory. This directory is at the same level as the model
directory in the hierarchy.
Inside this directory, you can place any additional python packages that your would like to reference inside your truss.
For example, your packages directory might look like this:
model.py
like so:
external_package_dirs
comes in handy.
The external_package_dirs
allows you to import packages that are outside your truss and hence allows multiple trusses to reference the same package.
Let’s look at an example.
super_cool_awesome_plugin
, is outside the truss. You could move the super_cool_awesome_plugin
directory inside the packages
directory if you wanted to, but there is another option.
Inside the config.yaml
you can specify the path to external packages by using the key external_package_dirs
. Under this key, you can provide a list of external packages that you would like to use in your truss.
Here is what that would look like for the example above:
super_cool_awesome_plugin/
is parallel to stable-diffusion/
, but it’s one directory up from the config.yaml so we use ../super_cool_awesome_plugin
.model.py
:
packages
directory.
On the other hand, if you have a common package that will get used by multiple trusses, external_package_dirs
is the better option.