Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

IP Adapter

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.

Deploying IP Adapter

First, clone this repository:

git clone https://github.com/basetenlabs/truss-examples/
cd ip_adapter

Before deployment:

  1. Make sure you have a Baseten account and API key.
  2. Install the latest version of Truss: pip install --upgrade truss

With ip_adapter as your working directory, you can deploy the model with:

truss push

Paste your Baseten API key if prompted.

For more information, see Truss documentation.

Invoking IP Adapter

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..."
         }'