Skip to content

Instantly share code, notes, and snippets.

@fofr
Last active May 9, 2024 16:53
Show Gist options
  • Save fofr/9e5ed093871f091e5c3b3268038d8195 to your computer and use it in GitHub Desktop.
Save fofr/9e5ed093871f091e5c3b3268038d8195 to your computer and use it in GitHub Desktop.
import Replicate from 'replicate'
import * as dotenv from 'dotenv'
dotenv.config()
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
})
async function main() {
const training = await replicate.trainings.create(
'stability-ai',
'sdxl',
'a00d0b7dcbb9c3fbb34ba87d2d5b46c56969c84a628bf778a7fdaec30b1b99c5',
{
destination: 'your-username/your-model',
input: {
input_images: 'https://example.com/your-images.zip'
}
})
console.log(`URL: https://replicate.com/p/${training.id}`)
}
main()
// Run:
// node train-sdxl.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment