Libraries & SDKs
Official SDKs for integrating LlamaGen Comic API and Animation API across web, backend, mobile, and server environments, with Python and MCP resources included.
Comic JavaScript/TypeScript SDK
JavaScript / TypeScript package: comic
Install
npm i comicCreate comic generation
1import { LlamaGenClient } from "comic";2 3const client = new LlamaGenClient({4 apiKey: process.env.LLAMAGEN_API_KEY!,5});6 7const created = await client.comic.create({8 prompt: "american comic illustration, bold outlines, a detective in New York",9 preset: "neutral",10 size: "1024x1024",11});Wait and create animation
1const result = await client.comic.waitForCompletion(created.id);2 3const animation = await client.animation.create({4 prompt: "cinematic camera move across the finished comic panel",5});6 7console.log({ result, animation });Supported size values: 1024x1024 (1:1), 512x768 (2:3), 512x1024 (1:2), 576x1024 (9:16), 768x1024 (3:4), 1024x768 (4:3), 768x512 (3:2), 1024x576 (16:9), 1024x512 (2:1)
LlamaGen Node SDK
Node.js package: @llamagen/llamagen-node
Install
npm i @llamagen/llamagen-nodeCreate comic generation
1import { LlamaGenClient } from "@llamagen/llamagen-node";2 3const client = new LlamaGenClient({4 apiKey: process.env.LLAMAGEN_API_KEY,5});6 7const job = await client.comic.create({8 prompt: "bold comic cover, neon city chase",9 size: "1024x1024",10});Use Animation API
1const result = await client.comic.waitForCompletion(job.id);2 3const animation = await client.animation.create({4 prompt: "animate the finished comic panel",5});Supported size values: 1024x1024 (1:1), 512x768 (2:3), 512x1024 (1:2), 576x1024 (9:16), 768x1024 (3:4), 1024x768 (4:3), 768x512 (3:2), 1024x576 (16:9), 1024x512 (2:1)
LlamaGen Java SDK
Java package: ai.llamagen:llamagen-java
Install
implementation("ai.llamagen:llamagen-java:0.1.0")Create comic generation
1LlamaGenClient client = LlamaGenClient.builder()2 .apiKey(System.getenv("LLAMAGEN_API_KEY"))3 .build();4 5GenerationJob job = client.comic().create(ComicCreateParams.builder()6 .prompt("american comic illustration, bold outlines")7 .size("1024x1024")8 .build());Use Animation API
1GenerationJob animation = client.animation().create(2 AnimationCreateParams.builder()3 .prompt("animate the finished comic panel")4 .build()5);Supported size values: 1024x1024 (1:1), 512x768 (2:3), 512x1024 (1:2), 576x1024 (9:16), 768x1024 (3:4), 1024x768 (4:3), 768x512 (3:2), 1024x576 (16:9), 1024x512 (2:1)
LlamaGen Android SDK
Android / Java package: ai.llamagen:llamagen-android
Install
implementation("ai.llamagen:llamagen-android:0.1.0")Create comic generation
1LlamaGenClient client = new LlamaGenClient(BuildConfig.LLAMAGEN_API_KEY);2 3String job = client.comic.create(4 "{\"prompt\":\"american comic illustration\",\"size\":\"1024x1024\"}"5);Use Animation API
1String animation = client.animation.create(2 "{\"prompt\":\"animate the finished comic panel\"}"3);Supported size values: 1024x1024 (1:1), 512x768 (2:3), 512x1024 (1:2), 576x1024 (9:16), 768x1024 (3:4), 1024x768 (4:3), 768x512 (3:2), 1024x576 (16:9), 1024x512 (2:1)
LlamaGen iOS SDK
Swift / iOS package: LlamaGen
Install
Add https://github.com/LlamaGenAI/llamagen-ios in Swift Package ManagerCreate comic generation
1import LlamaGen2 3let client = LlamaGenClient(4 apiKey: ProcessInfo.processInfo.environment["LLAMAGEN_API_KEY"]!5)6 7let job = try await client.comic.create([8 "prompt": "american comic illustration, bold outlines",9 "size": "1024x1024",10])Use Animation API
1let animation = try await client.animation.create([2 "prompt": "animate the finished comic panel",3])Supported size values: 1024x1024 (1:1), 512x768 (2:3), 512x1024 (1:2), 576x1024 (9:16), 768x1024 (3:4), 1024x768 (4:3), 768x512 (3:2), 1024x576 (16:9), 1024x512 (2:1)
LlamaGen PHP SDK
PHP package: llamagen/llamagen-php
Install
composer require llamagen/llamagen-phpCreate comic generation
1use LlamaGen\LlamaGenClient;2 3$client = new LlamaGenClient(getenv("LLAMAGEN_API_KEY"));4 5$job = $client->comic->create([6 "prompt" => "american comic illustration, bold outlines",7 "size" => "1024x1024",8]);Use Animation API
1$animation = $client->animation->create([2 "prompt" => "animate the finished comic panel",3]);Supported size values: 1024x1024 (1:1), 512x768 (2:3), 512x1024 (1:2), 576x1024 (9:16), 768x1024 (3:4), 1024x768 (4:3), 768x512 (3:2), 1024x576 (16:9), 1024x512 (2:1)
LlamaGen Go SDK
Go package: github.com/LlamaGenAI/llamagen-go
Install
go get github.com/LlamaGenAI/llamagen-goCreate comic generation
1client := llamagen.NewClient(2 llamagen.WithAPIKey(os.Getenv("LLAMAGEN_API_KEY")),3)4 5job, err := client.Comic.Create(context.Background(), llamagen.Params{6 "prompt": "american comic illustration, bold outlines",7 "size": "1024x1024",8})Wait and create animation
1result, err := client.Comic.WaitForCompletion(2 context.Background(),3 job.ID,4 2*time.Second,5)6 7animation, err := client.Animation.Create(context.Background(), llamagen.Params{8 "prompt": "animate the finished comic panel",9})Supported size values: 1024x1024 (1:1), 512x768 (2:3), 512x1024 (1:2), 576x1024 (9:16), 768x1024 (3:4), 1024x768 (4:3), 768x512 (3:2), 1024x576 (16:9), 1024x512 (2:1)
LlamaGen React Native SDK
React Native package: @llamagen/llamagen-react-native
Install
npm i @llamagen/llamagen-react-nativeCreate comic generation
1import { LlamaGenClient } from "@llamagen/llamagen-react-native";2 3const client = new LlamaGenClient({ apiKey: serverIssuedToken });4 5const job = await client.comic.create({6 prompt: "mobile storyboard panel, energetic hero pose",7 size: "1024x1024",8});Use Animation API
1const animation = await client.animation.create({2 prompt: "animate the finished panel",3});Supported size values: 1024x1024 (1:1), 512x768 (2:3), 512x1024 (1:2), 576x1024 (9:16), 768x1024 (3:4), 1024x768 (4:3), 768x512 (3:2), 1024x576 (16:9), 1024x512 (2:1)
LlamaGen .NET SDK
.NET / C# package: LlamaGen
Install
dotnet add package LlamaGenCreate comic generation
1using LlamaGen;2 3var client = new LlamaGenClient(4 Environment.GetEnvironmentVariable("LLAMAGEN_API_KEY")5);6 7var job = await client.Comic.CreateAsync(new Dictionary<string, object> {8 ["prompt"] = "american comic illustration, bold outlines",9 ["size"] = "1024x1024",10});Use Animation API
1var animation = await client.Animation.CreateAsync(2 new Dictionary<string, object> {3 ["prompt"] = "animate the finished comic panel",4 }5);Supported size values: 1024x1024 (1:1), 512x768 (2:3), 512x1024 (1:2), 576x1024 (9:16), 768x1024 (3:4), 1024x768 (4:3), 768x512 (3:2), 1024x576 (16:9), 1024x512 (2:1)
Official Python SDK
Python package: llamagen-python
Install
pip install llamagen-pythonCreate comic generation
1import os2 3from llamagen import LlamaGenClient4 5client = LlamaGenClient(api_key=os.environ["LLAMAGEN_API_KEY"])6 7created = client.comic.create({8 "prompt": "american comic illustration, bold outlines",9 "preset": "neutral",10 "size": "1024x1024",11 "fixPanelNum": 4,12})Wait for completion
1# Wait for the final result2result = client.comic.wait_for_completion(3 created["id"],4 timeout_ms=30 * 60 * 1000,5)6 7print(result)Supported size values: 1024x1024 (1:1), 512x768 (2:3), 512x1024 (1:2), 576x1024 (9:16), 768x1024 (3:4), 1024x768 (4:3), 768x512 (3:2), 1024x576 (16:9), 1024x512 (2:1)