llamagen is the official Ruby library for the LlamaGen API. It includes Ruby helpers for the latest LlamaGen comic api and animation api workflows.
gem install llamagenOr add it to your Gemfile:
gem "llamagen"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"
)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.
client.animation.create(prompt: "cinematic camera move across a comic page")
client.animation.retrieve("artwork_123")bundle install
bundle exec rake testcomic api, animation api, LlamaGen API, Ruby SDK, llamagen gem