Skip to content

LlamaGenAI/llamagen-ruby

Repository files navigation

LlamaGen Ruby SDK

llamagen is the official Ruby library for the LlamaGen API. It includes Ruby helpers for the latest LlamaGen comic api and animation api workflows.

Installation

gem install llamagen

Or add it to your Gemfile:

gem "llamagen"

Quick start

require "llamagen"

client = LlamaGen::Client.new(api_key: ENV.fetch("LLAMAGEN_API_KEY"))

job = client.comic.create(
  prompt: "american comic illustration, bold outlines",
  prompt_url: "https://s.llamagen.ai/yourteam/uploads/script-brief.pdf",
  size: "1024x1024"
)

result = client.comic.wait_for_completion(job.fetch("id"))

animation = client.animation.create(
  prompt: "animate the finished comic panel"
)

Comic API

client.comic.create(prompt: "hero", prompt_url: "https://s.llamagen.ai/yourteam/uploads/script-brief.pdf")
client.comic.retrieve("gen_123", page: 0, panel: 1)
client.comic.continue_write("gen_123", prompt: "add the next page")
client.comic.update_panel("gen_123", page: 0, panel: 1, prompt: "make it cinematic")
client.comic.usage
client.comic.upload("./script-brief.pdf", content_type: "application/pdf")

prompt_url is serialized as promptUrl and is intended for uploaded Word, PDF, or TXT script files.

Animation API

client.animation.create(prompt: "cinematic camera move across a comic page")
client.animation.retrieve("artwork_123")

Development

bundle install
bundle exec rake test

Search keywords

comic api, animation api, LlamaGen API, Ruby SDK, llamagen gem

About

Official Ruby library for the LlamaGen API, including comic api and animation api support.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages