This is a Truss for IP Adapter. IP Adapter can create variations of a given input image based on a prompt, while retaining the aesthetic of the origina image.
First, clone this repository:
git clone https://github.com/basetenlabs/truss-examples/
cd ip_adapterBefore deployment:
- Make sure you have a Baseten account and API key.
- Install the latest version of Truss:
pip install --upgrade truss
With ip_adapter as your working directory, you can deploy the model with:
truss pushPaste your Baseten API key if prompted.
For more information, see Truss documentation.
IP Adapter takes in two inputs, an optional prompt and a base64 encoded image. The output is a JSON blob with a single key, result with another base64 encoded image.
truss predict -d '{"image": "data:image/png;base64,iVBORw0KGgoA..."}'You can also invoke your model via a REST API
curl -X POST https://app.baseten.co/model_versions/<YOUR_MODEL_VERSION_ID>/predict \
-H "Content-Type: application/json" \
-d '{
"image": "data:image/png;base64,iVBORw0KGgoA..."
}'