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.
- {llamagen_python-0.1.11 → llamagen_python-0.1.12}/PKG-INFO +7 -7
- {llamagen_python-0.1.11 → llamagen_python-0.1.12}/README.md +6 -6
- {llamagen_python-0.1.11 → llamagen_python-0.1.12}/examples/quickstart.py +5 -5
- {llamagen_python-0.1.11 → llamagen_python-0.1.12}/pyproject.toml +1 -1
- {llamagen_python-0.1.11 → llamagen_python-0.1.12}/src/llamagen/__init__.py +1 -1
- {llamagen_python-0.1.11 → llamagen_python-0.1.12}/src/llamagen/_http.py +1 -1
- {llamagen_python-0.1.11 → llamagen_python-0.1.12}/tests/test_client.py +1 -1
- {llamagen_python-0.1.11 → llamagen_python-0.1.12}/.gitignore +0 -0
- {llamagen_python-0.1.11 → llamagen_python-0.1.12}/LICENSE +0 -0
- {llamagen_python-0.1.11 → llamagen_python-0.1.12}/docs/RELEASE.md +0 -0
- {llamagen_python-0.1.11 → llamagen_python-0.1.12}/examples/Untitled.ipynb +0 -0
- {llamagen_python-0.1.11 → llamagen_python-0.1.12}/src/llamagen/_client.py +0 -0
- {llamagen_python-0.1.11 → llamagen_python-0.1.12}/src/llamagen/_errors.py +0 -0
- {llamagen_python-0.1.11 → llamagen_python-0.1.12}/src/llamagen/_types.py +0 -0
- {llamagen_python-0.1.11 → llamagen_python-0.1.12}/src/llamagen/py.typed +0 -0
- {llamagen_python-0.1.11 → llamagen_python-0.1.12}/src/llamagen/resources/__init__.py +0 -0
- {llamagen_python-0.1.11 → llamagen_python-0.1.12}/src/llamagen/resources/animations.py +0 -0
- {llamagen_python-0.1.11 → llamagen_python-0.1.12}/src/llamagen/resources/comics.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: llamagen-python
|
|
3
|
-
Version: 0.1.
|
|
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": "
|
|
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": "
|
|
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
|
|
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": "
|
|
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": "
|
|
214
|
-
"preset": "
|
|
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": "
|
|
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": "
|
|
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
|
|
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": "
|
|
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": "
|
|
189
|
-
"preset": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
103
|
-
"preset": "
|
|
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,
|
|
@@ -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.
|
|
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.
|
|
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")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|