ginskill-init 1.0.0
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.
- package/README.md +77 -0
- package/agents/developer.md +56 -0
- package/agents/frontend-design.md +69 -0
- package/agents/mobile-reviewer.md +36 -0
- package/agents/review-code.md +49 -0
- package/agents/security-scanner.md +50 -0
- package/agents/tester.md +72 -0
- package/bin/cli.js +226 -0
- package/package.json +20 -0
- package/skills/ai-asset-generator/SKILL.md +255 -0
- package/skills/ai-asset-generator/docs/gen-image.md +274 -0
- package/skills/ai-asset-generator/docs/genvideo.md +341 -0
- package/skills/ai-asset-generator/docs/remove-background.md +19 -0
- package/skills/ai-asset-generator/generate-credit-assets.mjs +180 -0
- package/skills/ai-asset-generator/generate-ginbrowser-assets.mjs +242 -0
- package/skills/ai-asset-generator/generate-sty-icon.mjs +149 -0
- package/skills/ai-asset-generator/lib/bg-remove.mjs +34 -0
- package/skills/ai-asset-generator/lib/env.mjs +38 -0
- package/skills/ai-asset-generator/lib/kie-client.mjs +88 -0
- package/skills/ai-asset-generator/scripts/scaffold-generator.mjs +203 -0
- package/skills/ai-build-ai/SKILL.md +124 -0
- package/skills/ai-build-ai/docs/agent-teams.md +293 -0
- package/skills/ai-build-ai/docs/checkpointing.md +161 -0
- package/skills/ai-build-ai/docs/create-agent.md +399 -0
- package/skills/ai-build-ai/docs/create-mcp.md +395 -0
- package/skills/ai-build-ai/docs/create-skill.md +299 -0
- package/skills/ai-build-ai/docs/headless-mode.md +614 -0
- package/skills/ai-build-ai/docs/hooks.md +578 -0
- package/skills/ai-build-ai/docs/memory-claude-md.md +375 -0
- package/skills/ai-build-ai/docs/output-styles.md +208 -0
- package/skills/ai-build-ai/docs/overview.md +162 -0
- package/skills/ai-build-ai/docs/permissions.md +391 -0
- package/skills/ai-build-ai/docs/plugins.md +396 -0
- package/skills/ai-build-ai/docs/sandbox.md +262 -0
- package/skills/ai-build-ai/scripts/load-tutorial.sh +54 -0
- package/skills/icon-generator/SKILL.md +270 -0
- package/skills/mobile-app-review/SKILL.md +321 -0
- package/skills/mobile-app-review/references/apple-review.md +132 -0
- package/skills/mobile-app-review/references/google-play-review.md +203 -0
- package/skills/mongodb/SKILL.md +667 -0
- package/skills/mongodb/references/mongoose-patterns.md +368 -0
- package/skills/nestjs-architecture/SKILL.md +1086 -0
- package/skills/nestjs-architecture/references/advanced-patterns.md +590 -0
- package/skills/performance/SKILL.md +509 -0
- package/skills/react-fsd-architecture/SKILL.md +693 -0
- package/skills/react-fsd-architecture/references/fsd-patterns.md +747 -0
- package/skills/react-query/SKILL.md +685 -0
- package/skills/react-query/references/query-patterns.md +365 -0
- package/skills/review-code/SKILL.md +321 -0
- package/skills/review-code/references/clean-code-principles.md +395 -0
- package/skills/review-code/references/frontend-patterns.md +136 -0
- package/skills/review-code/references/nestjs-patterns.md +184 -0
- package/skills/review-code/scripts/check-module.sh +201 -0
- package/skills/review-code/scripts/deep-scan.sh +604 -0
- package/skills/review-code/scripts/dep-check.sh +522 -0
- package/skills/review-code/scripts/detect-duplicates.sh +466 -0
- package/skills/review-code/scripts/format-check.sh +577 -0
- package/skills/review-code/scripts/run-review.sh +167 -0
- package/skills/review-code/scripts/scan-codebase.sh +152 -0
- package/skills/security-scanner/SKILL.md +327 -0
- package/skills/security-scanner/references/nestjs-security.md +260 -0
- package/skills/security-scanner/references/nextjs-security.md +201 -0
- package/skills/security-scanner/references/react-native-security.md +199 -0
- package/skills/security-scanner/scripts/security-scan.sh +478 -0
- package/skills/ui-ux-pro-max/SKILL.md +377 -0
- package/skills/ui-ux-pro-max/data/charts.csv +26 -0
- package/skills/ui-ux-pro-max/data/colors.csv +97 -0
- package/skills/ui-ux-pro-max/data/icons.csv +101 -0
- package/skills/ui-ux-pro-max/data/landing.csv +31 -0
- package/skills/ui-ux-pro-max/data/products.csv +97 -0
- package/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
- package/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
- package/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
- package/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
- package/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
- package/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
- package/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
- package/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/skills/ui-ux-pro-max/data/styles.csv +68 -0
- package/skills/ui-ux-pro-max/data/typography.csv +58 -0
- package/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
- package/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
- package/skills/ui-ux-pro-max/scripts/core.py +253 -0
- package/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
- package/skills/ui-ux-pro-max/scripts/search.py +114 -0
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
POST
|
|
2
|
+
/api/v1/jobs/createTask
|
|
3
|
+
Create Task
|
|
4
|
+
Create a new generation task
|
|
5
|
+
|
|
6
|
+
Request Parameters
|
|
7
|
+
The API accepts a JSON payload with the following structure:
|
|
8
|
+
|
|
9
|
+
Request Body Structure
|
|
10
|
+
{
|
|
11
|
+
"model": "string",
|
|
12
|
+
"callBackUrl": "string (optional)",
|
|
13
|
+
"input": {
|
|
14
|
+
// Input parameters based on form configuration
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
Root Level Parameters
|
|
18
|
+
model
|
|
19
|
+
Required
|
|
20
|
+
string
|
|
21
|
+
The model name to use for generation
|
|
22
|
+
|
|
23
|
+
Example:
|
|
24
|
+
|
|
25
|
+
"bytedance/v1-pro-image-to-video"
|
|
26
|
+
callBackUrl
|
|
27
|
+
Optional
|
|
28
|
+
string
|
|
29
|
+
Callback URL for task completion notifications. Optional parameter. If provided, the system will send POST requests to this URL when the task completes (success or failure). If not provided, no callback notifications will be sent.
|
|
30
|
+
|
|
31
|
+
Example:
|
|
32
|
+
|
|
33
|
+
"https://your-domain.com/api/callback"
|
|
34
|
+
Input Object Parameters
|
|
35
|
+
The input object contains the following parameters based on the form configuration:
|
|
36
|
+
|
|
37
|
+
input.prompt
|
|
38
|
+
Required
|
|
39
|
+
string
|
|
40
|
+
The text prompt used to generate the video
|
|
41
|
+
|
|
42
|
+
Max length: 10000 characters
|
|
43
|
+
Example:
|
|
44
|
+
|
|
45
|
+
"A golden retriever dashing through shallow surf at the beach, back angle camera low near waterline, splashes frozen in time, blur trails in waves and paws, afternoon sun glinting off wet fur, overcast day, dramatic clouds"
|
|
46
|
+
input.image_url
|
|
47
|
+
Required
|
|
48
|
+
string(URL)
|
|
49
|
+
The URL of the image used to generate video
|
|
50
|
+
|
|
51
|
+
Please provide the URL of the uploaded file; Accepted types: image/jpeg, image/png, image/webp; Max size: 10.0MB
|
|
52
|
+
Example:
|
|
53
|
+
|
|
54
|
+
"https://file.aiquickdraw.com/custom-page/akr/section-images/1755179021328w1nhip18.webp"
|
|
55
|
+
input.resolution
|
|
56
|
+
Optional
|
|
57
|
+
string
|
|
58
|
+
Video resolution - 480p for faster generation, 720p for balance, 1080p for higher quality
|
|
59
|
+
|
|
60
|
+
Available options:
|
|
61
|
+
|
|
62
|
+
480p
|
|
63
|
+
-
|
|
64
|
+
480p
|
|
65
|
+
720p
|
|
66
|
+
-
|
|
67
|
+
720p
|
|
68
|
+
1080p
|
|
69
|
+
-
|
|
70
|
+
1080p
|
|
71
|
+
Example:
|
|
72
|
+
|
|
73
|
+
"720p"
|
|
74
|
+
input.duration
|
|
75
|
+
Optional
|
|
76
|
+
string
|
|
77
|
+
Duration of the video in seconds
|
|
78
|
+
|
|
79
|
+
Available options:
|
|
80
|
+
|
|
81
|
+
5
|
|
82
|
+
-
|
|
83
|
+
5s
|
|
84
|
+
10
|
|
85
|
+
-
|
|
86
|
+
10s
|
|
87
|
+
Example:
|
|
88
|
+
|
|
89
|
+
"5"
|
|
90
|
+
input.camera_fixed
|
|
91
|
+
Optional
|
|
92
|
+
boolean
|
|
93
|
+
Whether to fix the camera position
|
|
94
|
+
|
|
95
|
+
Boolean value (true/false)
|
|
96
|
+
Example:
|
|
97
|
+
|
|
98
|
+
false
|
|
99
|
+
input.seed
|
|
100
|
+
Optional
|
|
101
|
+
number
|
|
102
|
+
Random seed to control video generation. Use -1 for random.
|
|
103
|
+
|
|
104
|
+
Min: -1, Max: 2147483647, Step: 1
|
|
105
|
+
Example:
|
|
106
|
+
|
|
107
|
+
-1
|
|
108
|
+
input.enable_safety_checker
|
|
109
|
+
Optional
|
|
110
|
+
boolean
|
|
111
|
+
The safety checker is always enabled in Playground. It can only be disabled by setting false through the API.
|
|
112
|
+
|
|
113
|
+
Boolean value (true/false)
|
|
114
|
+
Example:
|
|
115
|
+
|
|
116
|
+
true
|
|
117
|
+
Request Example
|
|
118
|
+
|
|
119
|
+
cURL
|
|
120
|
+
|
|
121
|
+
JavaScript
|
|
122
|
+
|
|
123
|
+
Python
|
|
124
|
+
curl -X POST "https://api.kie.ai/api/v1/jobs/createTask" \
|
|
125
|
+
-H "Content-Type: application/json" \
|
|
126
|
+
-H "Authorization: Bearer YOUR_API_KEY" \
|
|
127
|
+
-d '{
|
|
128
|
+
"model": "bytedance/v1-pro-image-to-video",
|
|
129
|
+
"callBackUrl": "https://your-domain.com/api/callback",
|
|
130
|
+
"input": {
|
|
131
|
+
"prompt": "A golden retriever dashing through shallow surf at the beach, back angle camera low near waterline, splashes frozen in time, blur trails in waves and paws, afternoon sun glinting off wet fur, overcast day, dramatic clouds",
|
|
132
|
+
"image_url": "https://file.aiquickdraw.com/custom-page/akr/section-images/1755179021328w1nhip18.webp",
|
|
133
|
+
"resolution": "720p",
|
|
134
|
+
"duration": "5",
|
|
135
|
+
"camera_fixed": false,
|
|
136
|
+
"seed": -1,
|
|
137
|
+
"enable_safety_checker": true
|
|
138
|
+
}
|
|
139
|
+
}'
|
|
140
|
+
Response Example
|
|
141
|
+
{
|
|
142
|
+
"code": 200,
|
|
143
|
+
"message": "success",
|
|
144
|
+
"data": {
|
|
145
|
+
"taskId": "task_12345678"
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
Response Fields
|
|
149
|
+
code
|
|
150
|
+
Status code, 200 for success, others for failure
|
|
151
|
+
message
|
|
152
|
+
Response message, error description when failed
|
|
153
|
+
data.taskId
|
|
154
|
+
Task ID for querying task status
|
|
155
|
+
Callback Notifications
|
|
156
|
+
When you provide the callBackUrl parameter when creating a task, the system will send POST requests to the specified URL upon task completion (success or failure).
|
|
157
|
+
|
|
158
|
+
Success Callback Example
|
|
159
|
+
{
|
|
160
|
+
"code": 200,
|
|
161
|
+
"data": {
|
|
162
|
+
"completeTime": 1755599644000,
|
|
163
|
+
"costTime": 8,
|
|
164
|
+
"createTime": 1755599634000,
|
|
165
|
+
"model": "bytedance/v1-pro-image-to-video",
|
|
166
|
+
"param": "{\"callBackUrl\":\"https://your-domain.com/api/callback\",\"model\":\"bytedance/v1-pro-image-to-video\",\"input\":{\"prompt\":\"A golden retriever dashing through shallow surf at the beach, back angle camera low near waterline, splashes frozen in time, blur trails in waves and paws, afternoon sun glinting off wet fur, overcast day, dramatic clouds\",\"image_url\":\"https://file.aiquickdraw.com/custom-page/akr/section-images/1755179021328w1nhip18.webp\",\"resolution\":\"720p\",\"duration\":\"5\",\"camera_fixed\":false,\"seed\":-1,\"enable_safety_checker\":true}}",
|
|
167
|
+
"resultJson": "{\"resultUrls\":[\"https://example.com/generated-image.jpg\"]}",
|
|
168
|
+
"state": "success",
|
|
169
|
+
"taskId": "e989621f54392584b05867f87b160672",
|
|
170
|
+
"failCode": null,
|
|
171
|
+
"failMsg": null,
|
|
172
|
+
},
|
|
173
|
+
"msg": "Playground task completed successfully."
|
|
174
|
+
}
|
|
175
|
+
Failure Callback Example
|
|
176
|
+
{
|
|
177
|
+
"code": 501,
|
|
178
|
+
"data": {
|
|
179
|
+
"completeTime": 1755597081000,
|
|
180
|
+
"costTime": 0,
|
|
181
|
+
"createTime": 1755596341000,
|
|
182
|
+
"failCode": "500",
|
|
183
|
+
"failMsg": "Internal server error",
|
|
184
|
+
"model": "bytedance/v1-pro-image-to-video",
|
|
185
|
+
"param": "{\"callBackUrl\":\"https://your-domain.com/api/callback\",\"model\":\"bytedance/v1-pro-image-to-video\",\"input\":{\"prompt\":\"A golden retriever dashing through shallow surf at the beach, back angle camera low near waterline, splashes frozen in time, blur trails in waves and paws, afternoon sun glinting off wet fur, overcast day, dramatic clouds\",\"image_url\":\"https://file.aiquickdraw.com/custom-page/akr/section-images/1755179021328w1nhip18.webp\",\"resolution\":\"720p\",\"duration\":\"5\",\"camera_fixed\":false,\"seed\":-1,\"enable_safety_checker\":true}}",
|
|
186
|
+
"state": "fail",
|
|
187
|
+
"taskId": "bd3a37c523149e4adf45a3ddb5faf1a8",
|
|
188
|
+
"resultJson": null,
|
|
189
|
+
},
|
|
190
|
+
"msg": "Playground task failed."
|
|
191
|
+
}
|
|
192
|
+
Important Notes
|
|
193
|
+
The callback content structure is identical to the Query Task API response
|
|
194
|
+
The param field contains the complete Create Task request parameters, not just the input section
|
|
195
|
+
If callBackUrl is not provided, no callback notifications will be sent
|
|
196
|
+
|
|
197
|
+
GET
|
|
198
|
+
/api/v1/jobs/recordInfo
|
|
199
|
+
Query Task
|
|
200
|
+
Query task status and results by task ID
|
|
201
|
+
|
|
202
|
+
Request Example
|
|
203
|
+
|
|
204
|
+
cURL
|
|
205
|
+
|
|
206
|
+
JavaScript
|
|
207
|
+
|
|
208
|
+
Python
|
|
209
|
+
curl -X GET "https://api.kie.ai/api/v1/jobs/recordInfo?taskId=task_12345678" \
|
|
210
|
+
-H "Authorization: Bearer YOUR_API_KEY"
|
|
211
|
+
Response Example
|
|
212
|
+
{
|
|
213
|
+
"code": 200,
|
|
214
|
+
"message": "success",
|
|
215
|
+
"data": {
|
|
216
|
+
"taskId": "task_12345678",
|
|
217
|
+
"model": "bytedance/v1-pro-image-to-video",
|
|
218
|
+
"state": "success",
|
|
219
|
+
"param": "{\"model\":\"bytedance/v1-pro-image-to-video\",\"callBackUrl\":\"https://your-domain.com/api/callback\",\"input\":{\"prompt\":\"A golden retriever dashing through shallow surf at the beach, back angle camera low near waterline, splashes frozen in time, blur trails in waves and paws, afternoon sun glinting off wet fur, overcast day, dramatic clouds\",\"image_url\":\"https://file.aiquickdraw.com/custom-page/akr/section-images/1755179021328w1nhip18.webp\",\"resolution\":\"720p\",\"duration\":\"5\",\"camera_fixed\":false,\"seed\":-1,\"enable_safety_checker\":true}}",
|
|
220
|
+
"resultJson": "{\"resultUrls\":[\"https://example.com/generated-image.jpg\"]}",
|
|
221
|
+
"failCode": "",
|
|
222
|
+
"failMsg": "",
|
|
223
|
+
"costTime": 0,
|
|
224
|
+
"completeTime": 1698765432000,
|
|
225
|
+
"createTime": 1698765400000
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
Response Fields
|
|
229
|
+
code
|
|
230
|
+
Status code, 200 for success, others for failure
|
|
231
|
+
message
|
|
232
|
+
Response message, error description when failed
|
|
233
|
+
data.taskId
|
|
234
|
+
Task ID
|
|
235
|
+
data.model
|
|
236
|
+
Model used for generation
|
|
237
|
+
data.state
|
|
238
|
+
Generation state
|
|
239
|
+
data.param
|
|
240
|
+
Complete Create Task request parameters as JSON string (includes model, callBackUrl, input and all other parameters)
|
|
241
|
+
data.resultJson
|
|
242
|
+
Result JSON string containing generated media URLs
|
|
243
|
+
data.failCode
|
|
244
|
+
Error code (when generation failed)
|
|
245
|
+
data.failMsg
|
|
246
|
+
Error message (when generation failed)
|
|
247
|
+
data.completeTime
|
|
248
|
+
Completion timestamp
|
|
249
|
+
data.createTime
|
|
250
|
+
Creation timestamp
|
|
251
|
+
data.costTime
|
|
252
|
+
Cost time in milliseconds
|
|
253
|
+
State Values
|
|
254
|
+
waiting
|
|
255
|
+
Waiting for generation
|
|
256
|
+
queuing
|
|
257
|
+
In queue
|
|
258
|
+
generating
|
|
259
|
+
Generating
|
|
260
|
+
success
|
|
261
|
+
Generation successful
|
|
262
|
+
fail
|
|
263
|
+
Generation failed
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
example input
|
|
267
|
+
GET
|
|
268
|
+
/api/v1/jobs/recordInfo
|
|
269
|
+
Query Task
|
|
270
|
+
Query task status and results by task ID
|
|
271
|
+
|
|
272
|
+
Request Example
|
|
273
|
+
|
|
274
|
+
cURL
|
|
275
|
+
|
|
276
|
+
JavaScript
|
|
277
|
+
|
|
278
|
+
Python
|
|
279
|
+
curl -X GET "https://api.kie.ai/api/v1/jobs/recordInfo?taskId=task_12345678" \
|
|
280
|
+
-H "Authorization: Bearer YOUR_API_KEY"
|
|
281
|
+
Response Example
|
|
282
|
+
{
|
|
283
|
+
"code": 200,
|
|
284
|
+
"message": "success",
|
|
285
|
+
"data": {
|
|
286
|
+
"taskId": "task_12345678",
|
|
287
|
+
"model": "bytedance/v1-pro-image-to-video",
|
|
288
|
+
"state": "success",
|
|
289
|
+
"param": "{\"model\":\"bytedance/v1-pro-image-to-video\",\"callBackUrl\":\"https://your-domain.com/api/callback\",\"input\":{\"prompt\":\"A golden retriever dashing through shallow surf at the beach, back angle camera low near waterline, splashes frozen in time, blur trails in waves and paws, afternoon sun glinting off wet fur, overcast day, dramatic clouds\",\"image_url\":\"https://file.aiquickdraw.com/custom-page/akr/section-images/1755179021328w1nhip18.webp\",\"resolution\":\"720p\",\"duration\":\"5\",\"camera_fixed\":false,\"seed\":-1,\"enable_safety_checker\":true}}",
|
|
290
|
+
"resultJson": "{\"resultUrls\":[\"https://example.com/generated-image.jpg\"]}",
|
|
291
|
+
"failCode": "",
|
|
292
|
+
"failMsg": "",
|
|
293
|
+
"costTime": 0,
|
|
294
|
+
"completeTime": 1698765432000,
|
|
295
|
+
"createTime": 1698765400000
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
Response Fields
|
|
299
|
+
code
|
|
300
|
+
Status code, 200 for success, others for failure
|
|
301
|
+
message
|
|
302
|
+
Response message, error description when failed
|
|
303
|
+
data.taskId
|
|
304
|
+
Task ID
|
|
305
|
+
data.model
|
|
306
|
+
Model used for generation
|
|
307
|
+
data.state
|
|
308
|
+
Generation state
|
|
309
|
+
data.param
|
|
310
|
+
Complete Create Task request parameters as JSON string (includes model, callBackUrl, input and all other parameters)
|
|
311
|
+
data.resultJson
|
|
312
|
+
Result JSON string containing generated media URLs
|
|
313
|
+
data.failCode
|
|
314
|
+
Error code (when generation failed)
|
|
315
|
+
data.failMsg
|
|
316
|
+
Error message (when generation failed)
|
|
317
|
+
data.completeTime
|
|
318
|
+
Completion timestamp
|
|
319
|
+
data.createTime
|
|
320
|
+
Creation timestamp
|
|
321
|
+
data.costTime
|
|
322
|
+
Cost time in milliseconds
|
|
323
|
+
State Values
|
|
324
|
+
waiting
|
|
325
|
+
Waiting for generation
|
|
326
|
+
queuing
|
|
327
|
+
In queue
|
|
328
|
+
generating
|
|
329
|
+
Generating
|
|
330
|
+
success
|
|
331
|
+
Generation successful
|
|
332
|
+
fail
|
|
333
|
+
Generation failed
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
ouput
|
|
337
|
+
{
|
|
338
|
+
"resultUrls": [
|
|
339
|
+
"https://file.aiquickdraw.com/custom-page/akr/section-images/17551796948046brblmi1.mp4"
|
|
340
|
+
]
|
|
341
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
curl -X 'POST' \
|
|
2
|
+
'https://api.styai.app/api/v1/media/remove-background' \
|
|
3
|
+
-H 'accept: application/json' \
|
|
4
|
+
-H 'X-API-Key: pat_lJ8bAVjHn2_moLH1zxdTm9NnU8rvUcw8HyiQtuHg' \
|
|
5
|
+
-H 'Content-Type: multipart/form-data' \
|
|
6
|
+
-F 'file=@intro-step1.png;type=image/png' \
|
|
7
|
+
-F 'cropToForeground=false' \
|
|
8
|
+
-F 'targetSize=1024 768' \
|
|
9
|
+
-F 'outputFormat=png'
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
output
|
|
13
|
+
{
|
|
14
|
+
buffer: "base64",
|
|
15
|
+
contentType: "image/png",
|
|
16
|
+
size: 300000,
|
|
17
|
+
processingTime: 1000,
|
|
18
|
+
sucess: true
|
|
19
|
+
}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Credit Feature Asset Generator
|
|
5
|
+
*
|
|
6
|
+
* Generates hero illustrations for the Earn Credits screen
|
|
7
|
+
* using the KIE AI API (nano-banana-pro).
|
|
8
|
+
*
|
|
9
|
+
* Assets:
|
|
10
|
+
* 1. earn-hero.png - Main hero background for the earn credits screen
|
|
11
|
+
* 2. coin-reward.png - Sty coin/reward illustration (transparent bg)
|
|
12
|
+
* 3. streak-fire.png - Daily streak fire illustration (transparent bg)
|
|
13
|
+
*
|
|
14
|
+
* Brand palette:
|
|
15
|
+
* Rose #EC4899 primary, #FFF1F3 → #FFE4E9 → #FECDD6 → #FDA4B8 gradient
|
|
16
|
+
* Task colors: Blue #3B82F6, Green #22C55E, Purple #8B5CF6, Amber #F59E0B
|
|
17
|
+
*
|
|
18
|
+
* Usage:
|
|
19
|
+
* node tools/generate-credit-assets.mjs
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import { join, dirname } from "path";
|
|
23
|
+
import { fileURLToPath } from "url";
|
|
24
|
+
import { loadEnv } from "./lib/env.mjs";
|
|
25
|
+
import { createTask, pollUntilDone, downloadFile, log } from "./lib/kie-client.mjs";
|
|
26
|
+
import { removeBackground } from "./lib/bg-remove.mjs";
|
|
27
|
+
|
|
28
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
29
|
+
const OUTPUT_DIR = join(__dirname, "..", "styai-mobile", "src", "assets", "images", "credits");
|
|
30
|
+
|
|
31
|
+
// ─── Asset Definitions ──────────────────────────────────────
|
|
32
|
+
const IMAGE_ASSETS = [
|
|
33
|
+
{
|
|
34
|
+
name: "earn-hero",
|
|
35
|
+
filename: "earn-hero.png",
|
|
36
|
+
aspect_ratio: "16:9",
|
|
37
|
+
resolution: "2K",
|
|
38
|
+
removeBg: false,
|
|
39
|
+
prompt: [
|
|
40
|
+
"Abstract soft blurred background banner for a mobile app card header.",
|
|
41
|
+
"Smooth dreamy gradient from blush pink (#FFF1F3) on left to rose (#FECDD6) center to mauve pink (#FDA4B8) on right.",
|
|
42
|
+
"Scattered soft bokeh circles in light rose and white, gentle and out of focus.",
|
|
43
|
+
"A few tiny sparkle dots in rose-gold tones, very subtle and sparse.",
|
|
44
|
+
"Soft diagonal light streak from top-left, warm and diffused.",
|
|
45
|
+
"The overall feel is premium, feminine, airy, like a luxury fashion brand background.",
|
|
46
|
+
"No objects, no coins, no icons, no shapes in focus. Just an abstract atmospheric background.",
|
|
47
|
+
"Very clean and minimal, suitable for overlaying text and icons on top.",
|
|
48
|
+
"Ultra smooth gradients, no harsh edges, dreamlike soft-focus photography style.",
|
|
49
|
+
"No text, no typography, no logos, no people, no watermarks, no UI elements.",
|
|
50
|
+
].join(" "),
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: "coin-reward",
|
|
54
|
+
filename: "coin-reward.png",
|
|
55
|
+
aspect_ratio: "1:1",
|
|
56
|
+
resolution: "1K",
|
|
57
|
+
removeBg: true,
|
|
58
|
+
prompt: [
|
|
59
|
+
"Premium 3D render of a single stylish reward coin, centered on pure white background.",
|
|
60
|
+
"The coin is polished rose-gold (#EC4899) with luxurious metallic sheen and soft reflections.",
|
|
61
|
+
"On the coin face: a clean minimalist 5-pointed star, embossed with soft beveled edges.",
|
|
62
|
+
"The coin has a refined thin rim with subtle ridge detailing, like a luxury medallion.",
|
|
63
|
+
"Slight 15-degree tilt showing the coin's thickness and 3D depth.",
|
|
64
|
+
"Warm ambient glow radiating behind: rose-pink (#FDA4B8) halo with soft falloff.",
|
|
65
|
+
"4-5 tiny sparkle particles floating around the coin in blush and champagne gold.",
|
|
66
|
+
"One small light streak crossing the coin surface for premium shine effect.",
|
|
67
|
+
"Clean white background, professional studio three-point lighting, razor sharp focus.",
|
|
68
|
+
"Photorealistic 3D render, luxury product photography, fashion accessory aesthetic.",
|
|
69
|
+
"No text, no typography, no logos, no people, no watermarks.",
|
|
70
|
+
].join(" "),
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: "streak-fire",
|
|
74
|
+
filename: "streak-fire.png",
|
|
75
|
+
aspect_ratio: "1:1",
|
|
76
|
+
resolution: "1K",
|
|
77
|
+
removeBg: true,
|
|
78
|
+
prompt: [
|
|
79
|
+
"Premium 3D render of a stylized flame icon, centered on pure white background.",
|
|
80
|
+
"The flame is elegant and fashion-forward, made of gradient from rose (#EC4899)",
|
|
81
|
+
"at base to coral (#F87198) mid to warm pink (#FDA4B8) at tip.",
|
|
82
|
+
"Smooth glossy surface with a gentle metallic sheen, like a luxury enamel brooch.",
|
|
83
|
+
"The flame shape is clean, stylized, and slightly abstract — not realistic fire.",
|
|
84
|
+
"Two inner flicker shapes inside the flame in lighter rose tones for depth.",
|
|
85
|
+
"Subtle warm glow at the base, blush (#FFE4E9) ambient light spreading outward.",
|
|
86
|
+
"3-4 tiny sparkle particles in rose and gold tones floating near the tip.",
|
|
87
|
+
"Clean white background, professional studio lighting, ultra sharp focus.",
|
|
88
|
+
"Photorealistic 3D render, luxury product photography style.",
|
|
89
|
+
"No text, no typography, no logos, no people, no watermarks.",
|
|
90
|
+
"Fashion-forward, premium gamification aesthetic, celebratory feel.",
|
|
91
|
+
].join(" "),
|
|
92
|
+
},
|
|
93
|
+
];
|
|
94
|
+
|
|
95
|
+
// ─── Main ───────────────────────────────────────────────────
|
|
96
|
+
async function main() {
|
|
97
|
+
await loadEnv();
|
|
98
|
+
|
|
99
|
+
if (!process.env.KIE_AI_API_KEY) {
|
|
100
|
+
console.error("Error: KIE_AI_API_KEY not found. Check .env");
|
|
101
|
+
process.exit(1);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
console.log("\n========================================");
|
|
105
|
+
console.log(" Credit Feature Asset Generator");
|
|
106
|
+
console.log(" Brand: Rose #EC4899 | Sty AI");
|
|
107
|
+
console.log("========================================\n");
|
|
108
|
+
|
|
109
|
+
// Phase 1: Submit all tasks
|
|
110
|
+
log("--- Phase 1: Submitting image tasks ---\n");
|
|
111
|
+
|
|
112
|
+
const jobs = await Promise.all(
|
|
113
|
+
IMAGE_ASSETS.map(async (asset) => {
|
|
114
|
+
log(` [submit] ${asset.name} (${asset.aspect_ratio} ${asset.resolution})`);
|
|
115
|
+
const taskId = await createTask({
|
|
116
|
+
model: "nano-banana-pro",
|
|
117
|
+
input: {
|
|
118
|
+
prompt: asset.prompt,
|
|
119
|
+
aspect_ratio: asset.aspect_ratio,
|
|
120
|
+
resolution: asset.resolution,
|
|
121
|
+
output_format: "png",
|
|
122
|
+
},
|
|
123
|
+
});
|
|
124
|
+
log(` [queued] ${asset.name} taskId=${taskId}`);
|
|
125
|
+
return { ...asset, taskId };
|
|
126
|
+
})
|
|
127
|
+
);
|
|
128
|
+
|
|
129
|
+
// Phase 2: Poll all tasks
|
|
130
|
+
log(`\n--- Phase 2: Polling ${jobs.length} image tasks ---\n`);
|
|
131
|
+
|
|
132
|
+
const results = await Promise.all(
|
|
133
|
+
jobs.map(async (job) => {
|
|
134
|
+
const url = await pollUntilDone(job.taskId, job.name);
|
|
135
|
+
return { ...job, resultUrl: url };
|
|
136
|
+
})
|
|
137
|
+
);
|
|
138
|
+
|
|
139
|
+
// Phase 3: Download images
|
|
140
|
+
log("\n--- Phase 3: Downloading images ---\n");
|
|
141
|
+
|
|
142
|
+
for (const r of results) {
|
|
143
|
+
const dest = join(OUTPUT_DIR, r.filename);
|
|
144
|
+
await downloadFile(r.resultUrl, dest);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// Phase 4: Remove backgrounds where needed
|
|
148
|
+
const bgRemoveJobs = results.filter((r) => r.removeBg);
|
|
149
|
+
if (bgRemoveJobs.length > 0) {
|
|
150
|
+
log("\n--- Phase 4: Removing backgrounds ---\n");
|
|
151
|
+
for (const r of bgRemoveJobs) {
|
|
152
|
+
const src = join(OUTPUT_DIR, r.filename);
|
|
153
|
+
const noBgName = r.filename.replace(".png", "-nobg.png");
|
|
154
|
+
const dest = join(OUTPUT_DIR, noBgName);
|
|
155
|
+
try {
|
|
156
|
+
await removeBackground(src, dest);
|
|
157
|
+
} catch (err) {
|
|
158
|
+
log(` [warn] Background removal failed for ${r.name}: ${err.message}`);
|
|
159
|
+
log(` [skip] Keeping original ${r.filename}`);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
console.log("\n========================================");
|
|
165
|
+
console.log(" All done!");
|
|
166
|
+
console.log("========================================");
|
|
167
|
+
console.log(`\nGenerated assets in ${OUTPUT_DIR}:`);
|
|
168
|
+
for (const r of results) {
|
|
169
|
+
console.log(` - ${r.filename} (${r.name})`);
|
|
170
|
+
if (r.removeBg) {
|
|
171
|
+
console.log(` - ${r.filename.replace(".png", "-nobg.png")} (${r.name} no bg)`);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
console.log("");
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
main().catch((err) => {
|
|
178
|
+
console.error(`\nFatal: ${err.message}`);
|
|
179
|
+
process.exit(1);
|
|
180
|
+
});
|