├── .env.example ├── .gitignore ├── LICENSE ├── README.md ├── configs └── sdxl.json ├── index.js ├── lib ├── arg-parser.js ├── chatgpt-model.js ├── image-input-model.js ├── replicate-model.js └── run-instance.js ├── loader.js ├── models ├── animatediff.js ├── bark.js ├── blip.js ├── controlnet.js ├── esrgan.js ├── gpt3.js ├── image-prompts.js ├── instructblip.js ├── replicate.js ├── sadtalker.js ├── sdxl.js ├── stablelm.js ├── tango.js ├── tortoise.js ├── zeroscope-upscale.js └── zeroscope.js ├── package-lock.json ├── package.json ├── predict.js ├── tests └── lib │ ├── arg-parser.test.js │ ├── replicate-model.test.js │ └── run-instance.test.js └── workflows ├── describe.js └── double-upscale.js /.env.example: -------------------------------------------------------------------------------- 1 | OPENAI_API_KEY= 2 | REPLICATE_API_TOKEN= 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .env 2 | node_modules 3 | outputs/ 4 | inputs/ 5 | .DS_Store 6 | temp/ 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 fofr 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Replicate predict 2 | 3 | A wrapper library to make running parallel API calls to Replicate models easier. 4 | 5 | - command line models and params 6 | - batch process prompts in a text file in an `inputs` directory 7 | - automaticall save outputs (alongside params) using curl to an `outputs` directory 8 | 9 | [See supported models](https://github.com/fofr/replicate-predict/tree/main/models) 10 | 11 | ## Requirements 12 | 13 | You need: 14 | 15 | - An account on Replicate 16 | - Your Replicate API token 17 | 18 | ## Installation 19 | 20 | ```sh 21 | git clone https://github.com/fofr/replicate-predict 22 | cd replicate-predict 23 | npm install 24 | ``` 25 | 26 | Rename `.env.example` as `.env` and add your Replicate API token. 27 | 28 | ## Usage 29 | 30 | ```sh 31 | node index.js