This repository contains the code for the Clarity-Upscaler deployment. The initial codebase was taken and modified from https://github.com/philz1337x/clarity-upscaler/tree/main.
-
Install
replicate-cog
on a local GPU machine:sudo curl -o /usr/local/bin/cog -L "https://github.com/replicate/cog/releases/latest/download/cog_$(uname -s)_$(uname -m)" sudo chmod +x /usr/local/bin/cog
For the latest installation instructions, see replicate-cog.
Note: While
cog
technically allows deployment from non-GPU machines, deploying this pipeline from a non-GPU machine (e.g., Macbook M3 Pro Max) has been unsuccessful. We recommend using either a personal GPU machine or a Lambdalabs GPU instance (A100 40GB) for making changes and pushing the model. -
Clone this repository:
git clone https://github.com/sdtechdev/replicate-clarity-upscaler cd replicate-clarity-upscaler
-
Download the required models and checkpoints:
python download_weights.py
To test if the pipeline is working properly, make a prediction locally:
sudo cog predict -i image=@init.png
-
Either create a new model on the sdtechdev Replicate account or use the existing model repository: clarity-upscaler-4-deployment.
-
Push the model to Replicate:
# First, login to Replicate sudo cog login # Then push the model sudo cog push r8.im/sdtechdev/clarity-upscaler-4-deployment
Building and pushing the Docker image (approximately 27GB) can take 10-12 minutes depending on available cache images and internet speed.
Note: A GitHub Actions workflow is available to automate model deployment to Replicate (see .github/workflows/push.yml
). However, due to the large Docker image size, the workflow fails on default GitHub runners. A custom-hosted runner is required to successfully push using GitHub Actions.