An experimental CLI for tweaking existing Cog models and deploying them to Replicate really fast.
⚠️ This is a tool for power users that has many rough edges. ⚠️
Fetch the precompiled Go binary from GitHub Releases:
sudo curl -o /usr/local/bin/yolo -L "https://github.com/replicate/yolo/releases/latest/download/yolo_$(uname -s)_$(uname -m)"
sudo chmod +x /usr/local/bin/yolo
Alternatively can build from source (Golang required):
go build && sudo cp yolo /usr/local/bin
You can use either your REPLICATE_API_TOKEN or your COG_TOKEN.
By using your REPLICATE_API_TOKEN, we can access the API and PUSH models to your account.
Visit https://replicate.com/account/api-tokens and copy your token.
export REPLICATE_API_TOKEN=r8_...
Visit https://replicate.com/auth/token and copy your token.
export COG_TOKEN=4b212....
Grab the code by cloning the repo
git clone https://github.com/replicate/cog-sdxl.git
Visit https://replicate.com/stability-ai/sdxl/api and find the docker image name:
r8.im/stability-ai/sdxl@sha256:1bfb924045802467cf8869d96b231a12e6aa994abfe37e337c63a4e49a8c6c41
This is going to be your "base" for your tweaked model. You can think of the process as adding your changes on top of this model, as that is what happens under the hood. A new layer is added with whatever files you specify.
There is no Replicate API for model creation, so you must create a model on the website:
https://replicate.com/create
If you are NOT changing the schema (inputs/outputs), you run this:
yolo push \
--base r8.im/stability-ai/sdxl@sha256:1bfb924045802467cf8869d96b231a12e6aa994abfe37e337c63a4e49a8c6c41 \
--dest r8.im/anotherjesse/my-awesome-changes \
list_of_files_to_send
If you are changing the schema
yolo push \
--base r8.im/stability-ai/sdxl@sha256:1bfb924045802467cf8869d96b231a12e6aa994abfe37e337c63a4e49a8c6c41 \
--dest r8.im/anotherjesse/my-awesome-changes \
--ast path_to_predictor.py \
path_to_predictor.py other_files_here.py