llamagen-python 0.1.11__tar.gz → 0.1.12__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: llamagen-python
3
- Version: 0.1.11
3
+ Version: 0.1.12
4
4
  Summary: Official Python SDK for LlamaGen Comic API and Animation API
5
5
  Project-URL: Homepage, https://llamagen.ai/comic-api
6
6
  Project-URL: Documentation, https://llamagen.ai/comic-api/docs
@@ -71,7 +71,7 @@ client = LlamaGenClient(
71
71
  )
72
72
 
73
73
  created = client.comic.create({
74
- "prompt": "Manga style, a 4-panel comic about Leo finding a glowing key in a quiet library.",
74
+ "prompt": "A 4-panel comic about Leo finding a glowing key in a quiet library.",
75
75
  "preset": "japanese_manga",
76
76
  "fixPanelNum": 4,
77
77
  })
@@ -118,7 +118,7 @@ from llamagen import LlamaGenClient
118
118
  client = LlamaGenClient(api_key=os.environ["LLAMAGEN_API_KEY"])
119
119
 
120
120
  generation = client.comic.create({
121
- "prompt": "Anime storybook style, The Little Prince meets the Fox in a luminous desert.",
121
+ "prompt": "The Little Prince meets the Fox in a luminous desert.",
122
122
  "preset": "animeStyle",
123
123
  "size": "1024x1024",
124
124
  "pagination": {"totalPages": 2, "panelsPerPage": 4},
@@ -137,7 +137,7 @@ generation = client.comic.create({
137
137
 
138
138
  Comic methods:
139
139
 
140
- - `llamagen.comic.create(params)` submits a new comic generation job and returns the created job id, status, and usage metadata. Use `preset` for a known style preset id, or describe the visual style in `prompt`.
140
+ - `llamagen.comic.create(params)` submits a new comic generation job and returns the created job id, status, and usage metadata. Use `preset` for a known style preset id; keep `prompt` focused on story, characters, scene, and action.
141
141
  - `llamagen.comic.get(id, page=None, panel=None)` fetches a comic generation's status and result, or a specific page or panel.
142
142
  - `llamagen.comic.continue_write(id, params)` extends an existing comic.
143
143
  - `llamagen.comic.update_panel(id, params)` regenerates one panel.
@@ -158,7 +158,7 @@ from llamagen import LlamaGenClient
158
158
  client = LlamaGenClient(api_key=os.environ["LLAMAGEN_API_KEY"])
159
159
 
160
160
  created = client.comic.create({
161
- "prompt": "Bold comic style, a 4-panel comic about Leo finding a glowing key in a quiet library.",
161
+ "prompt": "A 4-panel comic about Leo finding a glowing key in a quiet library.",
162
162
  "preset": "comicBookStyle",
163
163
  "fixPanelNum": 4,
164
164
  })
@@ -210,8 +210,8 @@ WAIT_TIMEOUT_MS = 30 * 60 * 1000
210
210
  client = LlamaGenClient(api_key=os.environ["LLAMAGEN_API_KEY"])
211
211
 
212
212
  finished = client.comic.create_and_wait({
213
- "prompt": "Retro American comic style, a cozy 3-panel comic about a robot learning to bake bread.",
214
- "preset": "american_comic_90",
213
+ "prompt": "A cozy 3-panel comic about a robot learning to bake bread.",
214
+ "preset": "comicBookStyle",
215
215
  "fixPanelNum": 3,
216
216
  }, timeout_ms=WAIT_TIMEOUT_MS)
217
217
  print("comic.create_and_wait:", finished["id"], finished.get("status"))
@@ -46,7 +46,7 @@ client = LlamaGenClient(
46
46
  )
47
47
 
48
48
  created = client.comic.create({
49
- "prompt": "Manga style, a 4-panel comic about Leo finding a glowing key in a quiet library.",
49
+ "prompt": "A 4-panel comic about Leo finding a glowing key in a quiet library.",
50
50
  "preset": "japanese_manga",
51
51
  "fixPanelNum": 4,
52
52
  })
@@ -93,7 +93,7 @@ from llamagen import LlamaGenClient
93
93
  client = LlamaGenClient(api_key=os.environ["LLAMAGEN_API_KEY"])
94
94
 
95
95
  generation = client.comic.create({
96
- "prompt": "Anime storybook style, The Little Prince meets the Fox in a luminous desert.",
96
+ "prompt": "The Little Prince meets the Fox in a luminous desert.",
97
97
  "preset": "animeStyle",
98
98
  "size": "1024x1024",
99
99
  "pagination": {"totalPages": 2, "panelsPerPage": 4},
@@ -112,7 +112,7 @@ generation = client.comic.create({
112
112
 
113
113
  Comic methods:
114
114
 
115
- - `llamagen.comic.create(params)` submits a new comic generation job and returns the created job id, status, and usage metadata. Use `preset` for a known style preset id, or describe the visual style in `prompt`.
115
+ - `llamagen.comic.create(params)` submits a new comic generation job and returns the created job id, status, and usage metadata. Use `preset` for a known style preset id; keep `prompt` focused on story, characters, scene, and action.
116
116
  - `llamagen.comic.get(id, page=None, panel=None)` fetches a comic generation's status and result, or a specific page or panel.
117
117
  - `llamagen.comic.continue_write(id, params)` extends an existing comic.
118
118
  - `llamagen.comic.update_panel(id, params)` regenerates one panel.
@@ -133,7 +133,7 @@ from llamagen import LlamaGenClient
133
133
  client = LlamaGenClient(api_key=os.environ["LLAMAGEN_API_KEY"])
134
134
 
135
135
  created = client.comic.create({
136
- "prompt": "Bold comic style, a 4-panel comic about Leo finding a glowing key in a quiet library.",
136
+ "prompt": "A 4-panel comic about Leo finding a glowing key in a quiet library.",
137
137
  "preset": "comicBookStyle",
138
138
  "fixPanelNum": 4,
139
139
  })
@@ -185,8 +185,8 @@ WAIT_TIMEOUT_MS = 30 * 60 * 1000
185
185
  client = LlamaGenClient(api_key=os.environ["LLAMAGEN_API_KEY"])
186
186
 
187
187
  finished = client.comic.create_and_wait({
188
- "prompt": "Retro American comic style, a cozy 3-panel comic about a robot learning to bake bread.",
189
- "preset": "american_comic_90",
188
+ "prompt": "A cozy 3-panel comic about a robot learning to bake bread.",
189
+ "preset": "comicBookStyle",
190
190
  "fixPanelNum": 3,
191
191
  }, timeout_ms=WAIT_TIMEOUT_MS)
192
192
  print("comic.create_and_wait:", finished["id"], finished.get("status"))
@@ -39,7 +39,7 @@ def make_client() -> LlamaGenClient:
39
39
  def quick_start(client: LlamaGenClient) -> None:
40
40
  created = client.comic.create(
41
41
  {
42
- "prompt": "Manga style, a 4-panel comic about Leo finding a glowing key in a quiet library.",
42
+ "prompt": "A 4-panel comic about Leo finding a glowing key in a quiet library.",
43
43
  "preset": "japanese_manga",
44
44
  "fixPanelNum": 4,
45
45
  }
@@ -53,7 +53,7 @@ def quick_start(client: LlamaGenClient) -> None:
53
53
  def create_comic(client: LlamaGenClient) -> None:
54
54
  created = client.comic.create(
55
55
  {
56
- "prompt": "Bold comic style, a 4-panel comic about Leo finding a glowing key in a quiet library.",
56
+ "prompt": "A 4-panel comic about Leo finding a glowing key in a quiet library.",
57
57
  "preset": "comicBookStyle",
58
58
  "fixPanelNum": 4,
59
59
  }
@@ -64,7 +64,7 @@ def create_comic(client: LlamaGenClient) -> None:
64
64
  def create_comic_with_advanced_options(client: LlamaGenClient) -> None:
65
65
  generation = client.comic.create(
66
66
  {
67
- "prompt": "Anime storybook style, The Little Prince meets the Fox in a luminous desert.",
67
+ "prompt": "The Little Prince meets the Fox in a luminous desert.",
68
68
  "preset": "animeStyle",
69
69
  "size": "1024x1024",
70
70
  "pagination": {"totalPages": 2, "panelsPerPage": 4},
@@ -99,8 +99,8 @@ def wait_for_comic(client: LlamaGenClient, comic_id: str) -> None:
99
99
  def create_and_wait_for_comic(client: LlamaGenClient) -> None:
100
100
  finished = client.comic.create_and_wait(
101
101
  {
102
- "prompt": "Retro American comic style, a cozy 3-panel comic about a robot learning to bake bread.",
103
- "preset": "american_comic_90",
102
+ "prompt": "A cozy 3-panel comic about a robot learning to bake bread.",
103
+ "preset": "comicBookStyle",
104
104
  "fixPanelNum": 3,
105
105
  },
106
106
  timeout_ms=WAIT_TIMEOUT_MS,
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "llamagen-python"
7
- version = "0.1.11"
7
+ version = "0.1.12"
8
8
  description = "Official Python SDK for LlamaGen Comic API and Animation API"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -14,4 +14,4 @@ __all__ = [
14
14
  "SUPPORTED_COMIC_SIZES",
15
15
  ]
16
16
 
17
- __version__ = "0.1.11"
17
+ __version__ = "0.1.12"
@@ -10,7 +10,7 @@ from typing import Any, Dict, Mapping, Optional, Protocol, Tuple
10
10
 
11
11
  from ._errors import LlamaGenAPIError, LlamaGenConnectionError, LlamaGenTimeoutError
12
12
 
13
- DEFAULT_USER_AGENT = "llamagen-python/0.1.11"
13
+ DEFAULT_USER_AGENT = "llamagen-python/0.1.12"
14
14
 
15
15
 
16
16
  class Transport(Protocol):
@@ -80,7 +80,7 @@ class ClientTests(unittest.TestCase):
80
80
  self.assertEqual(call["url"], "https://api.llamagen.ai/v1/comics/generations")
81
81
  self.assertEqual(call["headers"]["Authorization"], "Bearer test-key")
82
82
  self.assertEqual(call["headers"]["Accept"], "application/json")
83
- self.assertEqual(call["headers"]["User-Agent"], "llamagen-python/0.1.11")
83
+ self.assertEqual(call["headers"]["User-Agent"], "llamagen-python/0.1.12")
84
84
  body = json.loads(call["body"].decode("utf-8"))
85
85
  self.assertEqual(body["preset"], "neutral")
86
86
  self.assertEqual(body["size"], "1024x1024")