0.0
No release in over a year
Ruby API wrapper for Replicate
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 2.7.1
 Project Readme

Replicate Ruby client

This is a Ruby client for Replicate. It lets you run models with your Ruby code.

Grab your token from replicate.com/account to use this library.

Installation

Add this line to your application's Gemfile:

gem 'replicate-api'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install replicate-api

Usage

You can run a model and get its output:

replicate = Replicate::Client.new(token: "#{YOUR API KEY HERE}")
model = replicate.models("stability-ai/stable-diffusion")
height = 786 
width = 574
model.predict(prompt: "a 19th century portrait of a wombat gentleman", width: width, height: height)

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/olivia-li/replicate-ruby.

License

The gem is available as open source under the terms of the MIT License.